:root {
  --canvas: #f7f7fa;
  --surface: #ffffff;
  --surface-soft: #f1f2f5;
  --surface-tint: #fafafd;
  --ink: #1d1d22;
  --ink-soft: #4d4d58;
  --muted: #81818d;
  --line: #e3e4ea;
  --line-strong: #d1d3db;
  --lime: #d8f75a;
  --lime-strong: #b9da3d;
  --lime-ink: #25310e;
  --green: #138a58;
  --blue: #2f6cf2;
  --amber: #ad7419;
  --danger: #c6424d;
  --shadow: 0 18px 44px rgba(31, 32, 43, 0.08);
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
}

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

button,
summary {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

::selection {
  color: var(--ink);
  background: rgba(200, 233, 75, 0.42);
}

.studio-shell {
  width: min(100% - 40px, 1540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar,
.topbar-actions,
.view-switcher,
.compose-heading,
.compose-heading-actions,
.cloud-status,
.cloud-actions,
.section-caption,
.reference-summary,
.prompt-reference-summary,
.prompt-reference,
.prompt-heading,
.options-row,
.rail-heading,
.job-head,
.job-progress-detail,
.job-media-actions,
.library-heading,
.library-actions,
.library-summary,
.library-toolbar,
.preview-dialog-head {
  display: flex;
  align-items: center;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  justify-content: space-between;
  min-height: 62px;
  gap: 20px;
  padding: 9px 11px 9px 14px;
  border: 1px solid rgba(227, 228, 234, 0.88);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 7px 24px rgba(31, 32, 43, 0.05);
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.auth-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #1d1d22;
  border-radius: 10px;
  color: #ffffff;
  background: #1d1d22;
  font-weight: 850;
}

.brand-mark {
  width: 35px;
  height: 35px;
  font-size: 15px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.35;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 29px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
}

.topbar-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.view-switcher,
.media-mode-row,
.mode-row,
.library-toolbar {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.view-tab,
.library-filter {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 730;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.view-tab[aria-pressed="true"],
.library-filter[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(39, 48, 28, 0.12);
}

.status-chip,
.preset-label,
.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 730;
  white-space: nowrap;
}

.status-chip {
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-soft);
}

.status-chip[data-state="ready"] {
  color: #176d49;
  background: #e3f6ea;
}

.status-chip[data-state="error"] {
  color: #a42f3b;
  background: #fce7e8;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-soft);
}

.auth-layout {
  display: grid;
  min-height: calc(100vh - 154px);
  place-items: center;
  padding: 44px 0;
}

.auth-form {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  font-size: 17px;
}

.auth-form .eyebrow {
  margin-bottom: 8px;
}

.auth-intro {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 730;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: #aecd38;
  box-shadow: 0 0 0 3px rgba(200, 233, 75, 0.3);
}

input {
  height: 42px;
  padding: 0 12px;
}

select {
  height: 42px;
  padding: 0 33px 0 11px;
}

textarea {
  min-height: 184px;
  padding: 13px 14px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.65;
}

::placeholder {
  color: #9aa096;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.remember-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--lime-strong);
}

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.download-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button {
  width: 100%;
  gap: 9px;
  border: 1px solid #b3d33b;
  color: var(--lime-ink);
  background: var(--lime);
}

.primary-button:hover:not(:disabled) {
  border-color: #9abb25;
  background: #d9f36a;
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button small {
  color: rgba(38, 49, 17, 0.7);
  font-size: 10px;
  font-weight: 700;
}

.auth-form .primary-button {
  margin-top: 8px;
}

.secondary-button,
.download-button {
  border: 1px solid var(--line);
  padding: 0 13px;
  color: var(--ink-soft);
  background: var(--surface);
}

.secondary-button:hover:not(:disabled),
.download-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-soft);
}

.console-layout {
  display: grid;
  grid-template-columns: minmax(660px, 1.55fr) minmax(310px, 0.66fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.compose-panel,
.jobs-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(42, 52, 31, 0.035);
}

.compose-panel {
  padding: 24px;
}

.jobs-panel {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.compose-heading,
.rail-heading,
.library-heading {
  justify-content: space-between;
  gap: 18px;
}

.compose-heading {
  margin-bottom: 20px;
}

.compose-heading .eyebrow,
.rail-heading .eyebrow {
  margin-bottom: 5px;
}

.compose-heading-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.media-mode-row {
  display: inline-flex;
}

.mode-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 12px;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.mode-seg .mode-option input:checked + span {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(39, 48, 28, 0.13);
}

.preset-label {
  padding: 0 10px;
  color: #5c741b;
  background: #edf7cd;
}

.startup-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid #dbe3c8;
  border-radius: 8px;
  background: #f8fbef;
}

.cloud-status {
  min-width: 0;
  gap: 11px;
}

.cloud-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #abb3a8;
}

.cloud-status-dot[data-state="ready"] {
  background: #23a66b;
  box-shadow: 0 0 0 3px rgba(35, 166, 107, 0.14);
}

.cloud-status-dot[data-state="checking"] {
  background: #d59628;
  box-shadow: 0 0 0 3px rgba(213, 150, 40, 0.14);
  animation: cloud-pulse 1.2s ease-in-out infinite;
}

.cloud-status-dot[data-state="failed"] {
  background: #d34b58;
  box-shadow: 0 0 0 3px rgba(211, 75, 88, 0.12);
}

@keyframes cloud-pulse {
  50% {
    opacity: 0.45;
  }
}

.cloud-status-text {
  min-width: 0;
}

.cloud-title,
.cloud-subtle,
.cloud-host-status {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-title {
  font-size: 12px;
  font-weight: 760;
}

.cloud-subtle,
.cloud-host-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.cloud-host-status:empty {
  display: none;
}

.cloud-actions {
  flex: 0 0 auto;
  gap: 7px;
}

.cloud-actions select,
.cloud-actions button {
  width: auto;
  height: 34px;
  min-height: 34px;
}

.cloud-actions select {
  max-width: 185px;
  padding-left: 9px;
  font-size: 12px;
}

.ghost-btn,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.ghost-btn:hover:not(:disabled),
.icon-text-button:hover:not(:disabled) {
  border-color: #aeb7a6;
  color: var(--ink);
  background: #f4f6ef;
}

.ghost-primary {
  border-color: #b7d554;
  color: #536e10;
  background: #f6fbdc;
}

.ghost-primary:hover:not(:disabled) {
  border-color: #a7c533;
  background: #ecf6bd;
}

.danger-button {
  color: #a33b43;
}

.form-section {
  margin: 0;
}

.section-caption {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
}

.estimate-note {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.72fr) repeat(4, minmax(100px, 0.78fr));
  gap: 10px;
  margin-bottom: 23px;
}

.config-grid[data-media-type="image"] {
  grid-template-columns: minmax(260px, 1.6fr) minmax(230px, 0.8fr);
}

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

.config-field label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.config-field select {
  height: 40px;
  font-size: 12px;
}

.workflow-field .field-hint {
  min-height: 15px;
  margin: 5px 1px 0;
}

.image-size-field {
  display: grid;
  grid-template-columns: minmax(94px, 0.76fr) minmax(0, 1fr) minmax(70px, 0.52fr) minmax(0, 0.78fr);
  align-items: end;
  gap: 7px;
}

.image-size-field label,
.image-size-field .field-sublabel {
  margin: 0 0 11px;
}

.prompt-section {
  border-top: 1px solid var(--line);
}

.reference-summary,
.prompt-reference-summary,
.shot-splitter-summary {
  min-height: 68px;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}

.reference-summary::-webkit-details-marker,
.prompt-reference-summary::-webkit-details-marker,
.shot-splitter-summary::-webkit-details-marker {
  display: none;
}

.reference-summary strong,
.prompt-reference-summary strong,
.shot-splitter-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.details-toggle-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.details-toggle-label::after {
  display: inline-block;
  width: 13px;
  margin-left: 4px;
  color: #668315;
  content: "+";
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

details[open] > summary .details-toggle-label {
  font-size: 0;
}

details[open] > summary .details-toggle-label::after {
  content: "−";
  font-size: 16px;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.reference-workspace > .field-hint {
  margin-top: 0;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 9px;
  margin: 14px 0 18px;
}

.reference-card,
.reference-add-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-tint);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.reference-card:hover,
.reference-card:focus-within,
.reference-add-card:hover {
  border-color: #aecb38;
  transform: translateY(-1px);
}

.reference-picture-button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}

.reference-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-card .reference-picture-button span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  border-radius: 4px;
  padding: 3px 5px;
  color: #fff;
  background: rgba(25, 31, 22, 0.7);
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-remove-button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: rgba(34, 38, 31, 0.8);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
}

.reference-card:hover .reference-remove-button,
.reference-card:focus-within .reference-remove-button {
  opacity: 1;
}

.reference-remove-button:hover,
.reference-remove-button:focus-visible {
  background: var(--danger);
  opacity: 1;
}

.reference-add-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-style: dashed;
  color: var(--muted);
}

