/*
 * AI Clip finder (clips.js) on /clip-finder. Builds on spokly.css; the caption list comes from captions.css.
 */

.cf, .cf-upload, .cf-analyse, .cf-review, .cf-look, .cf-side, .cf-player { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cf [hidden] { display: none !important; }
.cf-limit, .cf-saved, .cf-ready, .cf-sent-note, .cf-free { margin: 0; }
.cf-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cf-ready { font-weight: 600; font-variant-numeric: tabular-nums; }
.cf .opts-row .field { min-width: 0; }

.cf-review-head { display: flex; flex-direction: column; gap: 12px; }
.cf-review-head h2, .cf-review-head p { margin: 0; }
.cf-review-head .cf-found { margin-top: 4px; font-weight: 600; }
.cf-look { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-subtle); }
.cf-look .chips { flex-wrap: wrap; }
.cf-run { display: flex; align-items: center; gap: 12px; }
.cf-run .progress { flex: 1 1 auto; }

.cf-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cf-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); min-width: 0; }
.cf-card.is-off { opacity: .6; }
.cf-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cf-card-head .cf-keep { margin-inline-start: auto; }
.cf-card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 720px) { .cf-card-body { grid-template-columns: 240px minmax(0, 1fr); } }
.cf-player { align-items: center; gap: 10px; }
.cf-stage { position: relative; width: 100%; max-width: 240px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; touch-action: pan-y; }
.cf-stage.can-drag { cursor: ew-resize; }
.cf-stage video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.cf-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cf-player-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.cf-why, .cf-tags, .cf-len { margin: 0; }
.cf-tags { color: var(--text-2); overflow-wrap: anywhere; }
.cf-len { font-variant-numeric: tabular-nums; }

/* Start and end handles, snapping to the words */
.cf-track { position: relative; height: 36px; margin-inline: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); touch-action: pan-y; cursor: pointer; }
.cf-sel { position: absolute; top: -1px; bottom: -1px; border-block: 2px solid var(--primary); background: var(--hover); pointer-events: none; }
.cf-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger); pointer-events: none; }
.cf-handle { position: absolute; top: -6px; bottom: -6px; width: 44px; margin-left: -22px; border-radius: 8px; touch-action: none; cursor: ew-resize; }
.cf-handle::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 18px; width: 8px; border-radius: 4px; background: var(--primary); }
.cf-handle:hover::after, .cf-handle.is-drag::after, .cf-handle:focus-visible::after { box-shadow: 0 0 0 3px var(--overlay); }

.cf-caps summary, .cf-transcript summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.cf-caps .cap-list { margin-top: 10px; }
.cf-transcript { display: flex; flex-direction: column; gap: 12px; }
.cf-transcript[open] > summary { margin-bottom: 12px; }
.cf-full { display: block; width: 100%; max-height: 50vh; margin-bottom: 12px; border-radius: 12px; background: #000; }
.cf-sentences { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; }
.cf-sentences li { border-inline-start: 3px solid transparent; }
.cf-sentences li.in-clip { border-inline-start-color: var(--accent-1); }
.cf-sent { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.cf-sent:hover, .cf-sent:focus-visible { background: var(--hover); }
.cf-sent .mono { color: var(--text-2); font-size: 12px; }
.cf-sent > span:last-child { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
