/* 동영상 자르기 */

.vt-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-sub);
  text-align: center;
}

.vt-editor { margin-top: 1.2rem; }

/* ── 미리보기 ── */
.vt-stage {
  position: relative;
  background: #14101c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.vt-stage video {
  display: block;
  width: 100%;
  max-height: 52vh;
  background: #14101c;
}
.vt-stage video[hidden] { display: none; }
.vt-nopreview {
  padding: 2.2rem 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}
.vt-nopreview[hidden] { display: none; }

/* ── 재생 조작 ── */
.vt-transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.vt-tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1rem;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.vt-tbtn:hover { border-color: var(--primary); }
.vt-mark {
  min-height: 44px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.vt-mark:hover { border-color: var(--primary); }

.vt-meta {
  padding: 0 12px;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}
.vt-meta[hidden] { display: none; }

.vt-clock {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.9rem;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

/* ── 타임라인 ──
   손잡이가 트랙 밖으로 반쯤 나오므로 좌우에 여유를 준다. */
.vt-timeline {
  padding: 1.1rem 12px 0.4rem;
  touch-action: none;   /* 드래그 중 화면이 같이 스크롤되지 않게 */
}
.vt-track {
  position: relative;
  height: 46px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* 키프레임 눈금 — 여기에 맞추면 무손실이라는 뜻 */
.vt-keys { position: absolute; inset: 0; overflow: hidden; border-radius: 10px; }
.vt-keys i {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--primary) 22%, transparent);
}

.vt-sel {
  position: absolute;
  top: -1px;
  bottom: -1px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid var(--primary);
  border-radius: 6px;
}

.vt-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 2px;
  background: var(--error);
  border-radius: 2px;
  pointer-events: none;
}

.vt-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 62px;
  margin-left: -9px;
  transform: translateY(-50%);
  background: var(--primary-solid);
  border: none;
  border-radius: 6px;
  cursor: ew-resize;
  touch-action: none;
}
/* 보이는 크기는 그대로 두고 손가락이 닿는 폭만 44px로 넓힌다 */
.vt-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -13px;
  right: -13px;
}
/* 손잡이 가운데 홈 — 잡는 곳이라는 표시 */
.vt-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 18px;
  margin: -9px 0 0 -1px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}
.vt-handle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ── 수치 ── */
.vt-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding: 0 12px;
  margin-top: 0.5rem;
}
.vt-readout > div { display: flex; align-items: baseline; gap: 0.4rem; }
.vt-rl { font-size: 0.78rem; color: var(--text-sub); }
.vt-readout b {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* ── 스냅 토글 ── */
.vt-snap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 12px;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.vt-snap input { width: 18px; height: 18px; accent-color: var(--primary); }
.vt-snap-hint {
  flex: 1 1 100%;
  padding-left: 26px;
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* ── 출력 옵션 (해상도 축소 · 소리 제거) ── */
.vt-opts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.88rem;
}
.vt-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.vt-opt select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.85rem;
}
.vt-opt-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ── 무손실 / 재인코딩 판정 ── */
.vt-verdict {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin: 0.9rem 0 0;
  border-radius: 10px;
  border: 1px solid transparent;
}
.vt-verdict[data-state='lossless'] {
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}
.vt-verdict[data-state='reencode'] {
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
}
.vt-badge {
  flex: 0 0 auto;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
}
.vt-verdict[data-state='lossless'] .vt-badge { background: var(--success); }
.vt-verdict[data-state='reencode'] .vt-badge { background: var(--warning); }
.vt-verdict-desc { font-size: 0.83rem; line-height: 1.55; color: var(--text-sub); }

/* ── 진행·결과 ── */
.vt-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}
.vt-progress[hidden] { display: none; }
.vt-bar {
  flex: 1;
  height: 8px;
  background: var(--chip);
  border-radius: 999px;
  overflow: hidden;
}
.vt-bar-fill {
  height: 100%;
  width: 0;
  background: var(--primary-solid);
  transition: width 0.2s;
}

.vt-result {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}
.vt-result[hidden] { display: none; }
.vt-outsize { font-size: 0.85rem; color: var(--text-sub); }

@media (max-width: 480px) {
  .vt-stage video { max-height: 40vh; }
  .vt-readout { gap: 0.9rem; }
  .vt-handle { width: 22px; margin-left: -11px; }
  .vt-handle::after { left: -11px; right: -11px; }
}
