:root {
  --workflow-ink: #10232e;
  --workflow-muted: #60717b;
  --workflow-line: #d7e1e5;
  --workflow-surface: #ffffff;
  --workflow-canvas: #f4f7f8;
  --workflow-brand: #1a4f66;
  --workflow-brand-strong: #123d52;
  --workflow-brand-soft: #eaf3f6;
  --workflow-cue: #d4a94f;
  --workflow-ok: #238360;
  --workflow-danger: #b8473f;
  --workflow-shadow: 0 18px 48px rgba(16, 35, 46, 0.08);
}

/* The four-step creator is a stateful application, not a scrolling document. */
body.view-workspace {
  background: var(--workflow-canvas) !important;
}

/* The current-take chips describe the active creation flow.  Keep them out of
   standalone asset libraries where they otherwise read as unrelated chrome. */
body:not(.view-workspace) .workflow-summary {
  display: none !important;
}

.topbar-actions .topbar-portrait-tour {
  display: none !important;
  min-height: 44px !important;
  padding-inline: 14px !important;
  white-space: nowrap;
}

body.view-portrait .topbar-actions .topbar-portrait-tour {
  display: inline-flex !important;
  align-items: center;
}

body.view-portrait .simple-library-head .actions > button {
  min-height: 44px !important;
}

body.view-workspace .app-body {
  display: grid !important;
  grid-template-columns: 256px minmax(0, 1fr) !important;
  min-height: 100vh !important;
  padding: 88px 0 0 !important;
}

body.view-workspace .main-content {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 30px clamp(24px, 4vw, 64px) 72px !important;
}

body.view-workspace .workflow-side {
  position: sticky !important;
  z-index: 35 !important;
  top: 88px !important;
  display: flex !important;
  align-self: start !important;
  width: 256px !important;
  min-height: calc(100vh - 88px) !important;
  max-height: calc(100vh - 88px) !important;
  padding: 28px 18px 20px !important;
  overflow-y: auto !important;
  border-right: 1px solid var(--workflow-line) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(18px) !important;
}

body.view-workspace .side-flow-title {
  display: grid !important;
  gap: 5px !important;
  margin: 0 8px 22px !important;
}

body.view-workspace .side-flow-title b {
  color: var(--workflow-ink) !important;
  font-size: 18px !important;
  letter-spacing: -0.02em !important;
}

body.view-workspace .side-flow-title span {
  color: var(--workflow-muted) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

body.view-workspace .workflow-side .workspace-step {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 11px !important;
  width: 100% !important;
  min-height: 72px !important;
  margin: 0 0 8px !important;
  padding: 10px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  color: var(--workflow-ink) !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

body.view-workspace .workflow-side .workspace-step:hover:not(.is-locked),
body.view-workspace .workflow-side .workspace-step.is-active {
  border-color: #cfdee3 !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(16, 35, 46, 0.07) !important;
}

body.view-workspace .workflow-side .workspace-step.is-active {
  box-shadow: inset 3px 0 0 var(--workflow-brand), 0 10px 28px rgba(16, 35, 46, 0.07) !important;
}

body.view-workspace .workflow-side .workspace-step.is-active::after,
body.view-workspace .workflow-side .workspace-step::after {
  position: static !important;
  width: auto !important;
  height: auto !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--workflow-muted) !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  white-space: nowrap !important;
}

body.view-workspace .workflow-side .workspace-step[data-step-state="current"]::after { content: "当前" !important; color: var(--workflow-brand) !important; }
body.view-workspace .workflow-side .workspace-step[data-step-state="completed"]::after { content: "完成" !important; color: var(--workflow-ok) !important; }
body.view-workspace .workflow-side .workspace-step[data-step-state="error"]::after { content: "异常" !important; color: var(--workflow-danger) !important; }
body.view-workspace .workflow-side .workspace-step[data-step-state="locked"]::after { content: "未解锁" !important; }

body.view-workspace .workflow-side .workspace-step.is-locked {
  cursor: not-allowed !important;
  opacity: 0.58 !important;
}

body.view-workspace .workflow-side .side-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  color: var(--workflow-brand) !important;
  background: var(--workflow-brand-soft) !important;
}

body.view-workspace .workflow-side .workspace-step.is-active .side-icon {
  color: #fff !important;
  background: var(--workflow-brand) !important;
}

