.preview-empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--panel-soft), var(--panel));
  border: 1px solid var(--border);
}
.preview-empty-visual {
  position: relative;
  width: min(100%, 320px);
  height: 140px;
  margin: 0 auto 6px;
}
.preview-shape {
  position: absolute;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border: 1px solid var(--border);
}
.preview-shape.shape-a { width: 58%; height: 52%; left: 8%; top: 18%; }
.preview-shape.shape-b { width: 42%; height: 38%; right: 10%; top: 8%; }
.preview-shape.shape-c { width: 48%; height: 34%; left: 22%; bottom: 8%; }
.video-preview-visual {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px dashed var(--border);
}
.video-play-icon { font-size: 2rem; color: var(--accent); z-index: 1; }
.video-timeline-bar {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 28%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.video-timeline-fill { display: block; width: 42%; height: 100%; background: var(--accent); }
.video-scene-markers {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 38%;
  display: flex;
  justify-content: space-between;
}
.video-scene-markers i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.video-duration-label {
  position: absolute;
  right: 10%;
  bottom: 10%;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.generate-workbench {
  width: min(1200px, 100%);
  height: calc(100vh - var(--header-height) - 40px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.generate-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.generate-title-row h1 {
  font-size: 2rem;
  margin: 6px 0 4px;
}
.generate-title-row .muted {
  max-width: 680px;
  margin: 0;
}
.generate-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
}
.generate-control-panel,
.generate-preview-panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 16px;
}
.generate-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.generate-control-panel .ai-composer {
  max-width: none;
  box-shadow: none;
  border-radius: 14px;
}
.generate-control-panel .ai-composer textarea {
  min-height: 118px;
}
.generate-control-panel .ai-composer-footer {
  align-items: stretch;
}
.generate-control-panel .ai-mode-chips,
.generate-control-panel .ai-composer-actions {
  width: 100%;
}
.generate-control-panel .ai-composer-actions {
  justify-content: space-between;
}
.generate-preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.generate-result {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
}
.generate-result.hidden { display: none; }
.generate-preview-panel .empty-state {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 10px;
}
.result-card {
  overflow: auto;
  max-height: 100%;
}
.result-ready-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.result-ready-head h3 {
  margin: 8px 0 0;
}
.result-img, .result-card img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
.result-video-preview {
  min-height: 320px;
}
.duration-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.video-timeline {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.52);
  overflow: hidden;
}
.video-timeline span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.result-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.result-meta-grid div {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}
.result-meta-grid span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.result-prompt {
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
  margin-top: 12px;
}
.result-actions { margin-top: 12px; }
.progress-block {
  text-align: center;
  padding: 28px 16px;
}
.control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}
.composer-settings {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  grid-template-columns: 1fr;
}
.cost-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 10px 12px;
}
.cost-note strong { color: var(--text-primary); }

@media (max-width: 980px) {
  .generate-workbench {
    height: auto;
    min-height: calc(100vh - var(--header-height) - 96px);
  }
  .generate-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .generate-title-row { flex-direction: column; }
  .generate-control-panel,
  .generate-preview-panel { padding: 12px; }
}
