/* ============================================================
   Product photo -> voiceover flow.
   Steps stay visible as a vertical track so the user can see the
   whole pipeline and jump back to edit any stage.
   ============================================================ */

.ai-state {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.ai-state.ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.32); }
.ai-state.off { color: var(--err); border-color: rgba(255, 107, 107, 0.32); }

.draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-size: 12px;
}
.draft-bar .link-btn { flex: 0 0 auto; }

.flow { display: flex; flex-direction: column; gap: 14px; }

.fstep {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.2s, opacity 0.2s;
}
/* Later steps are visible but muted until the one before them completes,
   so the pipeline reads as a whole instead of appearing piece by piece. */
.fstep.is-off { opacity: 0.45; pointer-events: none; }
.fstep.is-done { border-color: var(--signal-mid); }

.fstep-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-in);
}
.fstep-head h2 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; }

.fnum {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--panel-hi);
  border: 1px solid var(--line-hi);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.fstep.is-done .fnum {
  background: var(--signal);
  border-color: var(--signal);
  color: #1a1206;
}
.fredo { flex: 0 0 auto; }

.fstep-body { padding: 16px; }

/* Thin progress bar while a step is waiting on the model. */
.fstep.is-loading .fstep-head {
  background:
    linear-gradient(90deg, transparent, var(--signal-lo), transparent) 0 0 / 40% 100% no-repeat,
    var(--panel-in);
  animation: sweep 1.1s linear infinite;
}
@keyframes sweep {
  from { background-position: -40% 0, 0 0; }
  to   { background-position: 140% 0, 0 0; }
}

.drop-lg { padding: 30px 16px; }

.pshot { margin-top: 14px; }
.pshot img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  display: block;
}

.ta {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-in);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.ta:focus { border-color: var(--signal-mid); }
.ta-script { margin-top: 14px; min-height: 150px; font-size: 15px; }

.script-meta {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

#pVoice {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-in);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  outline: none;
}
#pVoice:focus { border-color: var(--signal-mid); }

@media (max-width: 620px) {
  .fstep-head { padding: 11px 13px; }
  .fstep-body { padding: 13px; }
  .ai-state { white-space: normal; }
}

/* video pipeline */
.vmeta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.vtag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid var(--signal-mid);
  background: var(--signal-lo);
  color: var(--signal);
}
.vtag-off { border-color: var(--line); background: transparent; color: var(--dim); }

.frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.frame { margin: 0; position: relative; }
.frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  display: block;
}
.frame figcaption {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.66);
  font-family: var(--mono);
  font-size: 10px;
  color: #fff;
}

.vout {
  width: 100%;
  max-height: 420px;
  border-radius: var(--r);
  background: #000;
  display: block;
}

/* auto subtitles — style swatches show the actual caption colours */
.sub-styles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.sub-swatch {
  padding: 10px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #1a1c22 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23262933'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23262933'/%3E%3C/svg%3E");
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s, transform 0.14s;
}
.sub-swatch:hover { border-color: var(--line-hi); transform: translateY(-1px); }
.sub-swatch.is-on { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.sub-sample {
  display: inline-block;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 3px;
  paint-order: stroke fill;
}
.sub-swatch i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.sub-swatch.is-on i { color: var(--signal); }
.range-full { width: 100%; accent-color: var(--signal); margin-top: 4px; }
.trait label .range-val { float: right; text-transform: none; letter-spacing: 0; color: var(--text-soft); }
.sub-cues {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.sub-cues b { color: var(--dim); font-weight: 500; margin-right: 6px; }
