/*
 * Auto captions (captions.js): upload, preview with captions, editor and export.
 * Used on the home page tab, in the studio and on /auto-captions. Builds on spokly.css.
 */
.cap { display: flex; flex-direction: column; gap: 16px; }
.cap-upload { display: flex; flex-direction: column; gap: 16px; }
.cap-limit { margin: 0; }

.cap-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .cap-editor { grid-template-columns: minmax(0, 1.05fr) minmax(320px, 1fr); } }
.cap-preview { display: flex; justify-content: center; min-width: 0; }
.cap-stage { position: relative; max-width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.cap-stage video, .cap-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cap-stage video { object-fit: fill; background: #000; }
.cap-stage canvas { pointer-events: none; }

.cap-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cap-opts { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cap-opts .field { flex: 0 1 auto; }
.cap-opts .select { min-width: 140px; }
.cap-list-head { display: flex; flex-direction: column; gap: 2px; }
.cap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.cap-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cap-row.is-active { border-color: var(--text); box-shadow: var(--shadow-sm); }
.cap-times { display: flex; align-items: center; gap: 6px; }
.cap-times > span { color: var(--text-2); font-size: 13px; }
.cap-time { width: 84px; height: 32px; padding: 0 8px; font-family: var(--mono); font-size: 13px; }
.cap-del { width: 30px; height: 30px; margin-left: auto; font-size: 13px; }
.cap-text { width: 100%; height: 38px; }
.cap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .cap-actions .btn-lg { width: 100%; } }
