.vm-btn-icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vm-workspace {
  scroll-margin-top: 1rem;
}

.vm-drop-card,
.vm-clips-card,
.vm-preview-card,
.vm-settings-card,
.vm-progress,
.vm-result {
  border: 1px solid var(--border-color, #dce3ee);
}

.vm-drop-card {
  padding: .75rem;
}

.vm-dropzone {
  min-height: 20rem;
  padding: 2.5rem 1rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .75rem;
  text-align: center;
  border: 2px dashed color-mix(in srgb, var(--primary, #2f66ec) 28%, var(--border-color, #dce3ee));
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--primary, #2f66ec) 4%, var(--surface, #fff));
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
  cursor: pointer;
}

.vm-dropzone:is(:hover, :focus-visible, .is-dragging) {
  border-color: var(--primary, #2f66ec);
  background: color-mix(in srgb, var(--primary, #2f66ec) 8%, var(--surface, #fff));
  outline: none;
}

.vm-dropzone.is-dragging {
  transform: scale(.995);
}

.vm-dropzone h2,
.vm-section-head h2,
.vm-settings-card h2 {
  margin: 0;
}

.vm-dropzone p,
.vm-section-head p,
.vm-preview-label {
  margin: 0;
  color: var(--muted, #65748b);
}

.vm-drop-icon {
  width: 4.5rem;
  height: 4.5rem;
  display: grid;
  place-items: center;
  color: var(--primary, #2f66ec);
  border-radius: 1.4rem;
  background: color-mix(in srgb, var(--primary, #2f66ec) 12%, transparent);
}

.vm-drop-icon svg {
  width: 2.8rem;
  height: 2.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vm-editor {
  display: grid;
  gap: 1rem;
}

.vm-editor[hidden] {
  display: none;
}

.vm-compatibility {
  margin: 0;
  padding: .8rem 1rem;
  border-radius: .9rem;
  color: var(--muted, #65748b);
  background: color-mix(in srgb, var(--surface-raised, #fff) 92%, var(--primary, #2f66ec));
  border: 1px solid var(--border-color, #dce3ee);
}

.vm-compatibility.is-ready {
  color: #14753b;
  border-color: color-mix(in srgb, #22a559 45%, var(--border-color, #dce3ee));
}

.vm-compatibility.is-error {
  color: #b42318;
  border-color: color-mix(in srgb, #d92d20 45%, var(--border-color, #dce3ee));
}

.vm-clips-card,
.vm-preview-card,
.vm-settings-card,
.vm-progress,
.vm-result {
  padding: 1rem;
}

.vm-section-head {
  display: grid;
  gap: .85rem;
  margin-bottom: 1rem;
}

.vm-section-head > div {
  display: grid;
  gap: .3rem;
}

.vm-add-label,
.vm-choose-label,
.vm-preview-head .btn {
  min-height: 3rem;
  justify-content: center;
}

.vm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

.vm-summary span {
  padding: .48rem .72rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #2f66ec) 9%, transparent);
  color: var(--muted, #65748b);
}

.vm-summary strong {
  color: var(--text, #172033);
  margin-inline-start: .25rem;
}

.vm-clip-list {
  display: grid;
  gap: .75rem;
}

.vm-clip {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: .8rem;
  padding: .75rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: var(--surface, #fff);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.vm-clip.is-active {
  border-color: var(--primary, #2f66ec);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2f66ec) 16%, transparent);
}

.vm-clip.is-dragging {
  opacity: .55;
  transform: scale(.99);
}

.vm-clip.is-drop-target {
  border-color: var(--primary, #2f66ec);
}

.vm-thumb {
  width: 5rem;
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: .75rem;
  overflow: hidden;
  padding: 0;
  background: #09111f;
  position: relative;
  cursor: pointer;
}

.vm-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.vm-thumb::after {
  content: '▶';
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding-inline-start: .12rem;
  border-radius: 999px;
  color: #fff;
  background: rgb(0 0 0 / 55%);
  font-size: .75rem;
}

.vm-clip-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: .5rem;
}

.vm-clip-copy {
  min-width: 0;
}

.vm-clip-copy strong,
.vm-clip-copy span {
  display: block;
}

.vm-clip-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vm-clip-copy span {
  margin-top: .15rem;
  color: var(--muted, #65748b);
  font-size: .88rem;
}

.vm-clip-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}

.vm-icon-btn {
  min-width: 2.7rem;
  min-height: 2.7rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line, var(--border, #dce3ee));
  border-radius: .75rem;
  color: var(--text, #172033);
  background: var(--panel-strong, var(--surface, #fff));
  cursor: pointer;
}

.vm-icon-btn:hover:not(:disabled) {
  border-color: var(--primary, #2f66ec);
  color: var(--primary, #2f66ec);
}

.vm-icon-btn:disabled {
  opacity: .38;
  cursor: default;
}

.vm-icon-btn.is-danger:hover:not(:disabled) {
  color: #d92d20;
  border-color: #d92d20;
}

.vm-icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vm-preview-stage {
  --vm-preview-aspect: 16 / 9;
  --vm-preview-vh-width: 117.3333vh;
  --vm-preview-rem-width: 81.7778rem;
  width: min(100%, var(--vm-preview-vh-width), var(--vm-preview-rem-width));
  margin-inline: auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 1rem;
  background: #050a13;
  aspect-ratio: var(--vm-preview-aspect);
}

.vm-preview-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--vm-preview-fit, cover);
  background: #000;
}

.vm-preview-placeholder {
  display: none;
  color: #718096;
}

.vm-preview-placeholder svg {
  width: 4rem;
  height: 4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}

.vm-preview-stage.is-empty video {
  display: none;
}

.vm-preview-stage.is-empty .vm-preview-placeholder {
  display: block;
}

.vm-preview-label {
  margin-top: .7rem;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vm-settings-card h2 {
  margin-bottom: 1rem;
}

.vm-settings-grid {
  display: grid;
  gap: .9rem;
}

.vm-field {
  display: grid;
  gap: .45rem;
  min-width: 0;
}

.vm-field > span {
  font-weight: 700;
}

.vm-field select {
  width: 100%;
  min-height: 3.2rem;
  padding: .65rem .8rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: .85rem;
  color: var(--text, #172033);
  background: var(--surface, #fff);
  font: inherit;
}

.vm-action-dock {
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
  padding: .8rem;
  border: 1px solid var(--border-color, #dce3ee);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  box-shadow: 0 12px 32px rgb(15 23 42 / 9%);
}

.vm-action-dock .btn {
  min-height: 3.3rem;
  justify-content: center;
}

.vm-progress {
  display: grid;
  gap: .7rem;
}

.vm-progress[hidden],
.vm-result[hidden] {
  display: none;
}

.vm-progress-row,
.vm-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.vm-progress-track {
  height: .75rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #2f66ec) 12%, var(--border-color, #dce3ee));
}

.vm-progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, #2f66ec), #6a5cff);
  transition: width .2s ease;
}

.vm-result > div {
  display: grid;
  gap: .2rem;
}

.vm-result span {
  color: var(--muted, #65748b);
}

html[dir="rtl"] .vm-btn-icon,
html[dir="rtl"] .vm-icon-btn svg {
  direction: ltr;
}

@media (min-width: 42rem) {
  .vm-drop-card,
  .vm-clips-card,
  .vm-preview-card,
  .vm-settings-card,
  .vm-progress,
  .vm-result {
    padding: 1.35rem;
  }

  .vm-section-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .vm-clip {
    grid-template-columns: 6.5rem minmax(0, 1fr) auto;
    align-items: center;
  }

  .vm-thumb {
    width: 6.5rem;
    aspect-ratio: 16 / 9;
  }

  .vm-clip-actions {
    grid-template-columns: repeat(3, 2.8rem);
  }

  .vm-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vm-action-dock {
    grid-template-columns: minmax(14rem, 1fr) auto;
  }
}

@media (min-width: 64rem) {
  .vm-settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vm-clips-card,
  .vm-preview-card,
  .vm-settings-card {
    padding: 1.6rem;
  }
}

@media (max-width: 41.99rem) {
  .vm-hero .hero-actions,
  .vm-hero .hero-actions .btn {
    width: 100%;
  }

  .vm-hero .hero-actions .btn {
    justify-content: center;
  }

  .vm-action-dock {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }

  .vm-action-dock .btn {
    min-width: 0;
    padding-inline: .65rem;
    font-size: .9rem;
  }

  .vm-result {
    align-items: stretch;
    flex-direction: column;
  }

  .vm-result .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vm-dropzone,
  .vm-clip,
  .vm-progress-track span {
    transition: none;
  }
}
