/* Final workspace layer: quiet, compact, and consistent across all six steps. */
:root {
  --studio-blue: #1769c2;
  --studio-blue-soft: #edf5ff;
  --studio-teal: #147d72;
  --studio-teal-soft: #eaf7f4;
  --studio-amber: #9a5b08;
  --studio-amber-soft: #fff6e7;
  --studio-canvas: #f4f6f8;
  --studio-line: #dbe2e8;
  --studio-line-strong: #c8d1da;
  --studio-shadow: 0 8px 24px rgb(34 53 72 / 6%);
  --studio-rail: 216px;
  --studio-gap: 28px;
  --studio-max: 1248px;
  --radius: 8px;
}

html {
  scroll-padding-top: 76px;
}

body {
  background: var(--studio-canvas);
  letter-spacing: 0;
}

.app-header {
  border-bottom-color: var(--studio-line);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 1px 8px rgb(34 53 72 / 4%);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 60px;
  max-width: 1440px;
  padding-inline: 24px;
}

.brand {
  gap: 10px;
  font-size: 17px;
}

.brand-mark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #1572d1;
  border-radius: 8px;
  background: #0878e8;
  box-shadow: 0 3px 9px rgb(0 113 227 / 16%);
}

.header-actions {
  position: relative;
}

.restart-button,
.task-history-button,
.mode-badge {
  border-color: var(--studio-line);
  background: #fff;
}

.task-history-button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  color: #344556;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.task-history-button:hover,
.task-history-button[aria-current="page"] {
  border-color: #b9d3ee;
  background: var(--studio-blue-soft);
  color: var(--studio-blue);
}

.task-history-button img {
  width: 17px;
  height: 17px;
}

.new-task-button {
  border-color: #a9cbe9;
  background: #eef7ff;
  color: #075fae;
}

.new-task-button:hover {
  border-color: #79add9;
  background: #e2f1ff;
  color: #054f91;
}

.new-task-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 22px 60px rgb(22 38 52 / 22%);
}

.new-task-dialog::backdrop {
  background: rgb(15 27 38 / 46%);
  backdrop-filter: blur(3px);
}

.new-task-dialog-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 8px;
  background: #e9f5ff;
}

.new-task-dialog-icon img {
  width: 20px;
  height: 20px;
  filter: invert(31%) sepia(74%) saturate(1288%) hue-rotate(174deg) brightness(88%);
}

