/* The VeditX editor (editor.js): media, program monitor, effect controls, timeline. */
.ep { --ep-bg: #0b0c10; --ep-panel: rgba(20, 22, 30, .86); --ep-line: rgba(255, 255, 255, .08); --ep-text: #e9eaf0; --ep-dim: #8b8fa3;
      --ep-accent: #7cc4ff; --ep-video: #3d6fd8; --ep-audio: #2f9b6c; --ep-title: #b06ad8; --ep-sel: #ffd166;
      position: fixed; inset: 56px 0 0 64px; z-index: 30; padding: 0 !important; margin: 0; box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(180px, 38%);
      background: var(--ep-bg); color: var(--ep-text); font: 13px/1.35 system-ui, -apple-system, sans-serif; }
.ep[hidden] { display: none; }
.ep.loading { opacity: .5; pointer-events: none; }
.ep button { font: inherit; color: inherit; }
.ep-btn { background: rgba(255, 255, 255, .06); border: 1px solid var(--ep-line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.ep-btn:hover { background: rgba(255, 255, 255, .12); }
.ep-btn:disabled { opacity: .35; cursor: default; }
.ep-btn.sm { padding: 3px 8px; font-size: 12px; }
.ep-btn[aria-pressed="false"] { opacity: .45; }
.ep-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ep-line); background: var(--ep-panel); min-width: 0; }
.ep-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.ep-tools { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: rgba(0, 0, 0, .35); margin: 0 auto; }
.ep-tool { position: relative; width: 34px; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ep-dim); }
.ep-tool i { position: absolute; right: 3px; bottom: 1px; font: 600 8px/1 system-ui; font-style: normal; opacity: .7; }
.ep-tool:hover { color: var(--ep-text); background: rgba(255, 255, 255, .07); }
.ep-tool[aria-pressed="true"] { color: #0b0c10; background: var(--ep-accent); }
.ep-acts { display: flex; align-items: center; gap: 6px; }
.ep-saved { color: var(--ep-dim); font-size: 12px; min-width: 6ch; }
.ep-export { padding: 6px 14px; }

.ep-body { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr) minmax(220px, 270px); min-height: 0; }
.ep-media, .ep-inspector { background: var(--ep-panel); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.ep-media { border-right: 1px solid var(--ep-line); }
.ep-inspector { border-left: 1px solid var(--ep-line); }
.ep-ph { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--ep-line); position: sticky; top: 0; background: inherit; z-index: 1; }
.ep-ph span { display: flex; gap: 4px; }
.ep-search { margin: 8px 10px 0; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--ep-line); background: rgba(0, 0, 0, .3); color: var(--ep-text); }
.ep-bin { padding: 4px 10px 12px; }
.ep-bin h4 { margin: 10px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ep-dim); }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.ep-card { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 4px; border-radius: 8px; border: 1px solid transparent; background: rgba(255, 255, 255, .03); cursor: grab; position: relative; }
.ep-card:hover { border-color: var(--ep-line); background: rgba(255, 255, 255, .07); }
.ep-cthumb { aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; display: grid; place-items: center; font-size: 20px; }
.ep-cthumb img, .ep-cthumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ep-cthumb.audio { background: linear-gradient(135deg, #1c4d39, #0f2a20); }
.ep-cthumb.title { background: linear-gradient(135deg, #4b2a63, #26163a); font-family: Anton, Impact, sans-serif; }
.ep-cname { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-card > i { position: absolute; top: 7px; right: 7px; font: 600 10px/1 system-ui; font-style: normal; background: rgba(0, 0, 0, .65); padding: 2px 4px; border-radius: 4px; }
.ep-empty { color: var(--ep-dim); padding: 12px 10px; margin: 0; }

.ep-monitor { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.ep-screen { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 30px; }
.ep-screen canvas { background: #000; box-shadow: 0 0 0 1px var(--ep-line); max-width: 100%; max-height: 100%; }
.ep-transport { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px 8px; flex-wrap: wrap; }
.ep-play { width: 40px; height: 32px; border-radius: 10px; border: 0; background: var(--ep-accent); color: #0b0c10 !important; cursor: pointer; font-size: 14px; }
.ep-tc { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ep-accent); margin-left: 8px; }
.ep-dur { font: 12px/1 ui-monospace, Menlo, monospace; color: var(--ep-dim); margin-right: 8px; }

#epinsp { padding: 6px 10px 14px; }
.ep-iname { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.ep-iname small { color: var(--ep-dim); font-family: ui-monospace, Menlo, monospace; }
#epinsp h5 { margin: 12px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ep-dim); }
.ep-prop { display: grid; grid-template-columns: 74px minmax(0, 1fr) 58px 18px; align-items: center; gap: 6px; margin: 4px 0; }
.ep-prop span { color: var(--ep-dim); font-size: 12px; }
.ep-prop input[type=range] { width: 100%; accent-color: var(--ep-accent); }
.ep-prop input[type=number], .ep-prop textarea { background: rgba(0, 0, 0, .35); border: 1px solid var(--ep-line); border-radius: 6px; color: var(--ep-text); padding: 3px 5px; font: 12px ui-monospace, Menlo, monospace; width: 100%; }
.ep-prop i { color: var(--ep-dim); font-style: normal; font-size: 11px; }
.ep-prop.wide { grid-template-columns: 1fr; }
.ep-prop.wide textarea { font-family: inherit; font-size: 13px; resize: vertical; }
.ep-iacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.ep-timeline { display: grid; grid-template-rows: auto minmax(0, 1fr); border-top: 1px solid var(--ep-line); background: #0e0f15; min-height: 0; }
.ep-tlbar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--ep-line); }
.ep-sel { color: var(--ep-dim); font-size: 12px; margin-left: 8px; }
.ep-zoom { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--ep-dim); font-size: 12px; }
.ep-zoom input { width: 120px; accent-color: var(--ep-accent); }
.ep-tl { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 0; }
.ep-heads { overflow: hidden; padding-top: 24px; border-right: 1px solid var(--ep-line); background: var(--ep-panel); }
.ep-th { display: flex; align-items: center; gap: 3px; padding: 0 6px; border-bottom: 1px solid var(--ep-line); box-sizing: border-box; }
.ep-th b { flex: 1; font-size: 12px; }
.ep-th button { width: 22px; height: 20px; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .05); font-size: 10px; cursor: pointer; opacity: .5; padding: 0; }
.ep-th button.on { opacity: 1; background: rgba(124, 196, 255, .25); }
.ep-th.video b { color: #9cb8ff; } .ep-th.audio b { color: #8fe0b7; }
.ep-scroll { position: relative; overflow: auto; }
.ep-ruler { position: sticky; top: 0; height: 24px; z-index: 3; background: #13141c; border-bottom: 1px solid var(--ep-line); cursor: ew-resize; min-width: 100%; }
.ep-ruler span { position: absolute; top: 0; height: 100%; border-left: 1px solid rgba(255, 255, 255, .18); padding: 5px 0 0 3px; font: 10px ui-monospace, Menlo, monospace; color: var(--ep-dim); pointer-events: none; }
.ep-marker { position: absolute; bottom: 0; width: 9px; height: 9px; margin-left: -4px; background: #6fdc8c; clip-path: polygon(0 0, 100% 0, 50% 100%); pointer-events: none; }
.ep-io { position: absolute; bottom: 0; height: 4px; background: rgba(124, 196, 255, .55); pointer-events: none; }
.ep-lanes { position: relative; min-width: 100%; }
.ep-lane { position: relative; border-bottom: 1px solid var(--ep-line); box-sizing: border-box; }
.ep-lane.video { background: rgba(61, 111, 216, .04); } .ep-lane.audio { background: rgba(47, 155, 108, .04); }
.ep-lane.locked { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 6px, transparent 6px 12px); }
.ep-clip { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; overflow: hidden; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, .22);
           background: var(--bg, none) repeat-x left center / auto 100%, var(--ep-video); cursor: grab; touch-action: none; user-select: none; }
.ep-lane.audio .ep-clip { background: var(--bg, none) no-repeat center / 100% 100%, var(--ep-audio); }
.ep-clip.image { background-color: #5a7bd0; }
.ep-clip span { position: absolute; left: 8px; top: 3px; right: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; pointer-events: none; }
.ep-clip.sel { border: 2px solid var(--ep-sel); }
.ep-clip.drag { opacity: .75; z-index: 2; }
.ep-clip.slipping { filter: brightness(1.25); }
.ep-edge { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.ep-edge.l { left: 0; } .ep-edge.r { right: 0; }
.ep-edge:hover { background: rgba(255, 209, 102, .5); }
.ep-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ff4d5e; pointer-events: none; z-index: 4; }
.ep-head::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top: 8px solid #ff4d5e; }
.ep-lanes[data-tool="razor"] .ep-clip { cursor: crosshair; }
.ep-lanes[data-tool="hand"], .ep-lanes[data-tool="hand"] .ep-clip { cursor: move; }
.ep-lanes[data-tool="slip"] .ep-clip, .ep-lanes[data-tool="slide"] .ep-clip { cursor: col-resize; }
.ep-mobilebar { display: none; }
.ed-newed { margin-left: auto; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(124, 196, 255, .45); background: rgba(124, 196, 255, .12); color: inherit; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; }

/* phones: monitor on top, timeline below; media and effect controls as sheets */
@media (max-width: 820px) {
  .ep { inset: 0; z-index: 60; grid-template-rows: auto minmax(0, 46%) minmax(0, 1fr) auto; }
  .ep-top { flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .ep-title { max-width: 14ch; }
  .ep-tools { order: 3; width: 100%; overflow-x: auto; justify-content: space-between; margin: 0; }
  .ep-acts [data-a="classic"], .ep-saved { display: none; }
  .ep-acts { margin-left: auto; }
  .ep-body { grid-template-columns: 1fr; position: relative; }
  .ep-media, .ep-inspector { position: fixed; left: 0; right: 0; bottom: 52px; max-height: 55vh; z-index: 5; border: 0; border-top: 1px solid var(--ep-line); border-radius: 16px 16px 0 0;
                             transform: translateY(120%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; background: rgba(18, 19, 26, .97); }
  .ep.show-media .ep-media, .ep.show-insp .ep-inspector { transform: none; visibility: visible; transition: transform .22s ease; }
  .ep-transport { gap: 4px; }
  .ep-transport [data-a="start"], .ep-transport [data-a="endp"], .ep-dur { display: none; }
  .ep-tl { grid-template-columns: 52px minmax(0, 1fr); }
  .ep-th { padding: 0 3px; } .ep-th button:not([data-tflag="muted"]) { display: none; }
  .ep-tlbar [data-a="addv"], .ep-tlbar [data-a="adda"], .ep-zoom input { width: 80px; }
  .ep-mobilebar { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--ep-line); background: var(--ep-panel); }
  .ep-mobilebar .ep-btn { flex: 1; padding: 9px; }
}

/* the zones past the outermost layers: drop or drag a clip here for a new layer */
.ep-newlane { position: relative; box-sizing: border-box; border-bottom: 1px solid var(--ep-line); display: flex; align-items: center; }
.ep-newlane[data-new="audio"] { border-bottom: 0; border-top: 1px solid var(--ep-line); }
.ep-newlane span { position: sticky; left: 10px; font-size: 11px; color: var(--ep-dim); opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap; }
.ep-lanes:has(.ep-clip.drag) .ep-newlane span, .ep.bindrag .ep-newlane span, .ep-newlane.hot span { opacity: .8; }
.ep-newlane.hot { background: rgba(124, 196, 255, .14); outline: 1px dashed rgba(124, 196, 255, .7); outline-offset: -3px; }
.ep-newlane.hot span { color: var(--ep-accent); }
.ep-newhead { border-bottom: 1px solid var(--ep-line); }

/* the transform box over the program monitor */
.ep-screen { position: relative; }
.ep-xf { position: absolute; box-sizing: border-box; border: 1.5px solid var(--ep-accent); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); cursor: move; touch-action: none; z-index: 2; }
.ep-xf[hidden] { display: none; }
.ep-hdl { position: absolute; width: 12px; height: 12px; margin: -6px; background: #fff; border: 1.5px solid var(--ep-accent); border-radius: 3px; z-index: 2; }
.ep-rot { position: absolute; width: 30px; height: 30px; margin: -15px; border-radius: 50%; cursor: grab; z-index: 1; }
.ep-rot:hover { background: rgba(124, 196, 255, .18); }
.ep-hdl.nw, .ep-rot.nw { left: 0; top: 0; } .ep-hdl.ne, .ep-rot.ne { left: 100%; top: 0; }
.ep-hdl.se, .ep-rot.se { left: 100%; top: 100%; } .ep-hdl.sw, .ep-rot.sw { left: 0; top: 100%; }
.ep-hdl.nw, .ep-hdl.se { cursor: nwse-resize; } .ep-hdl.ne, .ep-hdl.sw { cursor: nesw-resize; }
.ep-knob { position: absolute; left: 50%; top: -28px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ep-accent); border: 2px solid #fff; cursor: grab; }
.ep-knob::after { content: ''; position: absolute; left: 50%; top: 12px; width: 1.5px; height: 14px; margin-left: -.75px; background: var(--ep-accent); }
.ep-xfinfo { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); font: 600 11px/1 ui-monospace, Menlo, monospace; background: rgba(0, 0, 0, .75); color: #fff; padding: 4px 6px; border-radius: 5px; white-space: nowrap; pointer-events: none; }
.ep-xfinfo:empty { display: none; }
@media (pointer: coarse) { .ep-hdl { width: 18px; height: 18px; margin: -9px; } .ep-rot { width: 44px; height: 44px; margin: -22px; } }

/* snapping guide, box select, tooltips */
.ep-snapline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid #ffd166; pointer-events: none; z-index: 5; }
.ep-snapline[data-kind="sec"] { border-left-color: #7cc4ff; } .ep-snapline[data-kind="f5"] { border-left: 1px dashed rgba(124, 196, 255, .7); }
.ep-snapline[hidden] { display: none; }
.ep-marquee { position: absolute; border: 1px solid var(--ep-accent); background: rgba(124, 196, 255, .12); pointer-events: none; z-index: 4; border-radius: 2px; }
.ep-tip { position: absolute; z-index: 100; max-width: 260px; padding: 5px 8px; border-radius: 7px; background: rgba(8, 9, 14, .95); border: 1px solid rgba(255, 255, 255, .14);
          color: #fff; font: 500 12px/1.3 system-ui, -apple-system, sans-serif; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); white-space: normal; }
.ep-tip[hidden] { display: none; }
