/* ============================================================
   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); }

.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; }


/* ============================================================
   Auto — bulk queue
   ============================================================ */

.drop-bulk {
  padding: 34px 18px;
  font-size: 15px;
  color: var(--text-soft);
  border-width: 2px;
}
.drop-bulk b { color: var(--text); }
.drop-bulk span { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }
.drop-bulk-ic {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--signal-lo);
  border: 1px solid var(--signal-mid);
  color: var(--signal);
}

.auto-opts {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px 20px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.auto-opts .trait { margin: 0; }
.auto-opts .trait-wide { grid-column: 1 / -1; }
.auto-opts select {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-in);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  outline: none;
}
.sub-styles-sm { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 8px; }
.sub-styles-sm .sub-swatch { padding: 7px 6px 6px; }
.sub-styles-sm .sub-sample { font-size: 14px; }
.sub-styles-sm .sub-swatch i { font-size: 10px; margin-top: 4px; }

.auto-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  flex-wrap: wrap;
}
.auto-bar .go { padding: 12px 26px; font-size: 15.5px; }
.auto-bar .btn-quiet { padding: 10px 16px; flex: 0 0 auto; }   /* base .btn-quiet is flex:1 */
.auto-count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

.queue { display: flex; flex-direction: column; gap: 8px; }
.qrow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  transition: border-color 0.2s;
}
.qrow.is-done { border-color: rgba(74, 222, 128, 0.35); }
.qrow.is-error { border-color: rgba(255, 107, 107, 0.4); }
.qrow.is-active { border-color: var(--signal-mid); }
.qthumb {
  width: 96px;
  height: 96px;
  border-radius: var(--r-sm);
  background: var(--panel-in);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}
.qthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qbody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.qname {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qmeta { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; margin-left: 8px; }
.qprog { height: 5px; border-radius: 99px; background: var(--panel-hi); overflow: hidden; }
.qfill { height: 100%; width: 0; background: var(--signal); border-radius: 99px; transition: width 0.5s ease; }
.is-done .qfill { background: var(--ok); }
.is-error .qfill { background: var(--err); }
.qmsg { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.qmsg b { color: var(--text-soft); font-weight: 500; }
.qmsg .qerr { color: var(--err); }
.qacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.qacts .btn-quiet, .qacts a.btn-quiet { padding: 6px 11px; font-size: 12.5px; flex: 0 0 auto; text-decoration: none; }
.qacts .qx { margin-left: auto; color: var(--dim); background: none; border: 0; cursor: pointer; font-size: 13px; }
.qacts .qx:hover { color: var(--err); }
.qpreview { grid-column: 1 / -1; }
.qpreview video { width: 100%; max-height: 460px; border-radius: var(--r); background: #000; display: block; }
.qscript {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--panel-in);
  border: 1px solid var(--line);
}

@media (max-width: 760px) {
  .auto-opts { grid-template-columns: 1fr; }
  .qrow { grid-template-columns: 72px minmax(0, 1fr); }
  .qthumb { width: 72px; height: 72px; }
}


/* ============================================================
   Ai Autocute — input chips, voice chips, segment recipe
   ============================================================ */

.cinputs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.cinput, .cvoice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-soft);
}
.cinput b, .cvoice b {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--panel-hi);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.cinput i, .cvoice i { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.cinput .cx { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 0 2px; }
.cinput .cx:hover { color: var(--err); }
.ccap { width: 100%; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ccap b { color: var(--signal); }
.cvoices { display: flex; flex-wrap: wrap; gap: 6px; }
.cvoice { border-color: var(--signal-mid); background: var(--signal-lo); color: var(--text); }
.cvoice b { background: var(--signal); color: #1a1206; }
.cvoice-warn { border-color: rgba(255, 107, 107, 0.4); background: transparent; color: var(--err); }
.qrecipe {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qname .vbadge { margin: 0 6px 0 4px; vertical-align: 1px; }
