/* Free online video editor: it fills the window under the site's header; on a phone the parts stack. */
.wbx-wrap {
  position: relative;
  height: calc(100vh - var(--hdr, 64px));
  height: calc(100dvh - var(--hdr, 64px));
  min-height: 600px;
  max-height: 1100px;
}
.ve {
  --ve-line: #e2e8f0;
  --ve-fg: #1e293b;
  --ve-fg2: #64748b;
  --ve-panel: #ffffff;
  --ve-bg: #f1f5f9;
  --ve-sel: #f59e0b;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--ve-bg);
  color: var(--ve-fg);
  font: 14px/1.4 var(--sans, Inter, system-ui, sans-serif);
  border-bottom: 1px solid var(--ve-line);
  overflow: hidden;
}
.ve.drag {
  outline: 3px dashed var(--sky, #0ea5e9);
  outline-offset: -3px;
}
.ve [hidden] {
  display: none !important;
}
.ve button {
  font: inherit;
}
.ve-hidden {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.ve-hidden video,
.ve-hidden audio {
  width: 2px;
  height: 2px;
}

/* ---- top bar */
.ve-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--ve-panel);
  border-bottom: 1px solid var(--ve-line);
}
.ve-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  margin-right: auto;
}
.ve-title h1 {
  margin: 0;
  font: 700 18px/1.2 var(--sans, Inter, system-ui, sans-serif);
  letter-spacing: -0.01em;
}
.ve-saved {
  color: var(--ve-fg2);
  font-size: 12.5px;
}
.ve-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ve .btn {
  padding: 8px 14px;
  font-size: 14px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}
.ve .ve-sm {
  padding: 6px 10px;
  font-size: 13px;
}
.ve-add {
  position: relative;
  cursor: pointer;
}
.ve-add input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.ve-ib {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid var(--ve-line);
  border-radius: 9px;
  background: var(--ve-panel);
  color: var(--ve-fg);
  cursor: pointer;
  font-weight: 600;
}
.ve-ib:hover:not(:disabled) {
  background: #f1f5f9;
}
.ve-ib:disabled {
  opacity: 0.4;
  cursor: default;
}
.ve-aspect-pick select {
  height: 36px;
  border: 1px solid var(--ve-line);
  border-radius: 9px;
  padding: 0 8px;
  background: var(--ve-panel);
  font: inherit;
  color: inherit;
}

/* ---- banners */
.ve-banner {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: #e0f2fe;
  border-bottom: 1px solid #bae6fd;
}
.ve-banner p {
  margin: 0;
  flex: 1 1 260px;
}
.ve-banner .tl-row {
  margin: 0;
}
.ve-warn {
  background: #fef3c7;
  border-color: #fde68a;
}
.ve-x-error {
  margin: 0;
  padding: 6px 14px;
  background: #fef2f2;
}

/* ---- the three panes */
.ve-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 290px;
}
.ve-bin,
.ve-insp {
  min-height: 0;
  overflow: auto;
  background: var(--ve-panel);
  padding: 10px 12px;
}
.ve-bin {
  border-right: 1px solid var(--ve-line);
}
.ve-insp {
  border-left: 1px solid var(--ve-line);
}
.ve-pane-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}
.ve-pane-h b,
.ve-pane-h h2 {
  font-size: 14px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ve-pane-h h2 {
  font-size: 18px;
}
.ve-pane .tl-field {
  margin-bottom: 10px;
}
.ve-pane .tl-meta {
  margin: 0 0 10px;
}
.ve-pane .tl-row {
  margin: 4px 0 10px;
  gap: 6px 14px;
}
.ve-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ve-two .tl-field {
  min-width: 0;
}
.ve-chips {
  flex-wrap: wrap;
  gap: 6px;
}
.ve-chips .chip-btn {
  padding: 5px 10px;
  font-size: 13px;
}
.ve-range span b {
  color: var(--ve-fg2);
  font-weight: 500;
}
.ve-color input[type='color'] {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--ve-line);
  border-radius: 8px;
  background: #fff;
}
.ve-pane-actions {
  flex-wrap: wrap;
}
.ve-keys-help {
  font-size: 12px;
}

