/**
 * Full-width CapCut-style video editor.
 * Theme: follows site light/dark (html[data-theme]) like pintar-online.
 */

/* ---- Workspace shell (light default) ---- */
body.is-fullscreen .fs-workspace.veditor-fs {
  --ve-bg: #eef1f6;
  --ve-app: #ffffff;
  --ve-panel: #f8fafc;
  --ve-panel-2: #f1f5f9;
  --ve-line: #e2e8f0;
  --ve-text: var(--dica-ink, #0f172a);
  --ve-muted: var(--dica-muted, #64748b);
  --ve-faint: #94a3b8;
  --ve-accent: #fa5b0f;
  --ve-accent-2: #e04f0a;
  --ve-audio: #0284c7;
  --ve-btn: #eef2f7;
  --ve-btn-hover: #e2e8f0;
  --ve-input-bg: #ffffff;
  --ve-stage: #dce2ec;
  --ve-stage-glow: rgba(148, 163, 184, 0.35);
  --ve-drop-bg: rgba(255, 255, 255, 0.88);
  --ve-drop-border: #cbd5e1;
  --ve-item: #ffffff;
  --ve-item-hover: #f1f5f9;
  --ve-timeline-bg: #f1f5f9;
  --ve-lane: #ffffff;
  --ve-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 32px rgba(15, 23, 42, 0.07);
  --ve-topbar-h: 52px;
  --ve-timeline-h: 168px;
  --ve-side-w: 240px;
  --ve-danger: #b91c1c;

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

html[data-theme="dark"] body.is-fullscreen .fs-workspace.veditor-fs {
  --ve-bg: #0b0e14;
  --ve-app: #151922;
  --ve-panel: #1a2030;
  --ve-panel-2: #12161f;
  --ve-line: #2a3140;
  --ve-text: #e8eef6;
  --ve-muted: rgba(232, 238, 246, 0.62);
  --ve-faint: rgba(232, 238, 246, 0.42);
  --ve-accent: #fa5b0f;
  --ve-accent-2: #ff8a3d;
  --ve-audio: #38bdf8;
  --ve-btn: rgba(255, 255, 255, 0.08);
  --ve-btn-hover: rgba(255, 255, 255, 0.14);
  --ve-input-bg: rgba(0, 0, 0, 0.28);
  --ve-stage: #080b11;
  --ve-stage-glow: rgba(40, 60, 90, 0.25);
  --ve-drop-bg: rgba(12, 16, 24, 0.78);
  --ve-drop-border: rgba(255, 255, 255, 0.16);
  --ve-item: rgba(255, 255, 255, 0.04);
  --ve-item-hover: rgba(255, 255, 255, 0.08);
  --ve-timeline-bg: rgba(0, 0, 0, 0.28);
  --ve-lane: rgba(255, 255, 255, 0.03);
  --ve-shadow: none;
  --ve-danger: #fca5a5;
  background: var(--ve-bg) !important;
  border-color: #0a0e14 !important;
}

.veditor-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: min(70vh, 860px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--ve-app);
  color: var(--ve-text);
  font-family: inherit;
  border-radius: 18px;
  border: 1px solid var(--ve-line);
  box-shadow: var(--ve-shadow);
  overflow: hidden;
}

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

.veditor-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

/* ---- Top bar ---- */
.veditor-topbar {
  flex: 0 0 var(--ve-topbar-h);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--ve-panel);
  border-bottom: 1px solid var(--ve-line);
  z-index: 5;
}

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

.veditor-brand {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(250, 91, 15, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veditor-brand svg {
  width: 18px;
  height: 18px;
  fill: var(--ve-accent);
}

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

.veditor-brand-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ve-text);
}

.veditor-project-meta {
  font-size: 0.72rem;
  color: var(--ve-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.veditor-topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.veditor-topbar-sep {
  width: 1px;
  height: 22px;
  background: var(--ve-line);
  margin: 0 2px;
}

.veditor-btn-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.veditor-audio-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.veditor-slider-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ve-muted);
}

.veditor-slider-label input[type='range'] {
  width: 100%;
  accent-color: var(--ve-accent);
}

.veditor-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ve-muted);
  line-height: 1.3;
  cursor: pointer;
}