.new-task-dialog h2 {
  margin: 6px 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.new-task-dialog > p:last-of-type,
.new-task-dialog-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.new-task-dialog .new-task-dialog-error {
  margin-top: 14px;
  color: #a43b32;
  font-weight: 700;
}

.new-task-dialog-actions {
  display: flex;
  margin-top: 26px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.new-task-dialog-actions button {
  min-height: 44px;
}

.new-task-discard-button {
  color: #a43b32;
}

.new-task-dialog[aria-busy="true"] .new-task-dialog-actions button {
  pointer-events: none;
  opacity: 0.58;
}

@media (max-width: 1023px) {
  .new-task-button:not([hidden]) {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .new-task-button:not([hidden]) span {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner:has(.new-task-button:not([hidden])) {
    gap: 16px;
  }

  .header-inner:has(.new-task-button:not([hidden])) .brand > span:last-child {
    display: none;
  }

  .header-actions:has(.new-task-button:not([hidden])) {
    gap: 4px;
  }

  .new-task-dialog {
    padding: 24px 20px 20px;
  }

  .new-task-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .new-task-dialog-actions button {
    width: 100%;
    padding-inline: 12px;
  }

  #newTaskSaveButton {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

.workspace,
.viewing-task .workspace {
  width: min(100%, var(--studio-max));
  max-width: var(--studio-max);
  padding: 24px 24px 96px;
}

.wizard-heading-row {
  min-height: 104px;
  margin-bottom: 16px;
  align-items: center;
}

.wizard-heading-row .page-heading,
.viewing-task .wizard-heading-row .page-heading {
  position: relative;
  display: flex;
  min-height: 104px;
  max-width: none;
  margin: 0;
  padding: 8px 164px 8px 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.studio-scene-art {
  position: absolute;
  top: 0;
  right: 4px;
  width: 146px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.page-heading .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-heading .eyebrow::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: currentColor;
  content: "";
  mask: url('/icons/sparkles.svg') center / contain no-repeat;
}

.wizard-heading-row .page-heading h1,
.viewing-task .wizard-heading-row .page-heading h1 {
  margin: 4px 0 6px;
  font-size: 36px;
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: 0;
}

.page-heading > p:last-child {
  max-width: 660px;
  color: #64707c;
  font-size: 15px;
  line-height: 1.55;
}

.status-label {
  flex-shrink: 0;
}

.step-host {
  position: relative;
  min-height: 0;
  padding: 32px 36px 12px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--studio-shadow);
}

.step-host::before,
.step-host::after {
  display: none;
}

.step-view-product {
  width: min(100%, 800px);
}

.step-view-creative {
  width: min(100%, 920px);
}

.step-view-script {
  width: min(100%, 1000px);
}

.form-section,
.viewing-task .form-section,
.review-section,
.viewing-task .review-section,
.material-subsection {
  padding-bottom: 32px;
}

.form-section + .form-section,
.review-section + .review-section {
  padding-top: 32px;
}

.section-heading,
.viewing-task .section-heading,
.review-heading {
  margin-bottom: 20px;
}

.section-heading h2,
.review-heading strong {
  font-size: 20px;
}

.section-icon,
.viewing-task .section-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border: 1px solid #d8e7f8;
  border-radius: 8px;
  background: var(--studio-blue-soft);
  box-shadow: none;
}

.section-icon img,
.material-subheading .section-icon img {
  opacity: 1;
  filter: invert(35%) sepia(92%) saturate(836%) hue-rotate(176deg) brightness(86%) contrast(91%);
}

#productFactsSection .section-icon {
  border-color: #cce6e0;
  background: var(--studio-teal-soft);
}

#creativeSettingsSection .section-icon {
  border-color: #eedfbd;
  background: var(--studio-amber-soft);
}

.review-kicker::before {
  display: inline-block;
  width: 3px;
  height: 11px;
  margin-right: 7px;
  border-radius: 2px;
  background: var(--studio-blue);
  content: "";
}

.product-upload-shell {
  width: min(100%, 620px);
  margin-inline: auto;
}

#productFactsSection .field-grid {
  width: min(100%, 760px);
  margin-inline: auto;
}

.dropzone,
.compact-dropzone,
.field input,
.field textarea,
.script-beat-editor input,
.script-beat-editor textarea,
.story-option,
.hook-option,
.advanced-settings,
.prompt-details {
  border-radius: 8px;
}

.dropzone {
  min-height: 148px;
  padding: 24px 18px;
}

.product-upload-shell:not(:has(#imageList .image-item)) #dropzone {
  border-color: #b8cfe9;
  background-color: #f7fbff;
  background-image: radial-gradient(circle, rgb(79 135 194 / 15%) 1px, transparent 1.2px);
  background-size: 16px 16px;
}

.product-upload-shell:not(:has(#imageList .image-item)) #dropzone .dropzone-icon {
  box-sizing: content-box;
  width: 26px;
  height: 26px;
  padding: 10px;
  margin-bottom: 2px;
  border: 1px solid #d6e2ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgb(53 105 171 / 8%);
  opacity: .9;
}

.compact-dropzone:not(.disabled):not(.has-selection) {
  border-color: #c7d5e3;
  background: #f9fbfd;
}

.field input,
.field textarea,
.script-beat-editor input,
.script-beat-editor textarea {
  border-color: var(--studio-line-strong);
}

.field input:hover,
.field textarea:hover,
.script-beat-editor input:hover,
.script-beat-editor textarea:hover {
  border-color: #aab6c2;
}

#storyOptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.story-option {
  min-height: 76px;
  padding: 14px 42px 14px 16px;
}

.story-option:last-child:nth-of-type(odd) {
  min-height: 64px;
  grid-column: 1 / -1;
}

.story-option:has(input:checked),
.hook-option:has(input:checked) {
  border-color: #62a3e7;
  background: var(--studio-blue-soft);
  box-shadow: 0 0 0 2px rgb(23 105 194 / 10%);
}

.duration-options,
.duration-options label,
.duration-options span {
  border-radius: 8px;
}

.advanced-settings[open] {
  box-shadow: 0 5px 18px rgb(34 53 72 / 6%);
}

.advanced-settings .spec-list span {
  border-radius: 6px;
}

.primary-button,
.secondary-button,
.text-action,
.restart-button {
  min-height: 46px;
  border-radius: 8px;
}

.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active {
  transform: translateY(1px);
}

.scene-review,
.step-review-aside,
.step-view-keyframes #keyframeReview > .compact-field {
  border-radius: 8px;
}

.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection {
  margin-bottom: 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--studio-line);
}