body.view-workspace .workflow-side .workspace-step b {
  display: block !important;
  margin: 0 0 3px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
}

body.view-workspace .workflow-side .workspace-step small {
  display: block !important;
  color: var(--workflow-muted) !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

body.view-workspace .workspace-intro,
body.view-workspace #taskHud,
body.view-workspace .side-invite {
  display: none !important;
}

body.view-workspace .workflow-sidebar-diagnostics {
  display: block !important;
  width: 100%;
  margin: 18px 0 0 !important;
  padding: 12px 10px 0;
  border-top: 1px solid var(--workflow-line);
}

body.view-workspace .workflow-sidebar-diagnostics > summary {
  min-height: 40px;
  color: var(--workflow-muted);
  font-size: 12px;
  font-weight: 760;
}

body.view-workspace .workflow-sidebar-diagnostics .collapsible-body {
  display: grid;
  gap: 8px;
  padding: 8px 0 0;
}

body.view-workspace .workflow-sidebar-diagnostics .collapsible {
  display: block !important;
  margin: 0 !important;
}

body.view-workspace .workflow-sidebar-diagnostics .collapsible > summary {
  min-height: 36px;
  color: var(--workflow-muted);
  font-size: 12px;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log > summary {
  min-height: 30px;
  padding: 0 !important;
  cursor: default;
  background: transparent !important;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log > summary::after {
  display: none;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log > .collapsible-body {
  padding: 0 !important;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log .log-list {
  display: block;
  height: 150px;
  max-height: 150px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(244, 249, 248, 0.86);
  color: var(--workflow-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
}

body.view-workspace .workflow-sidebar-diagnostics .workflow-sidebar-log .log-item {
  padding: 4px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit;
}

body.view-workspace #section-generation-workbench .section-head .title-wrap,
body.view-workspace #section-preview-workbench .section-head .title-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 10px;
}

body.view-workspace .workflow-title-note,
body.view-workspace #section-preview-workbench .workflow-result-status {
  display: inline-flex !important;
  align-items: baseline;
  gap: 5px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--workflow-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 1.45;
}

body.view-workspace #section-preview-workbench .workflow-result-status b {
  color: var(--workflow-muted);
  font-size: 12px;
}

body.view-workspace #section-preview-workbench .workflow-result-status span {
  color: var(--workflow-muted);
  font-size: 12px;
}

body.view-workspace #section-core-config > .topic-panel-header .section-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 10px 14px !important;
}

body.view-workspace #section-core-config > .topic-panel-header .title-wrap {
  grid-column: 1;
}

body.view-workspace #section-core-config > .topic-panel-header #projectSummary {
  grid-column: 2;
  grid-row: 1;
}

body.view-workspace #section-core-config > .topic-panel-header .workflow-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-column: 1 / -1;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--workflow-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.workflow-summary-main {
  min-width: 0;
}

.workflow-summary-kicker {
  display: none;
  color: var(--workflow-brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.workflow-summary-title {
  display: block;
  overflow: hidden;
  color: var(--workflow-ink);
  font-size: 13px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.workflow-summary-meta span,
.workflow-state-chip {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #d9e4e7;
  border-radius: 999px;
  color: #4d626d;
  background: #f8fbfc;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
}

body.view-workspace .layout {
  display: block !important;
  width: min(1440px, 100%) !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
}

body.view-workspace #leftWorkspace,
body.view-workspace #rightWorkspace {
  display: block !important;
  min-width: 0 !important;
}

body.view-workspace #leftWorkspace > *,
body.view-workspace #rightWorkspace > * {
  display: none !important;
}

body.view-workspace .workflow-panel.workflow-panel-active {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 26px !important;
  border: 1px solid var(--workflow-line) !important;
  border-radius: 20px !important;
  background: var(--workflow-surface) !important;
  box-shadow: var(--workflow-shadow) !important;
  overflow: visible !important;
}

body.view-workspace #leftWorkspace > .workflow-panel.workflow-panel-active,
body.view-workspace #rightWorkspace > .workflow-panel.workflow-panel-active {
  display: block !important;
}

body.view-workspace #section-core-config.workflow-panel-active > .topic-panel-header {
  display: block !important;
  padding: 0 0 18px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Keep the topic title, current-take strip, assets and editor in one surface.
   The legacy input view reset the details element to transparent and left only
   its inner workbench white, which made the header look like a separate card. */