.reference-add-card:hover {
  color: #547212;
  background: #f5fadf;
}

.reference-add-card span {
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.reference-add-card small {
  font-size: 10px;
  font-weight: 700;
}

.prompt-section {
  padding-top: 18px;
}

.prompt-workspace {
  display: block;
}

.prompt-editor {
  min-width: 0;
}

.prompt-editor .reference-workspace {
  min-width: 0;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: clip;
  background: #fcfdf9;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.prompt-editor .reference-workspace[open] {
  border-color: #d3dfaa;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(90, 117, 19, 0.07);
}

.prompt-editor .reference-summary {
  min-height: 57px;
  padding: 0 13px;
  cursor: pointer;
}

.reference-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.reference-summary-status {
  color: #718313;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.reference-body {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 220ms ease, opacity 180ms ease;
}

.reference-body-content {
  min-height: 1px;
}

.reference-workspace[open][data-expanded="true"] > .reference-body {
  height: var(--reference-body-height, 220px);
  opacity: 1;
}

.reference-workspace[data-closing="true"] > summary .details-toggle-label {
  font-size: 11px;
}

.reference-workspace[data-closing="true"] > summary .details-toggle-label::after {
  content: "+";
  font-size: 15px;
}

.reference-workspace .reference-body-content > .field-hint {
  margin: 0;
  padding: 0 13px;
}

.reference-workspace .reference-body-content > .reference-grid {
  margin: 14px 13px 14px;
}

.image-prompt-templates {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-tint);
}