.veditor-check input {
  margin-top: 2px;
  accent-color: var(--ve-accent);
}

.veditor-text-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.veditor-text-fields {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ve-line);
}

.veditor-field select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-input-bg);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-size: 0.86rem;
}

.veditor-field input[type='color'] {
  height: 36px;
  padding: 2px 4px;
  cursor: pointer;
}

.veditor-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.veditor-text-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 8%;
  text-align: center;
  z-index: 2;
}

.veditor-text-line {
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  word-break: break-word;
  max-width: 100%;
}

.veditor-clip.is-image {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.65) 0%, rgba(79, 70, 229, 0.88) 100%);
}

.veditor-clip.has-xfade::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.veditor-clip.is-dragging {
  opacity: 0.85;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: grabbing;
  z-index: 30 !important;
}

.veditor-clip.drop-before {
  box-shadow: inset 3px 0 0 0 #fff, 0 0 0 2px var(--ve-accent);
}

.veditor-clip {
  cursor: grab;
  touch-action: none;
}

.veditor-templates {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.veditor-templates-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ve-faint);
}

.veditor-templates-row,
.veditor-templates-side {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.veditor-templates-side {
  justify-content: stretch;
}

.veditor-templates-side .veditor-tpl-btn {
  flex: 1 1 45%;
}

.veditor-tpl-btn {
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  color: var(--ve-text);
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.veditor-tpl-btn:hover {
  border-color: var(--ve-accent);
  background: rgba(250, 91, 15, 0.1);
}

/* Prevent drop zone from eating template clicks */
.veditor-drop .veditor-templates {
  position: relative;
  z-index: 2;
}

.veditor-text-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.55) 0%, rgba(5, 150, 105, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  min-width: 20px;
}

.veditor-text-block.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #10b981;
  z-index: 2;
}

.veditor-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.veditor-presets button {
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 8px 4px;
  font: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
}

.veditor-presets button:hover {
  background: var(--ve-item-hover);
}

.veditor-presets button.is-selected {
  border-color: var(--ve-accent);
  background: rgba(250, 91, 15, 0.12);
  box-shadow: inset 0 0 0 1px var(--ve-accent);
}

.veditor-sticker-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.veditor-sticker-btn {
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.veditor-sticker-btn:hover {
  background: var(--ve-item-hover);
  transform: scale(1.06);
}

.veditor-icon-btn--accent {
  border-color: rgba(250, 91, 15, 0.45);
  background: rgba(250, 91, 15, 0.12);
  color: var(--ve-accent);
  font-weight: 750;
}

.veditor-icon-btn--accent:hover:not(:disabled) {
  background: rgba(250, 91, 15, 0.2);
}

/* Left panel tabs */
.veditor-side-tabs {
  display: flex;
  gap: 4px;
  margin: -2px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ve-line);
  flex: 0 0 auto;
}

.veditor-side-tab {
  appearance: none;
  flex: 1 1 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ve-muted);
  border-radius: 8px;
  padding: 7px 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.veditor-side-tab:hover {
  background: var(--ve-item-hover);
  color: var(--ve-text);
}

.veditor-side-tab.is-active {
  background: rgba(250, 91, 15, 0.12);
  border-color: rgba(250, 91, 15, 0.4);
  color: var(--ve-accent);
}

.veditor-tab-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.veditor-tab-panel.is-active {
  display: flex;
}

.veditor-panel--left {
  display: flex;
  flex-direction: column;
}

.veditor-preview-inner video,
.veditor-preview-inner .veditor-preview-img {
  transform-origin: center center;
  transition: transform 0.08s ease-out;
}

.veditor-text-line.is-sticker {
  text-shadow: none;
  font-weight: 400;
  line-height: 1;
}

.veditor-text-overlay {
  /* allow positioned sticker lines */
  display: block;
}