body.view-workspace #section-core-config.workflow-panel-active {
  padding: 26px !important;
  border: 1px solid var(--workflow-line) !important;
  border-radius: 20px !important;
  background: var(--workflow-surface) !important;
  box-shadow: var(--workflow-shadow) !important;
  overflow: visible !important;
}

body.view-workspace #section-core-config.workflow-panel-active .studio-topic-workbench {
  display: grid !important;
  grid-template-columns: 1fr !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.view-workspace .workflow-panel .section-head {
  align-items: flex-start !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
}

body.view-workspace .workflow-panel h2 {
  color: var(--workflow-ink) !important;
  font-size: clamp(22px, 2.2vw, 28px) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.03em !important;
}

body.view-workspace .workflow-panel .section-head .title-copy h2::before {
  display: none !important;
}

body.view-workspace .workflow-panel .section-body,
body.view-workspace .workflow-panel .section-grid,
body.view-workspace .workflow-panel .script-confirm-panel {
  width: 100% !important;
  min-width: 0 !important;
}

@media (min-width: 960px) {
  body.view-workspace .layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr) !important;
    align-items: stretch;
    gap: 18px;
  }

  /* The first workspace entry compares topic and script side by side. Once a
     video plan is ready, the combined generation/result flow owns the whole
     canvas so its stacked cards do not leave an empty companion column. */
  body.view-workspace[data-workflow-step="generation"] .layout,
  body.view-workspace[data-workflow-step="result"] .layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.view-workspace[data-workflow-step="generation"] #rightWorkspace,
  body.view-workspace[data-workflow-step="result"] #rightWorkspace {
    grid-column: 1 !important;
    width: 100% !important;
  }

  /* The source panels live in different workspace stacks.  Keep the stacks
     as the two grid children so their active cards always share one top edge. */
  body.view-workspace #leftWorkspace {
    grid-column: 1;
    align-self: stretch;
    display: flex !important;
    flex-direction: column;
  }

  body.view-workspace #rightWorkspace {
    grid-column: 2;
    align-self: stretch;
    display: flex !important;
    flex-direction: column;
  }

  body.view-workspace #section-core-config.workflow-panel-active,
  body.view-workspace #section-script-workbench.workflow-panel-active {
    height: 100%;
    min-height: 0;
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
  }

  /* Each card owns a flexible content region and a bottom action region.
     Creating a task changes status text, but must not move either primary
     action vertically. */
  body.view-workspace #section-core-config.workflow-panel-active .section-body {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
  }

  body.view-workspace #section-core-config.workflow-panel-active .studio-topic-workbench {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body.view-workspace #section-core-config .workflow-validation-message {
    order: 1;
    min-height: 38px;
    margin: 0;
  }

  body.view-workspace #section-core-config .studio-asset-row {
    order: 2;
  }

  body.view-workspace #section-core-config .studio-topic-shell {
    order: 3;
    min-height: 0;
    grid-template-rows: auto minmax(310px, 1fr) auto;
  }

  body.view-workspace #section-core-config .studio-topic-input {
    height: 100%;
  }

  body.view-workspace #section-core-config .studio-create-row {
    order: 4;
    align-self: stretch;
  }

  body.view-workspace #section-script-workbench .script-confirm-panel {
    display: grid !important;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body.view-workspace #section-script-workbench .script-confirm-panel > .field {
    display: grid;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  /* Match the script actions to the topic card's bottom action row. */
  body.view-workspace #oralCopyEditor.copy-editor {
    height: 100%;
    min-height: 508px !important;
  }
}

@media (max-width: 959px) {
  body.view-workspace .layout {
    display: block !important;
  }

  body.view-workspace #leftWorkspace,
  body.view-workspace #rightWorkspace {
    display: block !important;
  }

  body.view-workspace #section-script-workbench.workflow-panel-active {
    margin-top: 16px !important;
  }

}

body.view-workspace .builder-shell,
body.view-workspace #projectForm,
body.view-workspace .workflow-legacy-hidden {
  display: none !important;
}

body.view-workspace .studio-topic-shell {
  border-color: #cfdde2 !important;
  background: #fbfdfe !important;
  box-shadow: inset 0 0 0 1px rgba(26, 79, 102, 0.025) !important;
}

body.view-workspace .studio-topic-input,
body.view-workspace .copy-editor {
  color: var(--workflow-ink) !important;
  background: #fff !important;
}

