/**
 * Recortar vídeo — crop studio (full-width).
 * Light default; follows html[data-theme="dark"].
 * Layout loosely OVC-inspired: top tools, stage, bottom transport + save.
 */

/* ---- Workspace shell ---- */
body.is-fullscreen .fs-workspace.vcrop-fs {
  --vc-bg: #eef1f6;
  --vc-app: #ffffff;
  --vc-line: #e2e8f0;
  --vc-text: var(--dica-ink, #0f172a);
  --vc-muted: var(--dica-muted, #64748b);
  --vc-faint: #94a3b8;
  --vc-accent: #fa5b0f;
  --vc-accent-2: #e04f0a;
  --vc-btn: #eef2f7;
  --vc-btn-hover: #e2e8f0;
  --vc-stage: #dce2ec;
  --vc-stage-inner: #0f172a;
  --vc-topbar: #f8fafc;
  --vc-bottom: #f8fafc;
  --vc-tool: #ffffff;
  --vc-tool-active: rgba(250, 91, 15, 0.12);
  --vc-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 32px rgba(15, 23, 42, 0.07);
  --vc-handle: #fff;
  --vc-dim: rgba(15, 23, 42, 0.52);

  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 12px 14px 16px !important;
  box-sizing: border-box;
  background: var(--vc-bg) !important;
  border-color: var(--vc-line) !important;
  color: var(--vc-text);
  min-height: min(78vh, 900px) !important;
  height: min(calc(100vh - 120px), 920px);
  overflow: hidden;
}

html[data-theme="dark"] body.is-fullscreen .fs-workspace.vcrop-fs {
  --vc-bg: #0b0e14;
  --vc-app: #151922;
  --vc-line: #2a3140;
  --vc-text: #e8eef6;
  --vc-muted: rgba(232, 238, 246, 0.62);
  --vc-faint: rgba(232, 238, 246, 0.42);
  --vc-btn: rgba(255, 255, 255, 0.08);
  --vc-btn-hover: rgba(255, 255, 255, 0.14);
  --vc-stage: #080b11;
  --vc-stage-inner: #000;
  --vc-topbar: #1a2030;
  --vc-bottom: #1a2030;
  --vc-tool: rgba(255, 255, 255, 0.06);
  --vc-tool-active: rgba(250, 91, 15, 0.22);
  --vc-shadow: none;
  --vc-handle: #fff;
  --vc-dim: rgba(0, 0, 0, 0.62);
  background: var(--vc-bg) !important;
  border-color: #0a0e14 !important;
}

.vcrop-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: min(70vh, 860px);
  width: 100%;
  min-width: 0;
  background: var(--vc-app);
  color: var(--vc-text);
  border-radius: 18px;
  border: 1px solid var(--vc-line);
  box-shadow: var(--vc-shadow);
  overflow: hidden;
  position: relative;
}

.vcrop-app * {
  box-sizing: border-box;
}

.vcrop-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---- Top bar ---- */
.vcrop-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--vc-line);
  background: var(--vc-topbar);
  min-height: 52px;
}

.vcrop-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.vcrop-brand {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--vc-accent);
  color: #fff;
  flex-shrink: 0;
}