.veditor-text-overlay .veditor-text-line {
  position: absolute;
  left: 50%;
  top: 50%;
  /* transform set inline (includes translate % for pos) */
  margin: 0;
  max-width: 90%;
}

.veditor-topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.veditor-out-label input {
  width: 140px;
  max-width: 28vw;
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-input-bg);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.82rem;
}

.veditor-out-label input:focus {
  outline: 2px solid var(--ve-accent);
  outline-offset: 1px;
}

/* Buttons */
.veditor-btn {
  appearance: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 8px 14px;
  transition: background 0.12s ease, opacity 0.12s ease, transform 0.1s ease;
  color: var(--ve-text);
  background: var(--ve-btn);
  white-space: nowrap;
}

.veditor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.veditor-btn:not(:disabled):active {
  transform: scale(0.98);
}

.veditor-btn:focus-visible {
  outline: 2px solid var(--ve-accent);
  outline-offset: 2px;
}

.veditor-btn-ghost {
  background: var(--ve-btn);
}

.veditor-btn-ghost:hover:not(:disabled) {
  background: var(--ve-btn-hover);
}

.veditor-btn-primary {
  background: linear-gradient(180deg, var(--ve-accent) 0%, #e04f0a 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(250, 91, 15, 0.28);
}

.veditor-btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ff6a1f 0%, var(--ve-accent) 100%);
}

.veditor-btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 7px;
}

.veditor-icon-btn {
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.veditor-icon-btn:hover:not(:disabled) {
  background: var(--ve-item-hover);
}

.veditor-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.veditor-icon-btn--danger:hover:not(:disabled) {
  border-color: rgba(185, 28, 28, 0.45);
  color: var(--ve-danger);
}

/* ---- Body: left | stage | right ---- */
.veditor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--ve-side-w) minmax(0, 1fr) var(--ve-side-w);
  gap: 0;
  background: var(--ve-app);
}

.veditor-panel {
  background: var(--ve-panel);
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.veditor-panel--left {
  border-right: 1px solid var(--ve-line);
}

.veditor-panel--right {
  border-left: 1px solid var(--ve-line);
}

.veditor-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ve-faint);
  margin-bottom: 2px;
}

.veditor-panel-section {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ve-line);
}

/* Media bin */
.veditor-media-list {
  flex: 1 1 auto;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.veditor-media-empty {
  margin: 12px 4px;
  font-size: 0.82rem;
  color: var(--ve-faint);
  line-height: 1.4;
}

.veditor-media-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.veditor-media-item:hover {
  background: var(--ve-item-hover);
}

.veditor-media-item.is-selected {
  border-color: var(--ve-accent);
  background: rgba(250, 91, 15, 0.1);
}

.veditor-media-idx {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(250, 91, 15, 0.15);
  color: var(--ve-accent);
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veditor-media-main {
  min-width: 0;
  flex: 1;
}

.veditor-media-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.veditor-media-meta {
  display: block;
  font-size: 0.68rem;
  color: var(--ve-faint);
  margin-top: 1px;
}

.veditor-audio-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
}

html[data-theme="dark"] .veditor-audio-card {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.25);
}

.veditor-audio-name {
  font-size: 0.8rem;
  color: var(--ve-muted);
  line-height: 1.35;
  word-break: break-word;
}

/* Stage / preview — slightly dimmer center; video still on black */
.veditor-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 30%, var(--ve-stage-glow), transparent 55%),
    var(--ve-stage);
}

.veditor-drop {
  position: absolute;
  inset: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  border: 2px dashed var(--ve-drop-border);
  border-radius: 16px;
  background: var(--ve-drop-bg);
  backdrop-filter: blur(6px);
  cursor: pointer;
  padding: 24px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.veditor-drop:hover,
.veditor-drop.is-dragover {
  border-color: var(--ve-accent);
  background: rgba(250, 91, 15, 0.08);
}

.veditor-drop:focus-visible {
  outline: 2px solid var(--ve-accent);
  outline-offset: 2px;
}

.veditor-app.has-media .veditor-drop {
  display: none;
}

.veditor-drop-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(250, 91, 15, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.veditor-drop-icon svg {
  width: 30px;
  height: 30px;
  fill: var(--ve-accent);
}

.veditor-drop h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--ve-text);
}

