/* Rotate/crop/speed, merge videos, merge audio, noise remover and subtitles (only loaded on those pages). */
.sp-chip { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font: 600 0.82rem var(--text); cursor: pointer; }
.sp-chip:hover { border-color: var(--signal); background: var(--signal-soft); }
.sp-chip.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.sp-chip:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.mt-hint { margin: 4px 0 0; color: var(--slate); font-size: 0.85rem; }

/* ---------- Rotate / crop / speed ---------- */
.vt-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 22px; align-items: start; }
.vt-editor[hidden] { display: none; }
.vt-stage-col { min-width: 0; display: grid; gap: 10px; justify-items: center; }
.vt-stage { position: relative; max-width: 100%; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; }
.vt-stage canvas { display: block; width: 100%; height: 100%; }
.vt-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5); cursor: move; background-image: linear-gradient(rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.35)), linear-gradient(rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.35)), linear-gradient(90deg, rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.35)), linear-gradient(90deg, rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.35)); background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%; background-position: 0 33.3%, 0 66.6%, 33.3% 0, 66.6% 0; background-repeat: no-repeat; }
.vt-crop[hidden] { display: none; }
.vt-h { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--signal); }
.vt-h[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; } .vt-h[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.vt-h[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; } .vt-h[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.vt-transport { display: flex; align-items: center; gap: 10px; width: 100%; }
.vt-transport input[type="range"] { flex: 1; min-width: 0; }
.vt-transport .btn[aria-pressed="true"] { border-color: var(--signal); background: var(--signal-soft); }
.vt-time { flex: none; color: var(--slate); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.vt-panel { display: grid; gap: 10px; min-width: 0; }
.vt-sec { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 0 14px; }
.vt-sec > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.vt-sec[open] { padding-bottom: 14px; }
.vt-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.vt-buttons .btn[aria-pressed="true"] { border-color: var(--signal); background: var(--signal-soft); }
.vt-slider, .vt-trim label { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.88rem; font-weight: 600; }
.vt-slider input, .vt-trim input { flex: 1; min-width: 0; }
.vt-trim output, .vt-slider output { min-width: 56px; color: var(--slate); font-variant-numeric: tabular-nums; }
.vt-sec .checkbox { display: flex; margin-top: 10px; }
.vt-summary { margin: 10px 0 0; color: var(--slate); font-size: 0.88rem; }
.vt-done { display: grid; gap: 10px; }
.vt-done[hidden] { display: none; }
.vt-done video, .mt-result video { width: 100%; max-height: 50vh; border-radius: 10px; background: #000; }

/* ---------- Lists of files (merge video / audio) ---------- */
.mt-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.mt-item { display: grid; grid-template-columns: auto 72px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); }
.mt-item.is-audio { grid-template-columns: auto minmax(0, 1fr) auto; }
.mt-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--mist); font-weight: 700; font-size: 0.85rem; }
.mt-thumb { width: 72px; height: 44px; border-radius: 6px; background: #000; object-fit: contain; }
.mt-name { min-width: 0; }
.mt-name strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.92rem; }
.mt-name small { color: var(--slate); }
.mt-item-actions { display: flex; gap: 2px; }
.mt-icon { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--slate); cursor: pointer; }
.mt-icon:hover { background: var(--mist); color: var(--ink); }
.mt-icon:disabled { opacity: 0.3; cursor: default; }
.mt-icon svg { width: 18px; height: 18px; }
.mt-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
.ma .checkbox, .nr .checkbox { display: flex; margin: 0 0 8px; }
.mt-options .field { margin-bottom: 10px; }
.mt-add { margin-bottom: 14px; }
.mt-result { display: grid; gap: 10px; margin-top: 12px; }
.mt-result[hidden] { display: none; }
.mt-result audio { width: 100%; }

/* ---------- Noise remover ---------- */
.nr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nr-compare figure { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.nr-compare figcaption { margin-bottom: 8px; font-weight: 700; }
.nr-compare canvas { display: block; width: 100%; height: 70px; margin-bottom: 8px; border-radius: 6px; background: var(--mist); }
.nr-compare audio, .nr-compare video { width: 100%; }
.nr-compare video { max-height: 240px; border-radius: 8px; background: #000; }

/* ---------- Subtitles ---------- */
.st-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 22px; align-items: start; }
.st-editor[hidden] { display: none; }
.st-player { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.st-player video { display: block; width: 100%; max-height: 62vh; }
.st-overlay { position: absolute; inset: 0; pointer-events: none; }
.st-side { display: grid; gap: 12px; min-width: 0; }
.st-source { display: flex; flex-wrap: wrap; gap: 6px; }
.st-cues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.st-cue { display: grid; grid-template-columns: 92px minmax(0, 1fr) 28px; gap: 6px; align-items: start; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-control); }
.st-cue.is-now { border-color: var(--signal); background: var(--signal-soft); }
.st-cue input[type="text"] { padding: 4px 6px; font: 0.8rem var(--mono); }
.st-cue textarea { min-height: 52px; padding: 6px 8px; font-size: 0.9rem; resize: vertical; }
.st-times { display: grid; gap: 4px; }
.st-style { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.st-style .field { margin-bottom: 10px; }

@media (max-width: 900px) {
    .vt-editor, .st-editor { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .mt-item { grid-template-columns: auto minmax(0, 1fr) auto; }
    .mt-thumb { display: none; }
    .nr-compare { grid-template-columns: 1fr; }
    .st-cue { grid-template-columns: minmax(0, 1fr) 28px; }
    .st-times { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