/* ---- media list */
.ve-bin-list {
  display: grid;
  gap: 6px;
}
.ve-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--ve-line);
  border-radius: 9px;
  background: #fff;
  cursor: grab;
}
.ve-card.missing {
  border-style: dashed;
  background: #fffbeb;
  cursor: default;
}
.ve-thumb {
  width: 56px;
  height: 36px;
  border-radius: 6px;
  background: #334155 center / cover no-repeat;
}
.ve-t-audio {
  background: #16a34a
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h1M8 8v8M12 5v14M16 9v6M20 11v2'/%3E%3C/svg%3E")
    center / 22px no-repeat;
}
.ve-card-info {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}
.ve-card-info b,
.ve-card-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.ve-card-info span {
  color: var(--ve-fg2);
  font-size: 11.5px;
}
.ve-card .ve-ib {
  min-width: 30px;
  height: 30px;
  font-size: 18px;
}
.ve-bin-empty {
  text-align: center;
  padding: 18px 6px;
  border: 2px dashed var(--ve-line);
  border-radius: 12px;
}
.ve-bin-empty p {
  margin: 0 0 10px;
}

/* ---- preview */
.ve-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  color: #e2e8f0;
}
.ve-box {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 12px 12px 0;
}
.ve-box canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
  cursor: pointer;
}
.ve-box-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #94a3b8;
  pointer-events: none;
  text-align: center;
  padding: 16px;
}
.ve-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.ve-transport .ve-ib {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.ve-transport .ve-ib:hover:not(:disabled) {
  background: #334155;
}
.ve-transport .btn-line {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.ve-play {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--sky, #0ea5e9);
  color: #fff;
  cursor: pointer;
}
.ve-play span {
  display: grid;
}
.ve-play .ve-i-pause,
.ve-play.on .ve-i-play {
  display: none;
}
.ve-play.on .ve-i-pause {
  display: grid;
}
.ve-time {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #94a3b8;
}
.ve-time b {
  color: #fff;
  font-weight: 600;
}
.ve-spacer {
  flex: 1;
}

/* ---- timeline */
.ve-tl {
  flex: 0 0 auto;
  background: var(--ve-panel);
  border-top: 1px solid var(--ve-line);
  min-width: 0;
}
.ve-tl-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ve-line);
}
.ve-tl-bar .ve-ib {
  min-width: 30px;
  height: 30px;
}
.ve-tl-bar input[type='range'] {
  width: 130px;
  accent-color: var(--sky, #0ea5e9);
}
.ve-tl-bar .tl-check {
  margin: 0;
}
.ve-tl-body {
  display: flex;
  min-width: 0;
}
.ve-heads {
  flex: 0 0 52px;
  display: grid;
  grid-template-rows: 22px 58px 34px 42px;
  border-right: 1px solid var(--ve-line);
  font-size: 11px;
  font-weight: 600;
  color: var(--ve-fg2);
  background: #f8fafc;
}
.ve-heads span {
  display: flex;
  align-items: center;
  padding-left: 8px;
  border-bottom: 1px solid var(--ve-line);
}
.ve-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
.ve-inner {
  position: relative;
  min-width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.ve-ruler {
  position: relative;
  height: 22px;
  border-bottom: 1px solid var(--ve-line);
  cursor: col-resize;
  touch-action: none;
  overflow: hidden;
}
.ve-ruler span {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 3px 0 0 4px;
  border-left: 1px solid #cbd5e1;
  font-size: 10px;
  color: var(--ve-fg2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ve-lane {
  position: relative;
  border-bottom: 1px solid var(--ve-line);
  background: repeating-linear-gradient(90deg, transparent 0 39px, rgb(148 163 184 / 0.08) 39px 40px);
}
#ve-lane-main {
  height: 58px;
}
#ve-lane-text {
  height: 34px;
}
#ve-lane-audio {
  height: 42px;
}
.ve-item {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 7px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-x;
  color: #fff;
  font-size: 11.5px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15);
}
.ve-item.sel {
  touch-action: none;
  box-shadow: 0 0 0 2px var(--ve-sel), inset 0 0 0 1px rgb(0 0 0 / 0.2);
  z-index: 2;
}
.ve-item.dragging {
  opacity: 0.85;
  z-index: 4;
  cursor: grabbing;
}
.ve-k-main {
  background: #0284c7 left center / auto 100% repeat-x;
}
.ve-k-main.ve-img {
  background-color: #7c3aed;
}
.ve-k-text {
  background: #db2777;
}
.ve-k-audio {
  background: #16a34a;
}
.ve-k-audio::before,
.ve-k-audio::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.ve-k-audio::before {
  left: 0;
  width: var(--fi, 0);
  background: linear-gradient(to top right, rgb(0 0 0 / 0.28) 50%, transparent 50%);
}
.ve-k-audio::after {
  right: 0;
  width: var(--fo, 0);
  background: linear-gradient(to top left, rgb(0 0 0 / 0.28) 50%, transparent 50%);
}
.ve-item.missing {
  background-image: repeating-linear-gradient(45deg, #94a3b8 0 8px, #64748b 8px 16px) !important;
}
.ve-item-label {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.7);
  pointer-events: none;
}
.ve-h {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  touch-action: none;
  z-index: 1;
}
.ve-h-l {
  left: 0;
}
.ve-h-r {
  right: 0;
}
.ve-item:hover .ve-h,
.ve-item.sel .ve-h {
  background: rgb(255 255 255 / 0.55);
}
.ve-item.sel .ve-h::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 30%;
  bottom: 30%;
  width: 2px;
  margin-left: -1px;
  background: #0f172a;
  border-radius: 1px;
}
.ve-ph {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  z-index: 5;
  pointer-events: none;
}
.ve-ph::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: #ef4444;
}
.ve-ph i {
  position: absolute;
  top: 0;
  left: -6px;
  border: 6px solid transparent;
  border-top: 8px solid #ef4444;
}
.ve-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  background: var(--ve-sel);
  border-radius: 2px;
  z-index: 6;
}