.veditor-drop p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ve-muted);
  max-width: 320px;
}

.veditor-drop-cta {
  margin-top: 10px;
  display: inline-flex;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--ve-accent) 0%, #e04f0a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(250, 91, 15, 0.3);
}

.veditor-editor {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  opacity: 0.35;
  pointer-events: none;
}

.veditor-app.has-media .veditor-editor {
  opacity: 1;
  pointer-events: auto;
}

.veditor-preview-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 8px;
}

.veditor-preview-shell {
  position: relative;
  width: min(100%, 920px);
  max-height: 100%;
  background: #000;
  border-radius: 6px;
  border: 1px solid var(--ve-line);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

html[data-theme="dark"] .veditor-preview-shell {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.veditor-preview-shell::before {
  content: '';
  display: block;
  width: 100%;
  padding-top: var(--veditor-aspect-pad, 56.25%);
}

.veditor-preview-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.veditor-preview-inner video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.veditor-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.88rem;
  pointer-events: none;
}

.veditor-preview-empty[hidden] {
  display: none;
}

.veditor-transport {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px 14px;
}

.veditor-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  color: var(--ve-text);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.veditor-play-btn:hover {
  background: var(--ve-item-hover);
}

.veditor-play-btn:focus-visible {
  outline: 2px solid var(--ve-accent);
  outline-offset: 2px;
}

.veditor-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  color: var(--ve-muted);
  min-width: 10rem;
}

/* Right properties */
.veditor-aspects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.veditor-aspects button {
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-item);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 9px 4px;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.veditor-aspects button:hover {
  background: var(--ve-item-hover);
}

.veditor-aspects button.is-selected {
  border-color: var(--ve-accent);
  background: rgba(250, 91, 15, 0.1);
  box-shadow: inset 0 0 0 1px var(--ve-accent);
}

.veditor-clip-empty {
  font-size: 0.82rem;
  color: var(--ve-faint);
  line-height: 1.4;
  padding: 4px 2px;
}

.veditor-clip-name {
  font-size: 0.88rem;
  font-weight: 700;
  word-break: break-all;
  margin-bottom: 4px;
}

.veditor-clip-meta {
  font-size: 0.75rem;
  color: var(--ve-muted);
  margin-bottom: 10px;
}

.veditor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.veditor-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ve-faint);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.veditor-field input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--ve-line);
  background: var(--ve-input-bg);
  color: var(--ve-text);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.veditor-field input:focus {
  outline: 2px solid var(--ve-accent);
  outline-offset: 1px;
}

.veditor-hint {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: var(--ve-faint);
  line-height: 1.35;
}

/* ---- Timeline (full width bottom) ---- */
.veditor-timeline-wrap {
  flex: 0 0 auto;
  background: var(--ve-panel);
  border-top: 1px solid var(--ve-line);
  padding: 8px 12px 12px;
  min-height: var(--ve-timeline-h);
}

.veditor-timeline-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.veditor-timeline-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ve-faint);
}

.veditor-timeline-hint {
  font-size: 0.72rem;
  color: var(--ve-faint);
}

.veditor-timeline {
  background: var(--ve-timeline-bg);
  border: 1px solid var(--ve-line);
  border-radius: 10px;
  padding: 8px 10px 10px;
  overflow-x: auto;
  position: relative;
}

.veditor-ruler {
  position: relative;
  height: 16px;
  margin-bottom: 6px;
  min-width: 100%;
  border-bottom: 1px solid var(--ve-line);
}

.veditor-ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ve-line);
  transform: translateX(-0.5px);
}