body.view-workspace .studio-topic-input:focus,
body.view-workspace .copy-editor:focus,
body.view-workspace select:focus-visible,
body.view-workspace button:focus-visible,
body.view-workspace a:focus-visible {
  outline: 3px solid rgba(26, 79, 102, 0.22) !important;
  outline-offset: 2px !important;
}

body.view-workspace .studio-create-btn,
body.view-workspace #generateScriptBtn,
body.view-workspace #prepareVideoBlueprintBtn,
body.view-workspace #createGenerationPlanBtn {
  min-height: 48px !important;
  border-radius: 12px !important;
  background: var(--workflow-brand) !important;
  box-shadow: 0 12px 24px rgba(26, 79, 102, 0.18) !important;
}

body.view-workspace #prepareVideoBlueprintBtn {
  color: #fff !important;
}

body.view-workspace button:disabled {
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.5 !important;
}

.workflow-validation-message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 10px;
  color: var(--workflow-muted);
  font-size: 12px;
  line-height: 1.45;
}

.workflow-validation-message::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--workflow-cue);
  box-shadow: 0 0 0 4px rgba(212, 169, 79, 0.14);
}

.workflow-validation-message.is-ready::before {
  background: var(--workflow-ok);
  box-shadow: 0 0 0 4px rgba(35, 131, 96, 0.12);
}

.workflow-inline-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e4ebee;
}

.workflow-inline-nav button {
  min-height: 44px !important;
}

.workflow-script-status,
.workflow-generation-summary,
.workflow-result-status {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #d9e5e8;
  border-radius: 14px;
  color: var(--workflow-ink);
  background: #f8fbfc;
}

.workflow-script-status b,
.workflow-generation-summary b,
.workflow-result-status b {
  font-size: 13px;
}

.workflow-script-status span,
.workflow-generation-summary span,
.workflow-result-status span {
  color: var(--workflow-muted);
  font-size: 12px;
  line-height: 1.5;
}

body.view-workspace #section-generation-workbench > .section-grid > .surface-note:first-child {
  display: none !important;
}

body.view-workspace .workflow-secondary-actions {
  margin-top: 4px !important;
}

body.view-workspace .workflow-secondary-actions > summary {
  min-height: 44px !important;
  color: var(--workflow-brand) !important;
  font-size: 13px !important;
  font-weight: 760 !important;
}

body.view-workspace #section-preview-workbench.is-result-empty .media-grid {
  grid-template-columns: 1fr !important;
}

body.view-workspace #section-preview-workbench.is-result-empty .video-box {
  display: none !important;
}

body.view-workspace #section-preview-workbench:not(.is-result-empty) .video-box {
  max-height: min(68vh, 720px) !important;
  margin: 0 auto !important;
}

body.view-workspace #section-preview-workbench .result-side-stack > .collapsible {
  display: none !important;
}

body.view-workspace #section-preview-workbench .result-side-stack > .workflow-advanced-diagnostics {
  display: block !important;
  margin-top: 8px !important;
}

.workflow-result-records {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e4ebee;
}

.workflow-result-records button {
  min-height: 44px !important;
}

.video-progress-step.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.video-progress-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: #fff;
  border-radius: 50%;
  animation: workflow-progress-spin 0.75s linear infinite;
}

@keyframes workflow-progress-spin { to { transform: rotate(360deg); } }

.workflow-advanced-diagnostics > summary {
  min-height: 44px;
  color: var(--workflow-muted);
  font-size: 12px;
}

.workflow-empty-action {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 28px;
  border: 1px dashed #bfd0d7;
  border-radius: 16px;
  text-align: center;
  background: #f8fbfc;
}

.workflow-empty-action b { color: var(--workflow-ink); font-size: 16px; }
.workflow-empty-action span { max-width: 360px; color: var(--workflow-muted); font-size: 13px; line-height: 1.6; }
.workflow-empty-action button { min-height: 44px; margin-top: 4px; }

.asset-picker-create-action {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding: 12px 2px 2px;
  border-top: 1px solid rgba(35, 72, 61, 0.12);
  color: var(--workflow-muted);
  font-size: 13px;
  line-height: 1.5;
}

.asset-picker-create-action button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 11px;
  color: #fff;
  background: var(--workflow-brand);
}

/* The creation method cards sit on the brand surface.  Keep their secondary
   copy readable without changing muted text tokens used elsewhere. */