.vcrop-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.vcrop-brand-text strong {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.vcrop-file-meta {
  font-size: 0.72rem;
  color: var(--vc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(220px, 28vw);
}

/* Mode selector: Cortar | Recortar */
.vcrop-modes {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 12px;
  background: var(--vc-btn);
  border: 1px solid var(--vc-line);
}

.vcrop-mode {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--vc-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.vcrop-mode:hover:not(:disabled) {
  color: var(--vc-text);
  background: rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .vcrop-mode:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.vcrop-mode.is-active {
  background: var(--vc-accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(250, 91, 15, 0.35);
}

.vcrop-mode:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vcrop-mode:focus-visible,
.vcrop-btn:focus-visible,
.vcrop-play:focus-visible,
.vcrop-icon-btn:focus-visible,
.vcrop-tool:focus-visible {
  outline: 2px solid var(--vc-accent);
  outline-offset: 2px;
}

.vcrop-mode-ico {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.95;
}

/* Aspect tools + crop box only in crop mode */
.vcrop-app[data-mode="trim"] .vcrop-aspect-tools {
  display: none !important;
}

.vcrop-app[data-mode="trim"] .vcrop-overlay {
  display: none !important;
  pointer-events: none !important;
}

/* Trim handles only in Cortar mode (Recortar does not change duration) */
.vcrop-app[data-mode="crop"] .vcrop-thandle,
.vcrop-app[data-mode="crop"] .vcrop-shade,
.vcrop-app[data-mode="crop"] .vcrop-selection,
.vcrop-app[data-mode="crop"] .vcrop-playhead {
  display: none !important;
}

.vcrop-app[data-mode="crop"] .vcrop-time-fields,
.vcrop-app[data-mode="crop"] .vcrop-dur-chip,
.vcrop-app[data-mode="crop"] #vtool-set-in,
.vcrop-app[data-mode="crop"] #vtool-set-out,
.vcrop-app[data-mode="crop"] #vtool-loop {
  opacity: 0.45;
  pointer-events: none;
}

/* Audio-only file: hide video frame, show placeholder */
.vcrop-app.is-audio .vcrop-video-frame {
  display: none;
}
.vcrop-app.is-audio .vcrop-audio-ph {
  display: flex !important;
}
.vcrop-app.is-audio .vcrop-mode[data-mode="crop"],
.vcrop-app.is-audio .vcrop-aspect-tools {
  opacity: 0.4;
  pointer-events: none;
}

.vcrop-app[data-mode="trim"] .vcrop-hints-crop,
.vcrop-app[data-mode="crop"] .vcrop-hints-trim {
  display: none;
}

.vcrop-audio-ph {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  color: var(--vc-muted);
  font-size: 0.9rem;
  text-align: center;
}
.vcrop-audio-ph svg {
  opacity: 0.75;
  color: var(--vc-accent-2, #ff8a3d);
}
.vcrop-audio-ph p {
  margin: 0;
  max-width: 320px;
  line-height: 1.4;
}

/* Aspect tools (OVC-style horizontal strip) */
.vcrop-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 0;
}

.vcrop-tools-sep {
  width: 1px;
  height: 28px;
  background: var(--vc-line);
  margin: 0 4px;
  flex-shrink: 0;
}

.vcrop-tool {
  appearance: none;
  border: 1px solid var(--vc-line);
  background: var(--vc-tool);
  color: var(--vc-text);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 52px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.vcrop-tool:hover:not(:disabled) {
  background: var(--vc-btn-hover);
}

.vcrop-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vcrop-tool.is-active {
  border-color: var(--vc-accent);
  background: var(--vc-tool-active);
  color: var(--vc-accent-2);
  box-shadow: inset 0 0 0 1px var(--vc-accent);
}

.vcrop-tool-ico {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
}

.vcrop-tool-label {
  letter-spacing: 0.01em;
}

.vcrop-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Buttons */
.vcrop-btn {
  appearance: none;
  border: 1px solid var(--vc-line);
  background: var(--vc-btn);
  color: var(--vc-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.vcrop-btn:hover:not(:disabled) {
  background: var(--vc-btn-hover);
}

.vcrop-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vcrop-btn-ghost {
  background: transparent;
}

.vcrop-btn-primary {
  background: var(--vc-accent);
  border-color: var(--vc-accent);
  color: #fff;
  min-width: 96px;
}

.vcrop-btn-primary:hover:not(:disabled) {
  background: var(--vc-accent-2);
  border-color: var(--vc-accent-2);
}

/* ---- Stage ---- */
.vcrop-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--vc-stage);
}

.vcrop-drop {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px;
  padding: 28px 20px;
  border: 2px dashed var(--vc-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

html[data-theme="dark"] .vcrop-drop {
  background: rgba(0, 0, 0, 0.28);
}

.vcrop-drop:hover,
.vcrop-drop:focus-visible,
.vcrop-drop.is-dragover {
  border-color: var(--vc-accent);
  background: rgba(250, 91, 15, 0.06);
}

.vcrop-drop-icon {
  color: var(--vc-accent);
  opacity: 0.9;
}

.vcrop-drop h3 {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.vcrop-drop p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--vc-muted);
  max-width: 320px;
}

.vcrop-drop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.vcrop-drop-chips span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--vc-btn);
  color: var(--vc-muted);
  border: 1px solid var(--vc-line);
}

.vcrop-drop-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--vc-accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
}

.vcrop-app.is-empty .vcrop-editor {
  display: none !important;
}

.vcrop-app:not(.is-empty) .vcrop-drop {
  display: none !important;
}

.vcrop-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.vcrop-editor[hidden] {
  display: none !important;
}

.vcrop-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 4px;
  overflow: hidden;
}

.vcrop-video-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  background: var(--vc-stage-inner);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.vcrop-video-frame video {
  display: block;
  max-width: min(100%, 960px);
  max-height: min(52vh, 520px);
  width: auto;
  height: auto;
  background: #000;
  vertical-align: top;
}

/* Crop overlay sits on video element bounds */
.vcrop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.vcrop-box {
  position: absolute;
  border: 2px solid var(--vc-accent);
  box-shadow: 0 0 0 9999px var(--vc-dim);
  border-radius: 2px;
  pointer-events: auto;
  cursor: move;
  outline: none;
  touch-action: none;
}

.vcrop-box:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.vcrop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.33%, rgba(255, 255, 255, 0.28) 33.33%, rgba(255, 255, 255, 0.28) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent 66.66%, rgba(255, 255, 255, 0.28) 66.66%, rgba(255, 255, 255, 0.28) calc(66.66% + 1px), transparent calc(66.66% + 1px)),
    linear-gradient(to bottom, transparent 33.33%, rgba(255, 255, 255, 0.28) 33.33%, rgba(255, 255, 255, 0.28) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent 66.66%, rgba(255, 255, 255, 0.28) 66.66%, rgba(255, 255, 255, 0.28) calc(66.66% + 1px), transparent calc(66.66% + 1px));
  opacity: 0.85;
}