.veditor-ruler-tick span {
  position: absolute;
  top: 0;
  left: 4px;
  font-size: 0.62rem;
  color: var(--ve-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.veditor-tracks-rel {
  position: relative;
}

.veditor-track {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 44px;
}

.veditor-track:last-child {
  margin-bottom: 0;
}

.veditor-track-label {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ve-faint);
  background: var(--ve-item);
  border-radius: 6px;
  border: 1px solid var(--ve-line);
}

.veditor-track-lane {
  flex: 1 1 auto;
  position: relative;
  min-height: 42px;
  min-width: 280px;
  background: var(--ve-lane);
  border-radius: 8px;
  border: 1px dashed var(--ve-line);
  overflow: hidden;
}

.veditor-track-lane.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ve-faint);
  font-size: 0.78rem;
}

.veditor-clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(250, 91, 15, 0.72) 0%, rgba(224, 79, 10, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8px;
  min-width: 28px;
  user-select: none;
}

.veditor-clip:hover {
  filter: brightness(1.05);
}

.veditor-clip.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ve-accent);
  z-index: 2;
}

html[data-theme="dark"] .veditor-clip.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ve-accent);
}

.veditor-clip-label {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.veditor-clip-dur {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
}

.veditor-clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 3;
}

.veditor-clip-handle::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
}

.veditor-clip-handle.is-in {
  left: 0;
}

.veditor-clip-handle.is-in::after {
  left: 2px;
}

.veditor-clip-handle.is-out {
  right: 0;
}

.veditor-clip-handle.is-out::after {
  right: 2px;
}

.veditor-audio-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.55) 0%, rgba(2, 132, 199, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  min-width: 40px;
}

.veditor-audio-block span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.veditor-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ve-accent);
  z-index: 5;
  pointer-events: none;
  transform: translateX(-1px);
  box-shadow: 0 0 4px rgba(250, 91, 15, 0.45);
}

.veditor-playhead::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--ve-accent);
}

/* Progress / result / status */
.veditor-app .veditor-progress {
  margin: 0;
  border-radius: 0;
  border-top: 1px solid var(--ve-line);
  background: var(--ve-panel-2);
  padding: 10px 14px;
}

.veditor-app .veditor-result {
  margin: 0;
  border-radius: 0;
  border-top: 1px solid var(--ve-line);
  background: var(--ve-panel);
  padding: 12px 14px;
}

.veditor-app .veditor-result video {
  width: 100%;
  max-height: 200px;
  margin-top: 10px;
  border-radius: 8px;
  background: #000;
}

.veditor-app .veditor-status {
  margin: 0;
  border-radius: 0;
  padding: 8px 14px;
  background: var(--ve-panel);
  border-top: 1px solid var(--ve-line);
  color: var(--ve-danger);
  font-size: 0.86rem;
}

.veditor-app .veditor-status:empty {
  display: none;
  padding: 0;
  border: 0;
}

.veditor-app.is-busy .veditor-clip,
.veditor-app.is-busy .veditor-clip-handle {
  pointer-events: none;
}

.veditor-app .mtool-success {
  border-radius: 0;
  margin: 0;
  border-left: 0;
  border-right: 0;
}

/* media-tools progress/result on light panels */
.veditor-app .mtool-progress-text,
.veditor-app .mtool-result-name,
.veditor-app .mtool-result-sub {
  color: var(--ve-text);
}

.veditor-app .mtool-result-sub {
  color: var(--ve-muted);
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  body.is-fullscreen .fs-workspace.veditor-fs {
    height: auto;
    min-height: min(85vh, 980px) !important;
    overflow: visible;
  }

  .veditor-app {
    min-height: min(85vh, 980px);
    height: auto;
  }

  .veditor-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(280px, 42vh) auto;
  }

  .veditor-panel--left {
    border-right: 0;
    border-bottom: 1px solid var(--ve-line);
    max-height: 160px;
  }

  .veditor-panel--right {
    border-left: 0;
    border-top: 1px solid var(--ve-line);
    max-height: 220px;
  }

  .veditor-topbar {
    grid-template-columns: 1fr;
    height: auto;
    flex: 0 0 auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .veditor-topbar-center {
    order: 3;
    justify-content: flex-start;
  }

  .veditor-topbar-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .veditor-timeline-hint {
    display: none;
  }
}

@media (max-width: 560px) {
  .veditor-out-label input {
    width: 110px;
  }

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