.image-template-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-template-heading .eyebrow {
  margin-bottom: 3px;
}

.image-template-heading strong {
  display: block;
  font-size: 13px;
}

.image-template-heading .ghost-btn {
  height: 34px;
  flex: 0 0 auto;
}

.image-template-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 11px 0 10px;
}

.image-template-tab {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 730;
  white-space: nowrap;
}

.image-template-tab[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(39, 48, 28, 0.13);
}

.image-template-preview {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid #e0e5d7;
  border-radius: 7px;
  padding: 10px;
  color: var(--ink-soft);
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mode-row {
  display: inline-flex;
  margin-bottom: 16px;
}

.mode-row .mode-option span {
  min-height: 28px;
  padding: 0 11px;
}

.mode-row .mode-option input:checked + span {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(39, 48, 28, 0.13);
}

.shot-splitter {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.shot-splitter-summary {
  min-height: 57px;
  padding: 0 13px;
}

.shot-splitter-body {
  padding: 0 13px 13px;
}

.shot-splitter-body > label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

#shot-brief {
  min-height: 92px;
  resize: vertical;
}

.shot-splitter-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.shot-template-options {
  width: 100%;
  margin: 0;
}

.shot-template-options .mode-option {
  flex: 1 1 0;
}

.shot-template-options .mode-option span {
  width: 100%;
  padding: 0 8px;
  text-align: center;
}

.shot-count-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.shot-count-field select {
  height: 34px;
  min-width: 0;
  font-size: 12px;
}

.shot-duration-note {
  min-width: 100px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.shot-splitter-controls .ghost-btn {
  height: 34px;
  padding: 0 12px;
}

.shot-split-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.shot-preview-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #e0e5d7;
  border-radius: 7px;
  padding: 8px;
  background: #fff;
}

.shot-preview-item strong {
  color: var(--ink);
  font-size: 11px;
}

.shot-preview-item span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.prompt-reference-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.prompt-reference-summary {
  min-height: 57px;
  padding: 0 13px;
}

.prompt-reference-panel > .field-hint {
  margin: -2px 13px 10px;
}

.prompt-reference {
  justify-content: space-between;
  gap: 12px;
  margin: 0 13px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.prompt-reference select {
  width: min(260px, 56%);
  height: 34px;
  font-size: 11px;
}

.prompt-reference-preview {
  max-height: 150px;
  margin: 0 13px 13px;
  overflow: auto;
  border: 1px solid #e0e5d7;
  border-radius: 8px;
  padding: 10px;
  color: #4b5249;
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.prompt-heading label {
  margin: 0;
}

.h3-check-panel {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.h3-check-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.h3-check-heading .eyebrow {
  display: block;
  margin-bottom: 3px;
}

.h3-check-heading strong {
  font-size: 13px;
}

.h3-check-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef0ec;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.h3-check-status[data-state="pass"] {
  background: #e4f3d9;
  color: #2f6b2a;
}

.h3-check-status[data-state="warning"] {
  background: #fff0cf;
  color: #876113;
}

.h3-check-status[data-state="error"] {
  background: #fde4e1;
  color: var(--danger);
}

.h3-check-panel .field-hint {
  margin-top: 5px;
}

.h3-check-list {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  line-height: 1.45;
}

.h3-check-list li {
  padding-left: 12px;
  position: relative;
}

.h3-check-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
}

.h3-check-list li[data-level="error"] {
  color: var(--danger);
}

.h3-check-list li[data-level="warning"] {
  color: #876113;
}

.prompt-side-note {
  color: var(--muted);
  font-size: 11px;
}

#prompt {
  min-height: 198px;
}

#negative-prompt-field {
  margin-top: 14px;
}

#negative-prompt {
  min-height: 100px;
}