.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .scene-upload-grid,
.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .scene-image-list,
.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .placement-image-list,
.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .scene-requirements-field,
.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection > .field-error {
  display: none;
}

.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .material-subheading {
  margin: 0;
}

.step-view-scene:has(#sceneReview:not([hidden])) #sceneMaterialSection .material-subheading::after {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--studio-teal-soft);
  color: var(--studio-teal);
  content: "素材已提交";
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.scene-review {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.scene-asset-comparison {
  grid-template-columns: minmax(0, 720px);
  margin-top: 24px;
  padding-top: 24px;
}

.scene-board-block {
  width: min(100%, 720px);
}

.scene-source-block {
  width: min(100%, 720px);
  margin-top: 0;
  justify-self: center;
}

.scene-source-preview-list {
  display: grid;
  margin-top: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.scene-source-preview-list:has(> :only-child) {
  grid-template-columns: minmax(0, 360px);
  justify-content: center;
}

.scene-source-preview-list .scene-source-preview-item {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--surface);
}

.scene-source-preview-list .image-preview-button,
.scene-source-preview-list .image-preview-button > img {
  border-radius: 8px;
}

.scene-source-preview-list .image-preview-button {
  position: relative;
}

.scene-source-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 4px 14px rgb(15 23 42 / 18%);
  place-items: center;
  pointer-events: none;
}

.scene-source-zoom img {
  width: 17px;
  height: 17px;
}

.scene-board-block .review-image-preview,
.scene-board-block .review-image-preview > img {
  border-radius: 8px;
}

#sceneConfirmationControls {
  width: min(100%, 720px);
}

.script-beat-editor {
  padding: 24px;
  border-radius: 8px;
  background: #fafbfc;
}

.script-timeline,
.script-timeline button,
.script-timeline button.current {
  border-radius: 8px;
}

.keyframe-focus {
  min-height: 420px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgb(17 23 20 / 12%);
}

.keyframe-focus > .image-preview-button {
  height: clamp(420px, 54dvh, 580px);
}

.keyframe-filmstrip .keyframe-item {
  border-radius: 8px;
}

.step-view-keyframes #keyframeReview {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px 28px;
}

.step-review-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
}

.video-main-visual .video-stage,
.viewing-task .video-main-visual .video-stage {
  width: min(100%, 360px);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 14%);
}

.video-stage {
  border-radius: 8px;
}

.step-review-aside {
  position: sticky;
  top: 76px;
  padding: 22px;
  background: #fafbfc;
}

.wizard-action-bar {
  border-top-color: var(--studio-line);
  background: rgb(255 255 255 / 95%);
  box-shadow: 0 -6px 20px rgb(34 53 72 / 6%);
}

.wizard-action-inner {
  min-height: 72px;
  width: min(100%, var(--studio-max));
  padding: 10px 24px;
}

.draft-save-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 1024px) {
  .wizard-action-inner:has(.draft-save-group) {
    grid-template-columns: var(--studio-rail) minmax(0, 1fr) auto auto;
  }

  .wizard-action-inner:has(.draft-save-group) #wizardBackButton {
    grid-column: 2;
  }

  .wizard-action-inner:has(.draft-save-group) .draft-save-group {
    grid-column: 3;
  }

  .wizard-action-inner:has(.draft-save-group) #wizardPrimaryButton {
    grid-column: 4;
  }
}

.draft-save-status {
  max-width: 180px;
  color: #6a7886;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.draft-save-status[data-state="saving"] {
  color: var(--studio-blue);
}

.draft-save-status[data-state="saved"] {
  color: var(--studio-teal);
}

.draft-save-status[data-state="error"] {
  color: #a33b32;
}

.toast {
  box-sizing: border-box;
  min-height: 44px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px 11px 40px;
  border: 1px solid #cbdced;
  border-radius: 8px;
  background: #fff;
  color: #253342;
  box-shadow: 0 10px 28px rgb(34 53 72 / 15%);
}

.toast::before {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--studio-blue);
  box-shadow: 0 0 0 4px var(--studio-blue-soft);
  content: "";
  transform: translateY(-50%);
}