#simpleAssetCreateModal #simpleAssetUploadChoice > span,
#simpleAssetCreateModal #simpleAssetAIChoice > span {
  color: #fff !important;
}

.asset-picker-pending {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 84px;
  padding: 12px;
  border: 1px solid #d4e1e5;
  border-radius: 14px;
  color: var(--workflow-ink);
  background: #f8fbfc;
}

.asset-picker-pending-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid #c9dce2;
  border-top-color: var(--workflow-brand);
  border-radius: 50%;
  color: var(--workflow-danger);
  font-weight: 800;
  animation: workflow-picker-spin 0.9s linear infinite;
}

.asset-picker-pending-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asset-picker-pending-copy b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-pending-copy small {
  color: var(--workflow-muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-picker-pending.is-failed {
  border-color: #efd4d0;
  background: #fff9f8;
}

.asset-picker-pending.is-failed .asset-picker-pending-icon {
  border: 0;
  color: #fff;
  background: var(--workflow-danger);
  animation: none;
}

@keyframes workflow-picker-spin { to { transform: rotate(360deg); } }

body.view-workspace #section-script-workbench.workflow-script-segment.workflow-panel-active {
  display: block !important;
}

/* Generation and results are one continuous workspace.  Hash navigation keeps
   its existing entry points, while the two independent cards stay stacked in
   execution order: configure and submit first, then monitor or view output. */
body.view-workspace #section-generation-workbench.workflow-generation-result-combined.workflow-panel-active,
body.view-workspace #section-preview-workbench.workflow-result-segment.workflow-panel-active {
  display: block !important;
  width: 100% !important;
}

.video-preview-column {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

@media (max-width: 520px) {
  .asset-picker-actions {
    width: 100%;
  }

  .asset-picker-actions button {
    flex: 1 1 0;
  }

  .asset-picker-create-action {
    align-items: stretch;
    flex-direction: column;
  }

  .asset-picker-create-action button { width: 100%; }

  .workflow-topic-compact-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-topic-compact-summary button { width: 100%; }

}

#homeAdvancedModal .basic-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#homeAdvancedModal .advanced-settings-grid {
  display: block !important;
}

#homeAdvancedModal .advanced-creative-settings {
  margin-top: 16px;
  border: 1px solid var(--workflow-line);
  border-radius: 14px;
  background: #f8fbfc;
}

#homeAdvancedModal .advanced-creative-settings > summary {
  min-height: 50px;
  padding: 14px 16px;
  color: var(--workflow-ink);
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

#homeAdvancedModal .advanced-creative-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.workflow-mobile-actions,
.workflow-mobile-menu-button {
  display: none;
}

