/* ---------------- Clipper ----------------
   Clipper AI's page (link box, options, caption style with live preview, progress, clip grid),
   in Hookvera's colours. */
.cl-page { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.cl-head { padding-top: 6px; }
.cl-title { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 6px; font-weight: 800; }
.cl-title span {
  background: linear-gradient(135deg, #6366f1, #a855f7 55%, #ec4899); color: #fff;
  padding: 0 9px; border-radius: 7px; margin-left: 2px;
}
.cl-sub { color: var(--text-muted); margin: 0; font-size: 15px; }
.cl-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; }
.cl-notice {
  border: 1px solid rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.08); color: var(--text-main);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.cl-notice[hidden] { display: none; }

.cl-source-tabs { display: inline-flex; gap: 4px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.cl-source-tab { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: none; color: var(--text-muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.cl-source-tab.active { background: var(--primary); color: #fff; }

.cl-row { display: flex; gap: 10px; }
.cl-row[hidden] { display: none; }
.cl-row input[type=url] {
  flex: 1; min-width: 0; font: inherit; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-main);
}
.cl-row input[type=url]:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.cl-file {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--border-subtle); background: var(--bg-input); color: var(--text-muted); font-size: 14px;
}
.cl-file:hover, .cl-file.has-file { border-color: var(--primary); color: var(--text-main); }
.cl-file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cl-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-go {
  font: inherit; font-weight: 700; padding: 0 24px; border: 0; border-radius: 10px; cursor: pointer; white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7); box-shadow: 0 6px 18px var(--primary-glow);
}
.cl-go:disabled { opacity: .5; cursor: default; box-shadow: none; }
.cl-rights { margin: 8px 0 0; font-size: 12px; color: var(--text-faint); }
.cl-formats { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }
.cl-formats[hidden] { display: none; }
.cl-formats b { color: var(--text-main); font-weight: 600; }
.cl-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 14px; color: var(--text-muted); font-size: 14px; }
.cl-opts label { display: flex; align-items: center; gap: 8px; }
.cl-opts input[type=number] {
  width: 64px; font: inherit; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-main);
}
.cl-opts input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
.cl-cost { margin-left: auto; font-size: 13px; color: var(--text-faint); }

.cl-style { margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 14px; }
.cl-style summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
.cl-style summary::-webkit-details-marker { display: none; }
.cl-style summary::before { content: "▸"; color: var(--text-muted); transition: transform .15s; }
.cl-style[open] summary::before { transform: rotate(90deg); }
.cl-style summary small { color: var(--text-muted); font-weight: 400; }
.cl-style-body { display: flex; gap: 24px; margin-top: 16px; align-items: flex-start; }
.cl-controls { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px; min-width: 0; }
.cl-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.cl-field.wide { grid-column: 1 / -1; }
.cl-field > span { display: flex; justify-content: space-between; }
.cl-field output { color: var(--text-main); font-variant-numeric: tabular-nums; }
.cl-field select {
  font: inherit; font-size: 15px; color: var(--text-main); background: var(--bg-input);
  border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 10px;
}
.cl-field input[type=range] { accent-color: var(--primary); width: 100%; }
.cl-swatches { display: flex; gap: 14px; flex-wrap: wrap; }
.cl-swatch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.cl-swatch input { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-subtle); border-radius: 8px; background: none; cursor: pointer; }
.cl-checks { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--text-muted); }
.cl-checks label { display: flex; align-items: center; gap: 8px; }
.cl-checks input { accent-color: var(--primary); width: 16px; height: 16px; }
.cl-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-presets button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--border-subtle);
  border-radius: 99px; background: var(--secondary); color: var(--text-main); cursor: pointer;
}
.cl-presets button:hover { border-color: var(--primary); }
.cl-reset { font: inherit; font-size: 13px; border: 0; background: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; padding: 0; }
.cl-preview { width: 200px; flex: none; position: sticky; top: 12px; }
.cl-preview img {
  width: 100%; aspect-ratio: 9/16; border-radius: 12px; background: #222; display: block;
  border: 1px solid var(--border-subtle); transition: opacity .15s;
}
.cl-preview img.loading { opacity: .6; }
.cl-preview p { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); text-align: center; }

.cl-status[hidden] { display: none; }
.cl-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cl-step { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--secondary); color: var(--text-muted); }
.cl-step.active { background: var(--primary); color: #fff; font-weight: 600; }
.cl-step.done { color: var(--text-main); }
.cl-step.done::before { content: "✓ "; color: var(--accent-emerald); }
.cl-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cl-pct { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cl-eta { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cl-eta b { color: var(--text-main); font-weight: 650; }
.cl-bar { height: 8px; background: var(--secondary); border-radius: 99px; overflow: hidden; }
.cl-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); transition: width .4s; }
.cl-now { margin-top: 10px; font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cl-now b { color: var(--text-main); font-weight: 600; }
.cl-error { color: var(--accent-rose); margin-top: 10px; }
.cl-error:empty { display: none; }

.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.cl-clip { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.cl-clip video { width: 100%; aspect-ratio: 9/16; background: #000; display: block; }
.cl-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cl-clip-title { font-weight: 650; font-size: 15px; line-height: 1.3; }
.cl-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); }
.cl-score { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.cl-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.cl-dl {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; box-sizing: border-box;
  text-align: center; text-decoration: none; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer;
  color: var(--text-main); background: none; border: 1px solid var(--border-subtle); border-radius: 9px; padding: 8px 10px; white-space: nowrap;
}
.cl-dl:hover { border-color: var(--primary); }
.cl-dl.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.cl-dl:disabled { opacity: .6; cursor: default; }

.cl-dl.danger { color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.35); }
.cl-dl.danger:hover:not(:disabled) { background: rgba(244, 63, 94, 0.1); border-color: var(--accent-rose); }
.cl-dl.icon { flex: 0 0 38px; padding: 8px 0; color: var(--text-muted); }
.cl-dl.icon:hover { color: var(--accent-rose); border-color: var(--accent-rose); }
.cl-dl.icon svg { width: 16px; height: 16px; flex: none; }

.cl-history[hidden] { display: none; }
.cl-history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.cl-history-title { margin: 0 0 4px; font-size: 17px; }
.cl-history-note { margin: 0; font-size: 13px; color: var(--text-muted); max-width: 60ch; }
.cl-history-actions { display: flex; align-items: center; gap: 12px; }
.cl-history-actions .cl-dl { flex: none; padding: 8px 14px; }
.cl-select-all { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.cl-select-all input, .cl-hrow input { accent-color: var(--primary); width: 16px; height: 16px; }
.cl-history-list { display: flex; flex-direction: column; }
.cl-hrow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border-subtle); }
.cl-hrow.current { background: rgba(99, 102, 241, 0.06); }
.cl-hrow-main { flex: 1; min-width: 0; }
.cl-hrow-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-hrow-meta { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-chip { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--secondary); color: var(--text-muted); }
.cl-chip.done { background: rgba(16, 185, 129, 0.14); color: var(--accent-emerald); }
.cl-chip.error { background: rgba(244, 63, 94, 0.14); color: var(--accent-rose); }
.cl-chip.running, .cl-chip.queued { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
.cl-hrow .cl-dl { flex: none; padding: 6px 12px; font-size: 13px; }

@media (max-width: 700px) {
  .cl-style-body { flex-direction: column-reverse; }
  .cl-preview { width: 160px; align-self: center; position: static; }
}
@media (max-width: 560px) {
  .cl-row { flex-direction: column; }
  .cl-go { padding: 12px; }
  .cl-title { font-size: 26px; }
  .cl-cost { margin-left: 0; }
}