.toast[data-tone="success"] {
  border-color: #bcded6;
}

.toast[data-tone="success"]::before {
  background: var(--studio-teal);
  box-shadow: 0 0 0 4px var(--studio-teal-soft);
}

.toast[data-tone="warning"] {
  border-color: #ecd7aa;
}

.toast[data-tone="warning"]::before {
  background: var(--studio-amber);
  box-shadow: 0 0 0 4px var(--studio-amber-soft);
}

.generation-dialog {
  border-radius: 8px;
}

.task-history-page[hidden],
.workspace[hidden],
.wizard-action-bar[hidden] {
  display: none !important;
}

.task-history-page {
  width: 100%;
  padding: 30px 24px 72px;
}

.task-history-inner {
  width: min(100%, var(--studio-max));
  margin-inline: auto;
}

.history-back-button {
  display: inline-flex;
  min-height: 44px;
  margin-bottom: 18px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  color: #526476;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.history-back-button:hover {
  color: var(--studio-blue);
}

.history-back-button img {
  width: 18px;
  height: 18px;
}

.task-history-heading {
  display: flex;
  padding: 4px 0 28px;
  border-bottom: 1px solid var(--studio-line);
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.task-history-heading .eyebrow {
  margin: 0 0 6px;
  color: var(--studio-blue);
  font-size: 12px;
  font-weight: 700;
}

.task-history-heading h1 {
  margin: 0 0 8px;
  color: #1f2c39;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

.task-history-heading p:last-child {
  max-width: 680px;
  margin: 0;
  color: #657382;
  font-size: 15px;
  line-height: 1.6;
}

.task-history-count {
  display: flex;
  min-width: 150px;
  padding: 12px 0;
  border-left: 1px solid var(--studio-line);
  flex-direction: column;
  align-items: flex-end;
}

.task-history-count strong {
  color: #1f2c39;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.task-history-count span {
  margin-top: 6px;
  color: #71808f;
  font-size: 13px;
}

.task-draft-section {
  padding: 28px 0 4px;
  border-bottom: 1px solid var(--studio-line);
}

.task-draft-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.task-draft-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--studio-amber);
  font-size: 12px;
  font-weight: 700;
}

.task-draft-heading h2 {
  margin: 0;
  color: #243341;
  font-size: 22px;
  letter-spacing: 0;
}

.task-draft-heading p:last-child {
  margin: 6px 0 0;
  color: #687786;
  font-size: 14px;
}

.task-draft-count {
  flex: none;
  color: #687786;
  font-size: 13px;
}

.task-draft-list {
  margin-top: 16px;
}

.task-draft-item {
  display: grid;
  min-height: 92px;
  padding: 14px 0;
  border-top: 1px solid #edf0f3;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.task-draft-thumb {
  display: grid;
  width: 72px;
  height: 64px;
  overflow: hidden;
  border: 1px solid #dfe5ea;
  border-radius: 7px;
  background: #f6f8fa;
  place-items: center;
}

.task-draft-thumb img {
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}

.task-draft-thumb.is-placeholder img {
  width: 25px;
  height: 25px;
  padding: 0;
  opacity: .48;
}

.task-draft-copy {
  min-width: 0;
}

.task-draft-copy strong {
  display: block;
  overflow: hidden;
  color: #263542;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-draft-copy p {
  margin: 5px 0 0;
  color: #73808d;
  font-size: 12px;
}

.task-draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-draft-actions .secondary-button {
  min-height: 44px;
  text-decoration: none;
}

.task-draft-delete {
  display: inline-grid;
  width: 44px;
  height: 44px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  background: #fff;
  place-items: center;
  cursor: pointer;
}

.task-draft-delete:hover {
  border-color: #e3b7b2;
  background: #fff7f6;
}

.task-draft-delete img {
  width: 17px;
  height: 17px;
}

.task-history-search {
  width: min(100%, 620px);
  margin: 28px 0 24px;
}

.task-history-search > label {
  display: block;
  margin-bottom: 8px;
  color: #344556;
  font-size: 14px;
  font-weight: 650;
}

.task-history-search-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.task-history-search-control > img {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  opacity: .58;
  transform: translateY(-50%);
  pointer-events: none;
}