.vcrop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--vc-handle);
  border: 2px solid var(--vc-accent);
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  z-index: 3;
  pointer-events: auto;
}

.vcrop-handle[data-handle="nw"] { top: -6px; left: -6px; cursor: nwse-resize; }
.vcrop-handle[data-handle="ne"] { top: -6px; right: -6px; cursor: nesw-resize; }
.vcrop-handle[data-handle="sw"] { bottom: -6px; left: -6px; cursor: nesw-resize; }
.vcrop-handle[data-handle="se"] { bottom: -6px; right: -6px; cursor: nwse-resize; }
.vcrop-handle[data-handle="n"]  { top: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.vcrop-handle[data-handle="s"]  { bottom: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.vcrop-handle[data-handle="w"]  { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.vcrop-handle[data-handle="e"]  { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }

.vcrop-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 6px 16px 8px;
  flex: 0 0 auto;
  min-height: 28px;
}

.vcrop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vcrop-chips .mtool-chip,
.vcrop-chips span {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--vc-btn);
  color: var(--vc-muted);
  border: 1px solid var(--vc-line);
}

.vcrop-hint {
  font-size: 0.8rem;
  color: var(--vc-muted);
  margin-left: auto;
}

.vcrop-hint strong {
  color: var(--vc-text);
  font-weight: 700;
}

/* ---- Bottom bar ---- */
.vcrop-bottombar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--vc-line);
  background: var(--vc-bottom);
  min-height: 64px;
}

.vcrop-transport {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.vcrop-play {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--vc-line);
  background: var(--vc-btn);
  color: var(--vc-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.vcrop-play:hover:not(:disabled) {
  background: var(--vc-btn-hover);
}

.vcrop-play:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vcrop-play.is-playing .vcrop-ico-play {
  display: none;
}

.vcrop-play.is-playing .vcrop-ico-pause {
  display: block !important;
}

.vcrop-timebox {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--vc-text);
  background: var(--vc-btn);
  border: 1px solid var(--vc-line);
  border-radius: 10px;
  padding: 8px 12px;
  white-space: nowrap;
}

.vcrop-clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--vc-muted);
  white-space: nowrap;
}
.vcrop-clock strong {
  color: var(--vc-text);
  font-weight: 700;
}
.vcrop-clock-sep {
  margin: 0 3px;
  color: var(--vc-faint);
}