@media (max-width: 900px) {
  body.view-workspace .shell {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.view-workspace .app-topbar {
    min-height: 64px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "brand actions" !important;
    gap: 8px !important;
    padding: 8px 12px !important;
  }

  body.view-workspace .app-topbar .brand-row {
    grid-area: brand !important;
  }

  body.view-workspace .brand-logo {
    width: 40px !important;
    height: 40px !important;
    border-radius: 11px !important;
  }

  body.view-workspace .app-topbar strong {
    font-size: 16px !important;
  }

  body.view-workspace .app-topbar .brand-row .hero-lead {
    display: none !important;
  }

  body.view-workspace .topbar-actions {
    position: static !important;
    grid-area: actions !important;
  }

  body .app-topbar .top-nav-links {
    display: none !important;
  }

  body.is-mobile-menu-open .app-topbar .top-nav-links {
    position: fixed !important;
    z-index: 90 !important;
    top: 64px !important;
    left: 10px !important;
    right: 10px !important;
    display: grid !important;
    gap: 4px !important;
    width: auto !important;
    padding: 10px !important;
    border: 1px solid var(--workflow-line) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: var(--workflow-shadow) !important;
  }

  body.is-mobile-menu-open .app-topbar .top-nav-links a {
    min-height: 44px !important;
    padding: 0 12px !important;
    line-height: 44px !important;
  }

  .workflow-mobile-menu-button {
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border: 1px solid var(--workflow-line) !important;
    border-radius: 12px !important;
    color: var(--workflow-ink) !important;
    background: #fff !important;
  }

  body.view-workspace .app-body {
    display: block !important;
    width: 100% !important;
    padding: 0 0 92px !important;
    overflow: visible !important;
  }

  body.view-workspace .workflow-side {
    position: sticky !important;
    z-index: 50 !important;
    top: 64px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-height: 62px !important;
    max-height: none !important;
    padding: 7px 10px !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--workflow-line) !important;
    background: rgba(249, 252, 253, 0.96) !important;
    backdrop-filter: blur(16px) !important;
  }

  body.view-workspace .workflow-side .side-flow-title,
  body.view-workspace .workflow-side .side-invite,
  body.view-workspace .workflow-side .workflow-sidebar-diagnostics,
  body.view-workspace .workflow-side .side-icon,
  body.view-workspace .workflow-side .workspace-step small,
  body.view-workspace .workflow-side .workspace-step::after {
    display: none !important;
  }

  body.view-workspace .workflow-side .workspace-step {
    display: grid !important;
    grid-template-columns: 1fr !important;
    place-items: center !important;
    gap: 0 !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 7px 3px !important;
    border: 0 !important;
    border-radius: 11px !important;
    text-align: center !important;
  }

  body.view-workspace .workflow-side .workspace-step.is-active {
    color: var(--workflow-brand) !important;
    background: #fff !important;
    box-shadow: inset 0 0 0 1px #d3e1e5, 0 5px 14px rgba(16, 35, 46, 0.06) !important;
  }

  body.view-workspace .workflow-side .workspace-step.is-active::before {
    content: "";
    position: absolute;
    right: 24%;
    bottom: 4px;
    left: 24%;
    height: 2px;
    border-radius: 99px;
    background: var(--workflow-brand);
  }

  body.view-workspace .workflow-side .workspace-step b {
    margin: 0 !important;
    font-size: 13px !important;
  }

  body.view-workspace .main-content {
    display: block !important;
    width: 100% !important;
    padding: 80px 12px 28px !important;
  }

  body.view-workspace .workflow-summary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 0 12px !important;
    padding: 13px 14px !important;
    border-radius: 14px !important;
  }

  .workflow-summary-meta {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .workflow-summary-meta::-webkit-scrollbar { display: none; }

  .workflow-summary-meta span {
    flex: 0 0 auto;
  }

  body.view-workspace .layout,
  body.view-workspace #leftWorkspace,
  body.view-workspace #rightWorkspace {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.view-workspace .workflow-panel.workflow-panel-active {
    padding: 18px 14px !important;
    border: 1px solid var(--workflow-line) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(16, 35, 46, 0.06) !important;
    overflow: hidden !important;
  }

  body.view-workspace #section-core-config.workflow-panel-active {
    padding: 18px 14px !important;
    border: 1px solid var(--workflow-line) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(16, 35, 46, 0.06) !important;
  }

  body.view-workspace .workflow-panel h2 {
    font-size: 21px !important;
  }

  body.view-workspace .studio-topic-shell {
    padding: 14px !important;
    border-radius: 14px !important;
  }

  body.view-workspace .studio-topic-input {
    min-height: 190px !important;
    font-size: 16px !important;
  }

  body.view-workspace .studio-asset-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.view-workspace .studio-asset-select,
  body.view-workspace button,
  body.view-workspace select,
  body.view-workspace input:not([type="hidden"]) {
    min-height: 44px !important;
  }

  body.view-workspace .studio-asset-select {
    width: 100% !important;
    min-height: 62px !important;
    border: 1px solid var(--workflow-line) !important;
    border-radius: 12px !important;
  }

  body.view-workspace .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.view-workspace .media-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  body.view-workspace #section-preview-workbench:not(.is-result-empty) .video-box {
    width: min(100%, 360px) !important;
    max-height: 58vh !important;
  }

  .workflow-inline-nav {
    display: none !important;
  }

  .workflow-mobile-actions {
    position: fixed;
    z-index: 70;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--workflow-line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(16, 35, 46, 0.08);
    backdrop-filter: blur(16px);
  }

  .workflow-mobile-actions.is-first-step {
    grid-template-columns: minmax(0, 1fr);
  }

  body:not(.view-workspace) .workflow-mobile-actions {
    display: none !important;
  }

  body.view-workspace .workflow-mobile-actions button {
    width: 100% !important;
    max-width: none !important;
    min-height: 48px !important;
    border-radius: 12px !important;
  }

  .workflow-mobile-back {
    min-width: 76px;
    color: var(--workflow-ink);
    border: 1px solid var(--workflow-line);
    background: #fff;
  }

  .workflow-mobile-primary {
    width: 100%;
    color: #fff;
    border: 0;
    background: var(--workflow-brand);
  }

  .workflow-mobile-primary:disabled {
    color: rgba(255, 255, 255, 0.82);
    background: #9ab7c1;
  }

  #homeAdvancedModal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #homeAdvancedModal .advanced-settings-card {
    width: 100% !important;
    max-width: none !important;
    max-height: 88dvh !important;
    margin: 0 !important;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    border-radius: 22px 22px 0 0 !important;
  }

  #homeAdvancedModal .basic-settings-grid,
  #homeAdvancedModal .advanced-creative-body {
    grid-template-columns: 1fr !important;
  }

  #homeAdvancedModal .advanced-settings-actions {
    position: sticky;
    bottom: calc(-16px - env(safe-area-inset-bottom));
    margin: 16px -16px calc(-16px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--workflow-line);
    background: rgba(255, 255, 255, 0.97);
  }

  #homeAssetPickerModal .asset-picker-card {
    width: 100% !important;
    max-height: 86dvh !important;
    border-radius: 22px 22px 0 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.view-workspace *,
  body.view-workspace *::before,
  body.view-workspace *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Landing hero: concise copy with a calmer editorial rhythm. */