.task-history-search-control input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 8px;
  background: #fff;
  color: #1f2c39;
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.task-history-search-control input:focus {
  border-color: #5f9fe2;
  box-shadow: 0 0 0 3px rgb(23 105 194 / 12%);
}

.task-history-status {
  min-height: 180px;
  padding: 64px 24px;
  color: #71808f;
  text-align: center;
}

.task-history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.task-history-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(34 53 72 / 5%);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.task-history-card:hover {
  border-color: #b9d3ee;
  box-shadow: 0 10px 26px rgb(34 53 72 / 10%);
  transform: translateY(-2px);
}

.task-history-card > a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.task-history-card > a:focus-visible {
  outline: 3px solid rgb(23 105 194 / 24%);
  outline-offset: -3px;
}

.task-history-card-media {
  display: grid;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid #e7ebef;
  background: #f6f8fa;
  place-items: center;
}

.task-history-card-media > img {
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
}

.task-history-card-media > span {
  display: grid;
  width: 54px;
  height: 54px;
  border: 1px solid #dce3e9;
  border-radius: 8px;
  background: #fff;
  place-items: center;
}

.task-history-card-media > span img {
  width: 24px;
  height: 24px;
  opacity: .46;
}

.task-history-card-content {
  padding: 16px;
}

.task-history-status-badge {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #eaf6f1;
  color: #23765b;
  font-size: 11px;
  font-weight: 750;
}

.task-history-status-badge[data-status="failed"] {
  background: #fff0ee;
  color: #a33b32;
}

.task-history-status-badge[data-status="cancelled"] {
  background: #f0f2f4;
  color: #66727e;
}

.task-history-card-content h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #223140;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
}

.task-history-card-content > p {
  display: -webkit-box;
  min-height: 44px;
  margin: 7px 0 15px;
  overflow: hidden;
  color: #5f6e7d;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-history-card-meta {
  display: flex;
  padding-top: 12px;
  border-top: 1px solid #edf0f3;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #7a8794;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.task-history-card-meta span {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--studio-blue-soft);
  color: var(--studio-blue);
  font-weight: 700;
}

.task-history-card-content > small {
  display: block;
  margin-top: 10px;
  color: var(--studio-amber);
  font-size: 12px;
}

