/* Video to Script view (Video to Script Module) — a sidebar of past videos
   next to ONE main column that shows exactly one step at a time. The single
   column is deliberate: the module has one human gate, and a screen that
   shows five steps at once invites clicking the wrong one. Tokens, radii
   and the .card/.btn/.input classes are the app's existing ones. */

.vts-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.vts-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

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

.vts-card h2 {
  margin: 0;
}

.vts-helper {
  margin: 0;
}

.vts-notice,
.vts-error,
.vts-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background: var(--bg-sunken, #f6efe6);
}

.vts-error {
  border-color: var(--danger);
  color: var(--danger-ink);
}

.vts-warn {
  border-color: var(--sunny);
  color: var(--sunny-ink);
}

.vts-big-button {
  align-self: flex-start;
  padding: 14px 28px;
  font-size: 1.05em;
}

.vts-filename {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}

/* --- Fields ------------------------------------------------------------ */

.vts-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vts-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vts-number {
  width: 88px;
  flex: none;
}

.vts-textarea {
  resize: vertical;
}

.vts-platform-select {
  max-width: 260px;
}

/* A tickbox and its wording read as one thing, so the whole row is the
   label and the whole row is clickable. */
.vts-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.vts-checkbox {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--primary);
}

.vts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Before the run starts --------------------------------------------- */
/* The one sentence he needs (how long this will take) is the biggest thing
   on the card; the numbers behind it sit quietly underneath. */

.vts-estimate {
  margin: 0;
  font-size: 1.15em;
  font-weight: 600;
}

.vts-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-sunken, #f6efe6);
}

.vts-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9em;
}

.vts-fact-label {
  color: var(--text-muted);
}

.vts-fact-value {
  font-weight: 600;
  text-align: right;
}

/* --- Progress ---------------------------------------------------------- */

.vts-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vts-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.vts-progress-track {
  height: 10px;
  border-radius: var(--radius-pill, 999px);
  background: var(--bg-sunken, #f6efe6);
  overflow: hidden;
}

.vts-progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill, 999px);
  background: var(--primary);
  transition: width 240ms ease;
}

.vts-progress-fill.vts-done {
  background: var(--success);
}

/* A pass that can't count itself: the bar slides so the screen shows work
   is happening, without ever claiming a percentage it doesn't have. */
.vts-progress-fill.vts-waiting {
  transition: none;
  animation: vts-slide 1.6s ease-in-out infinite;
}

@keyframes vts-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vts-progress-fill.vts-waiting {
    animation: none;
  }
}

.vts-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9em;
}

.vts-pre {
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-sunken, #f6efe6);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85em;
}

/* --- The batch --------------------------------------------------------- */

.vts-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.vts-batch-head h2 {
  margin: 0;
}

.vts-batch-head p {
  margin: 4px 0 0;
}

.vts-script-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vts-script-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-elevated, #fff);
}

.vts-script-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.vts-script-n {
  font-weight: 600;
}

.vts-beat {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.vts-beat-label {
  color: var(--text-muted);
  font-size: 0.85em;
  padding-top: 2px;
}

.vts-beat-text {
  margin: 0;
}

.vts-beat-input {
  width: 100%;
  resize: vertical;
}

.vts-accepted {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-sunken, #f6efe6);
}

.vts-accepted p {
  margin: 0;
}

/* --- Past videos ------------------------------------------------------- */

.vts-records {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 16px;
}

.vts-records h2 {
  margin: 0;
  font-size: 1em;
}

.vts-record-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vts-record {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-elevated, #fff);
  cursor: pointer;
  font: inherit;
}

.vts-record-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.vts-record span {
  font-size: 0.8em;
}

/* The app shell narrows a long way inside the Mac window; below this the
   sidebar sits above the column rather than squeezing both. */
@media (max-width: 900px) {
  .vts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .vts-records {
    position: static;
  }
}

/* The "which AI" chooser belongs to the Fizzavo radio above it, so it is
   indented under that choice rather than reading as a fifth dial. */
.vts-subfield {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