body.view-home .marketing-copy {
  gap: 20px !important;
}

body.view-home .marketing-copy h1 {
  max-width: 760px !important;
  color: #171310 !important;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif !important;
  font-size: clamp(52px, 4.5vw, 68px) !important;
  font-weight: 760 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.045em !important;
  text-wrap: balance !important;
}

body.view-home .marketing-copy .hero-lead {
  max-width: 560px !important;
  color: #625a52 !important;
  font-size: 17px !important;
  line-height: 1.7 !important;
  letter-spacing: 0.01em !important;
  text-wrap: pretty !important;
}

@media (max-width: 1100px) {
  body.view-home .marketing-copy h1 {
    max-width: 640px !important;
    font-size: clamp(42px, 7vw, 58px) !important;
    line-height: 1.08 !important;
  }

  body.view-home .marketing-copy .hero-lead {
    max-width: 560px !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
}

@media (max-width: 760px) {
  body.view-home .marketing-copy h1 {
    max-width: 620px !important;
    font-size: clamp(36px, 10.8vw, 52px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.04em !important;
  }

  body.view-home .marketing-copy .hero-lead {
    max-width: 460px !important;
    margin-bottom: 28px !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
}

/* Full-bleed Iridescence canvas behind the landing-page hero. */
body.view-home .hero {
  isolation: isolate !important;
  background: #f5f8f4 !important;
}

body.view-home .iridescence-bg {
  position: absolute !important;
  z-index: 0 !important;
  inset: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0.58 !important;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(135deg, #edf7f2 0%, #f7f4ee 54%, #f4ebe3 100%) !important;
}

body.view-home .iridescence-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

body.view-home .iridescence-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  filter: saturate(1.08) brightness(1);
}

body.view-home .iridescence-bg.is-fallback {
  background:
    radial-gradient(circle at 18% 16%, rgba(198, 232, 220, 0.9), transparent 40%),
    linear-gradient(135deg, #edf7f2 0%, #f7f4ee 54%, #f4ebe3 100%) !important;
}

body.view-home .marketing-home {
  position: relative !important;
  z-index: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  body.view-home .iridescence-bg {
    opacity: 0.38 !important;
  }
}

/* Keep workflow and asset icons centered after the legacy stylesheet cascade.
   Some of the original rules set the icon box dimensions but leave the inline
   SVG's baseline alignment active, which makes the glyph appear in the
   upper-left corner of the card. */
body.view-workspace .workflow-side .side-icon,
body.view-workspace .studio-asset-icon {
  display: inline-grid !important;
  place-items: center !important;
  align-content: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  line-height: 0 !important;
  text-align: center !important;
}

body.view-workspace .workflow-side .side-icon svg,
body.view-workspace .studio-asset-icon svg,
body.view-workspace .studio-asset-icon img {
  display: block !important;
  margin: 0 !important;
  transform: none !important;
}

body.view-workspace .workflow-side .side-icon svg {
  width: 20px !important;
  height: 20px !important;
}

body.view-workspace .studio-asset-icon svg {
  width: 20px !important;
  height: 20px !important;
}