.options-row {
  justify-content: space-between;
  gap: 18px;
  margin: 19px 0 15px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

#seed-field {
  width: 178px;
}

.queue-note {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.queue-note span,
.queue-note strong,
.queue-note small {
  display: block;
}

.queue-note strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
}

.queue-note small {
  max-width: 290px;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.45;
}

.rail-heading {
  justify-content: space-between;
  gap: 12px;
}

.rail-heading h2 {
  font-size: 18px;
}

.queue-overview {
  display: grid;
  gap: 5px;
  margin-top: 17px;
  padding: 13px;
  border: 1px solid #dbe4ce;
  border-radius: 8px;
  background: #f8fbef;
}

.queue-overview-title {
  color: #778467;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}

.queue-overview strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.queue-overview span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jobs-list {
  max-height: calc(100vh - 286px);
  margin-top: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.empty-state {
  margin: 52px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.job-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.job-item:first-child {
  padding-top: 0;
}

.job-item:last-child {
  border-bottom: 0;
}

.job-head,
.job-progress-detail {
  justify-content: space-between;
  gap: 12px;
}

.job-time,
.job-meta {
  color: var(--muted);
  font-size: 11px;
}

.job-status {
  min-height: 24px;
  padding: 0 8px;
  color: #58615d;
  background: var(--surface-soft);
}

.job-status[data-status="success"] {
  color: #177047;
  background: #e1f5e9;
}

.job-status[data-status="failed"],
.job-status[data-status="interrupted"] {
  color: #a0323e;
  background: #fce7e8;
}

.job-status[data-status="generating"],
.job-status[data-status="preparing"],
.job-status[data-status="submitting"] {
  color: #8a5b11;
  background: #fff1d8;
}

.job-prompt {
  display: -webkit-box;
  margin: 10px 0 7px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.job-progress {
  margin-top: 11px;
}

.job-progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e7de;
}

.job-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: #a9ce2d;
  transition: width 700ms ease;
}

.job-progress-track[data-indeterminate] .job-progress-fill {
  width: 36%;
  animation: job-progress-indeterminate 1.15s ease-in-out infinite;
}

@keyframes job-progress-indeterminate {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(320%);
  }
}

.job-progress-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.job-progress-elapsed {
  min-height: 17px;
  margin-top: 3px;
  color: #6a7562;
  font-size: 11px;
  line-height: 1.45;
}

.job-error {
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.job-media {
  margin-top: 13px;
}

.job-media video,
.job-media img {
  display: block;
  width: min(100%, 280px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf0e8;
}

.job-media video {
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.job-media img {
  height: auto;
  cursor: zoom-in;
}

.job-media-actions {
  gap: 8px;
}

.download-button {
  margin-top: 9px;
}

.job-quality-hint {
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.job-delete-button {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  margin-top: 9px;
  place-items: center;
  border: 1px solid #eac5c9;
  border-radius: 8px;
  padding: 0;
  color: #a13c45;
  background: #fff7f7;
  font-size: 20px;
  line-height: 1;
}

.job-delete-button:hover,
.job-delete-button:focus-visible {
  border-color: #d66973;
  background: #fff0f1;
}

.library-view {
  margin-top: 18px;
}

.library-heading {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(42, 52, 31, 0.035);
}

.library-heading h2 {
  margin: 5px 0 0;
}

.library-intro {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.library-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.library-summary {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  color: var(--muted);
  font-size: 12px;
}

#library-count {
  color: var(--ink);
  font-weight: 750;
}

.library-toolbar {
  display: inline-flex;
  margin: 0 0 16px;
}

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

.media-card {
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.media-card:focus-visible,
.reference-picture-button:focus-visible,
.reference-add-card:focus-visible {
  outline: 3px solid rgba(174, 205, 56, 0.35);
  outline-offset: 2px;
}

.media-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 14;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf0e8;
}

.media-thumb img,
.media-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.media-card:hover .media-thumb img,
.media-card:hover .media-thumb video {
  transform: scale(1.025);
}

.media-kind,
.play-mark {
  position: absolute;
  color: #fff;
}

.media-kind {
  top: 8px;
  left: 8px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(25, 31, 22, 0.7);
  font-size: 10px;
  font-weight: 720;
}

.play-mark {
  top: 50%;
  left: 50%;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(25, 31, 22, 0.54);
  font-size: 15px;
  transform: translate(-50%, -50%);
}

.media-caption {
  display: grid;
  gap: 4px;
  padding: 9px 2px 2px;
}

.media-caption strong,
.media-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-caption strong {
  font-size: 12px;
}

.media-caption span {
  color: var(--muted);
  font-size: 10px;
}

.media-caption .media-sync {
  color: #198353;
}

.library-empty {
  grid-column: 1 / -1;
  margin: 52px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.library-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#library-load-more {
  min-width: 160px;
}

.preview-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: min(880px, calc(100% - 28px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(38, 48, 27, 0.22);
}

.preview-dialog::backdrop {
  background: rgba(38, 44, 35, 0.36);
  backdrop-filter: blur(3px);
}

.preview-dialog-head {
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.preview-dialog-head h2 {
  max-width: 740px;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-media {
  display: grid;
  max-height: 66vh;
  place-items: center;
  background: #eef1e9;
}

.preview-media img,
.preview-media video {
  display: block;
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
}

.preview-media img {
  cursor: zoom-in;
}

.preview-media img.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.preview-details {
  padding: 16px 20px 20px;
}

.preview-meta {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.preview-prompt {
  max-height: 120px;
  margin-bottom: 16px;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .console-layout {
    grid-template-columns: minmax(0, 1fr) minmax(286px, 0.58fr);
  }

  .config-grid {
    grid-template-columns: minmax(205px, 1.38fr) repeat(4, minmax(86px, 0.7fr));
  }

  .cloud-actions select {
    max-width: 145px;
  }

  .cloud-actions .icon-text-button {
    display: none;
  }

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

@media (max-width: 940px) {
  .console-layout {
    grid-template-columns: 1fr;
  }

  .jobs-panel {
    position: static;
  }

  .jobs-list {
    max-height: none;
  }

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

@media (max-width: 680px) {
  .studio-shell {
    width: min(100% - 24px, 720px);
    padding-top: 12px;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .topbar {
    top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    padding: 9px;
  }

  .topbar-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
    gap: 6px;
  }

  .view-switcher {
    min-width: 0;
  }

  .view-tab {
    flex: 1;
  }

  .status-chip {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-copy .eyebrow {
    display: none;
  }

  .console-layout,
  .library-view {
    margin-top: 12px;
  }

  .compose-panel,
  .jobs-panel {
    padding: 16px;
  }

  .compose-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 16px;
  }

  .compose-heading h2 {
    font-size: 21px;
  }

  .compose-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mode-seg .mode-option span {
    min-height: 33px;
    padding: 0 15px;
  }

  .startup-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 19px;
  }

  .cloud-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .cloud-actions select {
    max-width: none;
    min-width: 0;
  }

  .cloud-actions .icon-text-button {
    display: inline-flex;
  }

  .config-grid,
  .config-grid[data-media-type="image"] {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-bottom: 19px;
  }

  .config-field {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .config-field label {
    margin: 0;
  }

  .config-field select {
    height: 42px;
    font-size: 16px;
  }

  .workflow-field {
    display: block;
  }

  .workflow-field label {
    margin-bottom: 6px;
  }

  .image-size-field {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .image-size-field label,
  .image-size-field .field-sublabel {
    margin: 0;
  }

  .reference-summary,
  .prompt-reference-summary,
  .shot-splitter-summary {
    min-height: 59px;
  }

  .reference-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 15px;
  }

  .prompt-workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .prompt-workspace .reference-grid {
    margin-bottom: 15px;
  }

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

  .reference-remove-button {
    width: 26px;
    height: 26px;
    opacity: 1;
  }

  .mode-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .shot-splitter-controls {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .shot-template-options {
    grid-column: 1 / -1;
  }

  .shot-template-options .mode-option span {
    min-height: 34px;
  }

  .shot-duration-note {
    padding-bottom: 0;
    text-align: left;
  }

  .shot-splitter-controls .ghost-btn {
    height: 42px;
  }

  .mode-row .mode-option span {
    min-height: 34px;
    padding: 0 7px;
  }

  .prompt-reference {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .prompt-reference select {
    width: 100%;
    height: 42px;
    font-size: 16px;
  }

  .prompt-reference-preview {
    max-height: 132px;
  }

  .h3-check-heading {
    align-items: flex-start;
  }

  textarea,
  input {
    font-size: 16px;
  }

  #prompt {
    min-height: 180px;
  }

  .options-row {
    display: grid;
    grid-template-columns: minmax(128px, 0.74fr) minmax(0, 1.26fr);
    align-items: end;
    gap: 12px;
  }

  #seed-field {
    width: auto;
  }

  .queue-note {
    text-align: right;
  }

  .queue-note small {
    margin-left: auto;
  }

  #submit-button {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 8;
    min-height: 50px;
    box-shadow: 0 10px 24px rgba(65, 79, 39, 0.2);
  }

  .library-heading,
  .library-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .library-heading {
    padding: 18px;
  }

  .library-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .preview-dialog-head {
    padding: 15px;
  }

  .preview-details {
    padding: 14px 15px 18px;
  }
}

@media (max-width: 390px) {
  .studio-shell {
    width: min(100% - 18px, 720px);
  }

  .status-chip {
    max-width: 96px;
  }

  .cloud-actions {
    grid-template-columns: 1fr 1fr;
  }

  .cloud-actions select,
  .cloud-actions .ghost-btn {
    grid-column: 1 / -1;
  }

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

  .queue-note {
    text-align: left;
  }

  .queue-note small {
    margin-left: 0;
  }
}

/* Bright, creation-first workspace treatment. */
.console-layout {
  gap: 24px;
  margin-top: 26px;
}

.compose-panel {
  border: 0;
  padding: 12px 6px 32px;
  background: transparent;
  box-shadow: none;
}

.jobs-panel {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 22px rgba(31, 32, 43, 0.035);
}

.compose-heading {
  margin-bottom: 26px;
}

.compose-heading h2 {
  font-size: 30px;
  line-height: 1.16;
}

.media-mode-row,
.mode-row,
.library-toolbar {
  border-color: #e6e7ed;
  background: #f1f2f5;
}

.mode-seg .mode-option input:checked + span,
.mode-row .mode-option input:checked + span {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(29, 29, 34, 0.11);
}

.preset-label {
  color: #50670d;
  background: #edf8c4;
}

.startup-panel {
  display: block;
  margin: 0 0 28px;
  padding: 13px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.cloud-runline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cloud-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cloud-actions .ghost-primary {
  background: #ffffff;
}

#cloud-power-on {
  border-color: #b8d541;
  color: #4c650b;
  background: #f3fad8;
}

.config-section {
  margin-bottom: 22px;
}

.config-grid {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

#prompt {
  min-height: 220px;
  border-color: #d9dbe2;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 32, 43, 0.025);
}

#submit-button {
  min-height: 48px;
}

.queue-overview {
  border-color: #e2e7ce;
  background: #f8fbe9;
}

.library-heading {
  border-color: var(--line);
  box-shadow: 0 6px 22px rgba(31, 32, 43, 0.035);
}

/* Video prompt composer: keep reference assets and prompt writing in one creation surface. */
.video-prompt-stage {
  display: grid;
  grid-template-columns: minmax(172px, 196px) minmax(0, 1fr);
  min-height: 246px;
  overflow: hidden;
  border: 1px solid #e1e3e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(31, 32, 43, 0.035);
}

.prompt-editor .video-reference-workspace {
  margin: 0;
  border: 0;
  border-right: 1px solid #eceef1;
  border-radius: 0;
  background: #fafbfc;
  box-shadow: none;
}

.prompt-editor .video-reference-workspace[open] {
  border-color: #eceef1;
  background: #fafbfc;
  box-shadow: none;
}

.video-reference-workspace .reference-summary {
  min-height: 40px;
  margin: 12px 12px 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #ffffff;
  background: #26282d;
}

.video-reference-workspace .reference-summary-copy {
  min-width: 0;
}

.video-reference-workspace .reference-summary .eyebrow,
.video-reference-workspace .reference-summary-status {
  display: none;
}

.video-reference-workspace .reference-summary strong {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 680;
}

.video-reference-workspace .details-toggle-label {
  color: transparent;
  font-size: 0;
}

.video-reference-workspace .details-toggle-label::after {
  width: 12px;
  margin-left: 0;
  color: #ffffff;
  content: "+";
  font-size: 16px;
}

.video-reference-workspace[open] .details-toggle-label::after {
  content: "−";
}

.video-reference-workspace[data-closing="true"] > summary .details-toggle-label::after {
  color: #ffffff;
}

.video-reference-workspace .reference-body-content > .field-hint {
  padding: 11px 12px 0;
  color: #7b8089;
  font-size: 10px;
  line-height: 1.5;
}

.video-reference-workspace .reference-body-content > .reference-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 12px 12px;
}

.video-reference-workspace .reference-add-card {
  min-height: 72px;
  border-color: #cfd4dc;
  background: #ffffff;
}

.video-reference-workspace .reference-add-card:hover {
  border-color: #9fba2d;
  background: #f7faed;
}

.video-reference-workspace .reference-add-card span {
  color: #66707c;
  font-size: 24px;
}

.video-reference-workspace .reference-add-card small {
  color: #66707c;
  font-size: 9px;
}

.video-reference-workspace .reference-card,
.video-reference-workspace .reference-add-card {
  border-radius: 6px;
}

.video-prompt-canvas {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px 18px 14px;
}

.video-prompt-canvas .prompt-heading {
  margin-bottom: 9px;
}

.video-prompt-canvas #prompt {
  min-height: 188px;
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.7;
}

.video-prompt-canvas #prompt:focus {
  outline: 0;
  box-shadow: none;
}

.video-prompt-canvas:focus-within {
  box-shadow: inset 3px 0 0 var(--lime-strong);
}

.video-prompt-canvas #prompt-hint {
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid #f0f1f3;
}

@media (max-width: 1180px) {
  .cloud-actions .icon-text-button {
    display: inline-flex;
  }
}

@media (max-width: 680px) {
  .compose-panel {
    padding: 8px 0 24px;
  }

  .compose-heading h2 {
    font-size: 26px;
  }

  .cloud-runline {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .config-grid {
    padding: 13px;
  }

  .video-prompt-stage {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .prompt-editor .video-reference-workspace {
    border-right: 0;
    border-bottom: 1px solid #eceef1;
  }

  .video-reference-workspace .reference-summary {
    margin: 11px 11px 0;
  }

  .video-reference-workspace .reference-body-content > .reference-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 10px 11px 12px;
  }

  .video-prompt-canvas {
    min-height: 220px;
    padding: 15px 13px 13px;
  }

  .video-prompt-canvas #prompt {
    min-height: 174px;
  }
}

/* Entry workspace: choose an outcome before exposing production controls. */
.home-view {
  margin-top: 44px;
  animation: view-enter 260ms ease both;
}

.home-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.home-title {
  min-width: 0;
}

.home-heading .eyebrow {
  margin-bottom: 7px;
}

.home-heading h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
}

.home-live-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin: 0 5px 8px 0;
  border-radius: 50%;
  background: var(--lime-strong);
  box-shadow: 0 0 0 6px rgba(216, 247, 90, 0.25);
  animation: home-live-pulse 1.8s ease-in-out infinite;
}

.home-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 172px;
  align-items: end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(31, 32, 43, 0.035);
  text-align: left;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.home-route:hover,
.home-route:focus-visible {
  border-color: #b8d541;
  box-shadow: 0 14px 32px rgba(57, 73, 18, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.home-route:active {
  transform: translateY(0);
}

.route-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  align-self: start;
  border: 1px solid #dfe3d4;
  border-radius: 8px;
  color: #52690d;
  background: #f4f9df;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.home-route-video .route-icon {
  border-color: #dce3f7;
  color: #305fae;
  background: #edf3ff;
}

.home-route-library .route-icon {
  border-color: #e5dfe0;
  color: #795151;
  background: #fff5f3;
}

.route-copy {
  display: grid;
  min-width: 0;
  align-self: end;
  gap: 5px;
}

.route-copy strong {
  font-size: 18px;
  line-height: 1.2;
}

.route-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-arrow {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
  transition: color 170ms ease, transform 170ms ease;
}

.home-route:hover .route-arrow,
.home-route:focus-visible .route-arrow {
  color: #627b13;
  transform: translateX(2px);
}

.home-status-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.home-cloud-panel {
  flex: 0 1 590px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-cloud-panel .cloud-runline {
  justify-content: flex-end;
  gap: 10px;
}

.home-cloud-panel .cloud-status {
  flex: 0 1 168px;
  gap: 8px;
}

.home-cloud-panel .cloud-title,
.home-cloud-panel .cloud-host-status {
  display: none;
}

.home-cloud-panel .cloud-subtle {
  margin: 0;
  font-size: 11px;
}

.home-cloud-panel .cloud-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.home-cloud-panel .cloud-actions select {
  max-width: 132px;
}

.home-cloud-panel .cloud-actions select,
.home-cloud-panel .cloud-actions button {
  height: 32px;
  min-height: 32px;
}

.home-cloud-panel #cloud-power-on {
  order: 4;
}

.home-cloud-panel #cloud-power-off {
  order: 3;
}

.home-view .home-status-strip {
  margin-top: 0;
}

.compose-heading-compact {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.home-status-label {
  color: var(--muted);
}

.home-status-strip strong {
  color: var(--ink);
  font-size: 12px;
}

#home-status-detail {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 0;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.back-button:hover,
.back-button:focus-visible {
  color: var(--ink);
  outline: none;
}

.advanced-config {
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced-config-summary {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}

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

.advanced-config-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.advanced-config-value {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

#config-summary {
  overflow: hidden;
  max-width: 430px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advanced-config .config-section {
  margin-bottom: 0;
  padding-bottom: 4px;
}

.advanced-config[open] .advanced-config-summary {
  border-bottom: 1px solid var(--line);
}

.advanced-config[open] .details-toggle-label {
  font-size: 0;
}

.advanced-config[open] .details-toggle-label::after {
  content: "−";
  font-size: 16px;
}

.home-view,
.console-layout,
.library-view {
  animation: view-enter 240ms ease both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-live-pulse {
  50% {
    box-shadow: 0 0 0 10px rgba(216, 247, 90, 0);
  }
}

@media (max-width: 940px) {
  .home-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-cloud-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
  }

  .home-cloud-panel .cloud-runline {
    justify-content: space-between;
  }

  .home-route-grid {
    grid-template-columns: 1fr;
  }

  .home-route {
    min-height: 112px;
  }
}

@media (max-width: 680px) {
  .home-view {
    margin-top: 28px;
  }

  .home-heading h1 {
    font-size: 28px;
  }

  .home-route-grid {
    gap: 10px;
  }

  .home-route {
    min-height: 98px;
    padding: 16px;
  }

  .route-icon {
    align-self: center;
  }

  .route-copy {
    align-self: center;
  }

  .home-status-strip {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }

  .home-status-label {
    grid-column: 1 / -1;
  }

  .home-cloud-panel .cloud-status {
    flex-basis: auto;
  }

  .home-cloud-panel .cloud-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .home-cloud-panel .cloud-actions select {
    max-width: none;
  }

  .compose-heading-compact {
    margin-bottom: 12px;
  }

  .compose-heading-compact .compose-heading-actions {
    justify-content: flex-start;
  }

  #home-status-detail {
    max-width: 180px;
  }

  .back-button {
    padding-left: 0;
  }

  .advanced-config-summary {
    min-height: 60px;
  }

  .advanced-config-value {
    max-width: 48%;
  }

  #config-summary {
    max-width: 122px;
  }
}

/* Keep the home-page cloud controls compact, but make their status and actions read as one unit. */
.home-cloud-panel {
  flex: 0 1 590px;
  padding: 9px 10px;
  border: 1px solid #e3e5eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 5px 16px rgba(31, 32, 43, 0.035);
}

.home-cloud-panel .cloud-runline {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.home-cloud-panel .cloud-status {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.home-cloud-panel .cloud-title {
  display: block;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0;
}

.home-cloud-panel .cloud-host-status {
  display: none;
}

.home-cloud-panel .cloud-subtle {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
}

.home-cloud-panel .cloud-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.home-cloud-panel .cloud-actions select {
  width: 154px;
  max-width: 154px;
}

.home-cloud-panel .cloud-actions select,
.home-cloud-panel .cloud-actions button {
  height: 32px;
  min-height: 32px;
}

@media (max-width: 940px) {
  .home-cloud-panel {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
  }

  .home-cloud-panel .cloud-runline {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-cloud-panel .cloud-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 7px;
  }

  .home-cloud-panel .cloud-actions select {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .home-cloud-panel {
    padding: 10px;
  }

  .home-cloud-panel .cloud-actions {
    grid-template-columns: 1fr 1fr;
  }

  .home-cloud-panel .cloud-actions select,
  .home-cloud-panel .cloud-actions .ghost-btn {
    grid-column: 1 / -1;
  }
}

/* 预览窗操作行（下载 + 删除） */
.preview-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.preview-action-row .ghost-btn {
  height: 34px;
}

/* 本站材料库选图（2026-08-29） */
.reference-source-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.library-picker-dialog {
  width: min(720px, 92vw);
  max-height: 84vh;
}
.library-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
  max-height: 52vh;
  overflow-y: auto;
}
.library-pick-card {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #101114;
  cursor: pointer;
  overflow: hidden;
}
.library-pick-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.library-pick-card .pick-check {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.35);
}
.library-pick-card.picked {
  border-color: var(--accent);
}
.library-pick-card.picked .pick-check {
  background: var(--accent);
  border-color: var(--accent);
}
.library-pick-card.picked .pick-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #17190d;
  font-size: 13px;
  font-weight: 800;
}


/* ===== 提示词记录本页面（2026-08-29） ===== */
.prompts-view { padding: 0 4px 40px; }
.prompts-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.prompts-heading h2 { margin: 4px 0 0; }
.prompt-library-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.prompt-entry { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #121317; }
.prompt-entry-head { display: flex; align-items: center; gap: 8px; }
.prompt-cat-chip { padding: 2px 8px; border-radius: 999px; background: rgba(227,239,115,0.12); color: #dde58c; font-size: 11px; font-weight: 600; }
.prompt-entry-body { margin: 0; padding: 10px; border-radius: 8px; background: #0e0f12; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; cursor: pointer; max-height: 150px; overflow: hidden; }
.prompt-entry-body.expanded { max-height: none; }
.prompt-entry-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prompt-editor-dialog { width: min(680px, 94vw); }
.prompt-editor-form { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.prompt-editor-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted-strong); }
.prompt-editor-form input, .prompt-editor-form select, .prompt-editor-form textarea { font-size: 13px; }