.vcrop-icon-btn {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--vc-line);
  background: var(--vc-btn);
  color: var(--vc-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.vcrop-icon-btn:hover:not(:disabled) {
  background: var(--vc-btn-hover);
}
.vcrop-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.vcrop-icon-btn.is-active {
  background: var(--vc-tool-active);
  border-color: rgba(250, 91, 15, 0.45);
  color: var(--vc-accent-2);
}
.vcrop-icon-btn svg {
  display: block;
}

.vcrop-time-fields {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.vcrop-time-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
.vcrop-time-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vc-faint);
  padding-left: 2px;
}
.vcrop-time-input {
  width: 78px;
  border: 1px solid var(--vc-line);
  border-radius: 9px;
  background: var(--vc-btn);
  color: var(--vc-text);
  font: inherit;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  padding: 7px 4px;
  outline: none;
}
.vcrop-time-input:focus {
  border-color: var(--vc-accent, #fa5b0f);
  box-shadow: 0 0 0 2px rgba(250, 91, 15, 0.25);
}
.vcrop-time-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vcrop-time-sep {
  color: var(--vc-faint);
  margin: 0 2px;
  align-self: center;
  padding-top: 12px;
}

.vcrop-dur-chip {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--vc-accent-2);
  background: var(--vc-tool-active);
  border: 1px solid rgba(250, 91, 15, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.vcrop-format-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  min-width: 0;
}
.vcrop-format-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vc-faint);
  padding-left: 2px;
}
.vcrop-format {
  appearance: none;
  border: 1px solid var(--vc-line);
  border-radius: 10px;
  background: var(--vc-btn);
  color: var(--vc-text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 28px 8px 10px;
  cursor: pointer;
  outline: none;
  max-width: 160px;
  background-image: linear-gradient(45deg, transparent 50%, var(--vc-faint) 50%),
    linear-gradient(135deg, var(--vc-faint) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.vcrop-format:focus {
  border-color: var(--vc-accent, #fa5b0f);
  box-shadow: 0 0 0 2px rgba(250, 91, 15, 0.25);
}
.vcrop-format:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.vcrop-format option,
.vcrop-format optgroup {
  color: #111;
  background: #fff;
}

.vcrop-hints {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 0.72rem;
  color: var(--vc-faint);
  background: var(--vc-bottom);
  border-top: 0;
}
.vcrop-hints kbd {
  font-family: inherit;
  font-size: 0.68rem;
  background: var(--vc-btn);
  border: 1px solid var(--vc-line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  margin: 0 1px;
}
@media (hover: none) {
  .vcrop-hints {
    display: none;
  }
}

/* ---- Filmstrip timeline ---- */
.vcrop-timeline {
  flex: 0 0 auto;
  padding: 0 14px 6px;
  background: var(--vc-bottom);
  border-top: 1px solid var(--vc-line);
}

.vcrop-timeline[hidden] {
  display: none !important;
}

.vcrop-strip-outer {
  position: relative;
  /* room for handle grips + time bubbles so they are not clipped */
  padding: 22px 10px 4px;
}

.vcrop-strip {
  position: relative;
  height: 64px;
  border-radius: 10px;
  /* visible: trim handles sit on the selection edges and must not be clipped */
  overflow: visible;
  background: #0f172a;
  border: 1px solid var(--vc-line);
  touch-action: none;
  user-select: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .vcrop-strip {
  background: #06080d;
}

.vcrop-film {
  display: flex;
  height: 100%;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}
.vcrop-slot {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  background-size: 200% 100%;
  animation: vcrop-shimmer 1.6s linear infinite;
}

.vcrop-slot:last-child {
  border-right: none;
}

.vcrop-slot canvas,
.vcrop-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes vcrop-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.vcrop-strip-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: 10px;
}

.vcrop-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.62);
  z-index: 1;
  pointer-events: none;
}

.vcrop-shade-l {
  left: 0;
  border-radius: 9px 0 0 9px;
}

.vcrop-shade-r {
  right: 0;
  border-radius: 0 9px 9px 0;
}

.vcrop-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  border-top: 3px solid var(--vc-accent);
  border-bottom: 3px solid var(--vc-accent);
  background: rgba(250, 91, 15, 0.06);
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
}

/* Trim handles: sit INSIDE the strip on selection edges (OVC-style) */
.vcrop-thandle {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 18px;
  background: var(--vc-accent);
  z-index: 6;
  pointer-events: auto;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* Grip lines */
.vcrop-thandle::after {
  content: "";
  width: 2px;
  height: 26px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 5px 0 0 rgba(255, 255, 255, 0.92);
  margin-right: 5px;
}

/* Left handle flush at selection start (inside) */
.vcrop-thandle-l {
  border-radius: 8px 0 0 8px;
  transform: none;
}

/* Right handle flush at selection end (inside, anchored on right edge) */
.vcrop-thandle-r {
  border-radius: 0 8px 8px 0;
  transform: translateX(-100%);
}

.vcrop-thandle:hover,
.vcrop-thandle.is-dragging {
  background: var(--vc-accent-2);
  width: 20px;
}

.vcrop-thandle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Time bubbles always readable when video is loaded */
.vcrop-app:not(.is-empty) .vcrop-tbubble {
  opacity: 1;
}

.vcrop-tbubble {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  opacity: 0.92;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: opacity 0.12s ease;
}

.vcrop-thandle.is-dragging .vcrop-tbubble,
.vcrop-thandle:hover .vcrop-tbubble,
.vcrop-thandle:focus-visible .vcrop-tbubble {
  opacity: 1;
  background: var(--vc-accent);
}

.vcrop-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.vcrop-playhead::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #fff;
}

.vcrop-timescale {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 0;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--vc-faint);
}

.vcrop-bottom-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.vcrop-status {
  font-size: 0.78rem;
  color: var(--vc-muted);
  max-width: min(240px, 30vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vcrop-status.is-error {
  color: #b91c1c;
}

html[data-theme="dark"] .vcrop-status.is-error {
  color: #fca5a5;
}

/* Progress / result reuse media-tools */
.vcrop-progress {
  margin: 0 14px 10px;
}

.vcrop-app .mtool-progress-wrap {
  display: none;
}

.vcrop-app.is-busy .mtool-progress-wrap.vcrop-progress {
  display: flex;
}

.vcrop-result {
  margin: 0 14px 12px;
  display: none;
}

.vcrop-result.is-visible {
  display: block;
}

.vcrop-result video {
  display: block;
  width: 100%;
  max-height: 220px;
  margin-top: 10px;
  border-radius: 10px;
  background: #000;
}

.vcrop-app.is-busy .vcrop-tool,
.vcrop-app.is-busy .vcrop-mode,
.vcrop-app.is-busy .vcrop-box {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .vcrop-slot {
    animation: none;
  }

  .vcrop-app *,
  .vcrop-app *::before,
  .vcrop-app *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.vcrop-app.is-busy .vcrop-box {
  opacity: 0.85;
}

/* Success bar inside app */
.vcrop-app .mtool-success {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  body.is-fullscreen .fs-workspace.vcrop-fs {
    height: auto;
    min-height: min(88vh, 960px) !important;
    max-height: none;
  }

  .vcrop-app {
    min-height: min(82vh, 900px);
    height: auto;
  }

  .vcrop-topbar {
    justify-content: space-between;
  }

  .vcrop-modes {
    order: 2;
  }

  .vcrop-tools {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 4px;
  }

  .vcrop-video-frame video {
    max-height: min(36vh, 380px);
  }

  .vcrop-strip {
    height: 48px;
  }

  .vcrop-bottombar {
    flex-direction: column;
    align-items: stretch;
  }

  .vcrop-transport {
    flex-wrap: wrap;
  }

  .vcrop-bottom-actions {
    margin-left: 0;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .vcrop-format {
    max-width: none;
    width: 100%;
  }

  .vcrop-format-wrap {
    flex: 1 1 140px;
  }

  .vcrop-btn-primary {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .vcrop-tool {
    min-width: 44px;
    padding: 5px 7px;
  }

  .vcrop-tool-label {
    font-size: 0.65rem;
  }

  .vcrop-brand-text strong {
    font-size: 0.82rem;
  }

  .vcrop-file-meta {
    max-width: 120px;
  }

  .vcrop-hint {
    width: 100%;
    margin-left: 0;
  }
}