/* ---- export dialog */
.ve-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(15 23 42 / 0.55);
}
.ve-modal-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px -12px rgb(15 23 42 / 0.45);
}
.ve-modal-card .tl-progress,
.ve-modal-card .tl-out {
  margin-top: 12px;
}
.ve-modal-card video {
  max-height: 46vh;
  background: #000;
}

/* ---- touch: bigger handles */
@media (pointer: coarse) {
  .ve-item.sel .ve-h {
    width: 20px;
  }
  .ve-ib {
    min-width: 40px;
    height: 40px;
  }
}

/* ---- narrow screens: everything stacks, the page scrolls */
@media (max-width: 900px) {
  .wbx-wrap {
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .ve {
    position: relative;
    inset: auto;
  }
  .ve-main {
    display: contents;
  }
  .ve-top {
    order: 0;
  }
  .ve-banner,
  .ve-x-error {
    order: 1;
  }
  .ve-stage {
    order: 2;
  }
  .ve-tl {
    order: 3;
  }
  .ve-insp {
    order: 4;
    border-left: 0;
    border-top: 1px solid var(--ve-line);
  }
  .ve-bin {
    order: 5;
    border-right: 0;
    border-top: 1px solid var(--ve-line);
  }
  .ve-box {
    flex: none;
    height: min(56vh, calc((100vw - 24px) * 0.5625));
    min-height: 180px;
  }
  .ve[data-aspect='9:16'] .ve-box {
    height: min(60vh, 480px);
  }
  .ve[data-aspect='1:1'] .ve-box,
  .ve[data-aspect='4:5'] .ve-box {
    height: min(56vh, 400px);
  }
  .ve-saved {
    display: none;
  }
  .ve-title h1 {
    font-size: 16px;
  }
  .ve-top {
    padding: 8px 10px;
    gap: 8px;
  }
  .ve-top-actions {
    width: 100%;
  }
  .ve-export-btn {
    margin-left: auto;
  }
  .ve-tl-bar input[type='range'] {
    width: 90px;
  }
  .ve-heads {
    flex-basis: 44px;
  }
}
@media (max-width: 420px) {
  .ve-add span {
    font-size: 13px;
  }
  .ve .btn {
    padding: 8px 10px;
  }
  .ve-tl-bar input[type='range'] {
    display: none;
  }
}