.task-history-empty {
  display: grid;
  min-height: 280px;
  padding: 48px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.task-history-empty > span {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #fff;
  place-items: center;
}

.task-history-empty img {
  width: 25px;
  height: 25px;
  opacity: .5;
}

.task-history-empty strong {
  color: #2c3a48;
  font-size: 17px;
}

.task-history-empty p {
  margin: 7px 0 0;
  color: #71808f;
  font-size: 14px;
}

.task-history-pagination {
  display: flex;
  margin-top: 28px;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.task-history-pagination > span {
  min-width: 96px;
  color: #526476;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.task-history-pagination button {
  min-width: 112px;
}

.result-actions #viewTaskButton {
  text-decoration: none;
}

.task-readonly input[aria-readonly="true"],
.task-readonly textarea[aria-readonly="true"] {
  cursor: text;
}

@media (min-width: 1024px) {
  .editor,
  .viewing-task .editor {
    grid-template-columns: var(--studio-rail) minmax(0, 1fr);
    grid-template-rows: auto 0 0 auto 0;
    column-gap: var(--studio-gap);
    align-content: start;
  }

  .workflow-steps,
  .viewing-task .workflow-steps {
    top: 76px;
    padding: 12px 10px 14px;
    border-color: var(--studio-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 16px rgb(34 53 72 / 5%);
  }

  .workflow-steps::before {
    padding: 3px 10px 10px;
    color: #526476;
    letter-spacing: 0;
  }

  .editor .workflow-steps button {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    border-radius: 7px;
  }

  .editor .workflow-steps button:hover:not(:disabled) {
    background: #f5f7f9;
  }

  .editor .workflow-steps li.current button {
    border-color: #d2e3f5;
    background: var(--studio-blue-soft);
  }

  .editor .workflow-steps li.current span {
    border-color: var(--studio-blue);
    background: var(--studio-blue);
    box-shadow: none;
  }

  .editor .workflow-steps li.current strong {
    color: var(--studio-blue);
  }

  .step-nav-icon {
    width: 18px;
    height: 18px;
    opacity: .48;
  }

  .editor .workflow-steps li.current .step-nav-icon {
    opacity: 1;
    filter: invert(35%) sepia(92%) saturate(836%) hue-rotate(176deg) brightness(86%) contrast(91%);
  }

  .wizard-action-inner {
    grid-template-columns: var(--studio-rail) minmax(0, 1fr) auto;
    column-gap: var(--studio-gap);
  }

  .script-beats-editor,
  .viewing-task .script-beats-editor {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px 24px;
    align-items: start;
  }

  .script-timeline {
    position: sticky;
    top: 76px;
    display: flex;
    margin: 0;
    padding: 6px;
    grid-column: 1;
    grid-row: 1 / span 2;
    flex-direction: column;
    gap: 4px;
  }

  .script-timeline button {
    display: grid;
    min-height: 58px;
    padding: 9px 10px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    text-align: left;
  }

  .script-timeline button.current {
    border-color: #cfe0f2;
    color: var(--studio-blue);
    box-shadow: 0 2px 8px rgb(34 53 72 / 6%);
  }

  .script-timeline span,
  .script-timeline strong {
    margin: 0;
    font-size: 12px;
  }

  .script-beat-editor {
    grid-column: 2;
    grid-row: 1;
  }

  .script-node-pager {
    margin: 0;
    grid-column: 2;
    grid-row: 2;
  }

  .header-actions:has(.task-summary-drawer:not([hidden])) {
    padding-right: 128px;
  }

  .task-summary-drawer {
    position: absolute;
    z-index: 60;
    top: 50%;
    right: 0;
    bottom: auto;
    width: 118px;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--studio-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    transform: translateY(-50%);
  }

  .task-summary-drawer:not([open]) {
    width: 118px;
  }

  .task-summary-drawer[open] {
    top: calc(100% + 8px);
    width: 360px;
    max-height: calc(100dvh - 148px);
    overflow: auto;
    box-shadow: 0 16px 40px rgb(34 53 72 / 16%);
    transform: none;
  }

  .task-summary-drawer > summary {
    min-height: 42px;
    padding: 8px 12px;
  }
}

@media (max-width: 1200px) and (min-width: 1024px) {
  .wizard-heading-row .page-heading,
  .viewing-task .wizard-heading-row .page-heading {
    padding-right: 126px;
  }

  .studio-scene-art {
    top: 8px;
    width: 118px;
  }

  .step-host {
    padding-inline: 28px;
  }

  .task-history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .workspace,
  .viewing-task .workspace {
    padding: 22px 20px 96px;
  }

  .wizard-heading-row {
    min-height: 0;
    margin-bottom: 16px;
  }

  .wizard-heading-row .page-heading,
  .viewing-task .wizard-heading-row .page-heading {
    min-height: 94px;
    padding-right: 142px;
  }

  .studio-scene-art {
    top: 0;
    width: 126px;
  }

  .mobile-progress {
    margin-bottom: 16px;
    padding: 13px 14px 14px;
    border: 1px solid var(--studio-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(34 53 72 / 5%);
  }

  .step-host {
    padding: 28px 24px 8px;
  }

  .step-view-scene,
  .step-view-scene:not(:has(.scene-review:not([hidden]))),
  .step-view-keyframes #keyframeReview,
  .step-review-layout {
    display: block;
    width: 100%;
  }

  .scene-review,
  .step-review-aside,
  .step-view-keyframes #keyframeReview > .story-review-warning,
  .step-view-keyframes #keyframeReview > .compact-field,
  .step-view-keyframes #keyframeReview > .review-actions {
    margin-top: 24px;
  }

  .step-review-aside {
    position: static;
  }

  .header-actions:has(.task-summary-drawer:not([hidden])) {
    padding-right: 0;
  }

  .task-summary-drawer {
    position: fixed;
    z-index: 45;
    top: auto;
    right: 16px;
    bottom: 80px;
    width: min(360px, calc(100vw - 32px));
    max-height: min(620px, calc(100dvh - 152px));
    overflow: auto;
    border: 1px solid var(--studio-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgb(34 53 72 / 14%);
    transform: none;
  }

  .task-summary-drawer:not([open]) {
    width: 148px;
    box-shadow: 0 5px 18px rgb(34 53 72 / 9%);
  }

  .task-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body {
    padding-bottom: 82px;
  }

  .header-inner {
    min-height: 58px;
    padding-inline: 16px;
  }

  .brand {
    font-size: 16px;
  }

  .workspace,
  .viewing-task .workspace {
    padding: 16px 12px 88px;
  }

  .wizard-heading-row {
    margin-bottom: 14px;
    padding-inline: 4px;
  }

  .wizard-heading-row .page-heading,
  .viewing-task .wizard-heading-row .page-heading {
    min-height: 116px;
    padding: 2px 78px 2px 0;
  }

  .wizard-heading-row .page-heading h1,
  .viewing-task .wizard-heading-row .page-heading h1 {
    padding: 0;
    font-size: 29px;
  }

  .page-heading .eyebrow {
    min-height: 20px;
    padding: 0;
    font-size: 11px;
  }

  .page-heading > p:last-child {
    font-size: 14px;
    line-height: 1.5;
  }

  .studio-scene-art {
    top: 0;
    right: -2px;
    width: 76px;
    opacity: .88;
  }

  .wizard-heading-row > .status-label {
    margin-top: 8px;
  }

  .mobile-progress {
    margin-bottom: 14px;
  }

  .step-host {
    padding: 22px 16px 4px;
    border-radius: 8px;
  }

  .form-section,
  .viewing-task .form-section,
  .review-section,
  .viewing-task .review-section,
  .material-subsection {
    padding-bottom: 26px;
  }

  .form-section + .form-section,
  .review-section + .review-section {
    padding-top: 26px;
  }

  #storyOptions {
    grid-template-columns: 1fr;
  }

  .story-option:last-child:nth-of-type(odd) {
    grid-column: auto;
  }

  .script-beats-editor,
  .viewing-task .script-beats-editor {
    display: block;
  }

  .script-timeline {
    display: flex;
    overflow-x: auto;
    margin-bottom: 16px;
    scroll-snap-type: x proximity;
  }

  .script-timeline button {
    min-width: 124px;
    scroll-snap-align: start;
  }

  .script-beat-editor {
    padding: 18px 14px;
  }

  .keyframe-focus,
  .keyframe-focus.is-empty {
    min-height: 340px;
  }

  .keyframe-focus > .image-preview-button {
    height: min(52dvh, 460px);
  }

  .video-main-visual .video-stage,
  .viewing-task .video-main-visual .video-stage {
    width: min(100%, 340px);
  }

  .wizard-action-inner {
    min-height: 68px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  }

  .wizard-action-inner #wizardBackButton {
    width: 48px;
    min-width: 48px;
  }

  .draft-save-group {
    min-width: 0;
    flex: 1 1 0;
  }

  .draft-save-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .draft-save-group #saveDraftButton,
  .wizard-action-inner #wizardPrimaryButton {
    min-width: 0;
    width: 100%;
    padding-inline: 10px;
  }

  .wizard-action-inner #wizardPrimaryButton {
    flex: 1 1 0;
  }

  .task-summary-drawer {
    right: 12px;
    bottom: 76px;
  }

  .task-summary-drawer[open] {
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 148px);
  }

  .task-summary-drawer:not([open]) {
    width: 144px;
  }

  .toast {
    right: auto;
    bottom: 132px;
    left: 50%;
    width: calc(100vw - 32px);
    transform: translateX(-50%);
  }

  .task-history-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
    justify-content: center;
  }

  .task-history-button span {
    display: none;
  }

  .task-history-page {
    padding: 20px 16px 48px;
  }

  .history-back-button {
    margin: 0 0 12px -8px;
  }

  .task-history-heading {
    padding-bottom: 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .task-history-heading h1 {
    font-size: 29px;
  }

  .task-history-count {
    min-width: 0;
    width: 100%;
    padding: 12px 0 0;
    border-top: 1px solid var(--studio-line);
    border-left: 0;
    align-items: flex-start;
  }

  .task-history-count strong {
    font-size: 24px;
  }

  .task-history-search {
    margin-top: 22px;
  }

  .task-draft-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .task-draft-item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .task-draft-thumb {
    width: 56px;
    height: 56px;
  }

  .task-draft-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .task-history-search-control {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .task-history-grid {
    grid-template-columns: 1fr;
  }

  .task-history-card-media {
    aspect-ratio: 16 / 10;
  }

  .task-history-pagination {
    gap: 8px;
  }

  .task-history-pagination button {
    min-width: 44px;
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-history-card,
  .task-history-button,
  .task-history-search-control input {
    transition: none;
  }

  .task-history-card:hover {
    transform: none;
  }
}
