/* THE EDITOR WORKSPACE (17 Oct 2026 redesign). Full window: the app's menu and top bar step aside (body.ed-full). A coloured category rail, the library panel, a large
   preview and the edit panel (docked or floating), with the timeline across the full width below. Track colours by kind, icon tool bar with names on hover. */

/* ---- full window ---- */
body.ed-full #side, body.ed-full #topnav { display: none !important; }
body.ed-full main#app.editor-main { padding: 0; }
.editor.ed-v3 { height: 100%; --rail-w: 58px;
  --t-blue: #3b82f6; --t-green: #10b981; --t-amber: #f59e0b; --t-pink: #ec4899; --t-violet: #8b5cf6; --t-orange: #fb923c; --t-cyan: #22d3ee; --t-sky: #38bdf8; --t-gold: #eab308; --t-grey: #94a3b8;
  --trk-video: #2563eb; --trk-broll: #7c3aed; --trk-text: #d97706; --trk-music: #059669; --trk-voice: #0284c7; --trk-sfx: #0891b2; --trk-fx: #db2777; --trk-overlay: #ca8a04; }
.ed-v3 .ed-top { height: 46px; gap: 6px; padding: 0 8px; background: linear-gradient(90deg, #121726, #151a2b 40%, #161328); }
.ed-v3 .ed-top .icon-btn.on { background: var(--accent-bg); color: var(--accent-2); }

/* ---- the work area: the rail, then a grid of four PLACES (a left column, the middle, a right column and the bottom). Which panel sits in which place is the person's choice (dock.js). ---- */
.ed-work { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: row; }
.ed-grid { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 0 0 minmax(0, 1fr) 0 0; grid-template-rows: minmax(0, 1fr) 7px var(--row-d, var(--tl-h, 296px)); }
.ed-grid[data-shape='wide'] { grid-template-areas: 'a sa b sb c' 's s s s s' 'd d d d d'; }
.ed-grid[data-shape='tall'] { grid-template-areas: 'a sa b sb c' 's s s s c' 'd d d d c'; }
.ed-grid > .dz-a { grid-area: a; } .ed-grid > .dz-b { grid-area: b; } .ed-grid > .dz-c { grid-area: c; } .ed-grid > .dz-d { grid-area: d; }
.ed-grid > .ed-vsplit.sa { grid-area: sa; } .ed-grid > .ed-vsplit.sb { grid-area: sb; } .ed-grid > .ed-split { grid-area: s; }
.dz { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-2); }
.dz > * { flex: 1 1 0; min-width: 0; min-height: 0; }
.dz.collapsed { visibility: hidden; }
.dz .bin, .dz .insp-wrap, .dz .ed-center, .dz .timeline { border: 0; height: auto; }
.dz-a, .dz-b, .dz-c { border-top: 0; }
.dz-d > .timeline { border-top: 1px solid var(--line); }
.ed-v3 .ed-center { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 0; background: #07090e; }
.ed-v3 .ed-center > * { flex: 1; min-height: 0; }
.ed-v3 .ed-split { height: 7px; }
.ed-work .ed-vsplit[hidden] { display: none; }

/* ---- the grip every panel carries, the places shown while one is dragged, and the picture that follows the pointer ---- */
.dz-grip { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.dz-grip .ic { width: 15px; height: 15px; }
.dz-grip:hover, .dz-grip:focus-visible { background: rgba(255, 255, 255, .1); color: var(--text); }
.dz-grip:active { cursor: grabbing; }
.dz-grip[hidden] { display: none; }
body.dz-dragging, body.dz-dragging * { cursor: grabbing !important; user-select: none !important; }
.dz-layer { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.dz-zone { position: fixed; box-sizing: border-box; border: 2px dashed rgba(148, 163, 184, .55); border-radius: 10px; background: rgba(15, 23, 42, .45); display: grid; place-items: center; transition: background .1s, border-color .1s; }
.dz-zone.src { border-color: rgba(148, 163, 184, .3); background: rgba(15, 23, 42, .6); }
.dz-zone.on { border: 3px solid #6c8cff; background: rgba(108, 140, 255, .28); }
.dz-zone.no { border: 3px solid #f5b942; background: rgba(245, 185, 66, .14); }
.dz-tag { padding: 6px 12px; border-radius: 999px; background: rgba(8, 12, 22, .9); color: #e7ecf7; font-size: 13px; font-weight: 700; max-width: 90%; text-align: center; }
.dz-zone.on .dz-tag { background: #4f6cdf; } .dz-zone.no .dz-tag { background: #4a3a12; color: #ffd98a; }
.dz-ghost { position: fixed; left: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #1b2133; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(108, 140, 255, .6); white-space: nowrap; will-change: transform; }
.dz-ghost .ic { width: 16px; height: 16px; color: #8ea4ff; } .dz-hint { color: #9fb0d0; font-size: 12px; }
.pl-bar > .dz-grip, .bin-tabs > .dz-grip, .insp-bar > .dz-grip { margin-right: 2px; }
.tl-toolbar > .dz-grip { margin-right: 4px; }

/* ---- category rail ---- */
.ed-rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 4px; background: #0c0f18; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.rail-b { --tone: var(--t-grey); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; font-size: 9.5px; font-weight: 600; letter-spacing: .01em; position: relative; }
.rail-b .ic { width: 20px; height: 20px; color: var(--tone); transition: transform .12s; }
.rail-b:hover { background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--text); }
.rail-b:hover .ic { transform: scale(1.12); }
.rail-b.on { background: color-mix(in srgb, var(--tone) 22%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--tone); }
.rail-t { max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-blue { --tone: var(--t-blue); } .tone-green { --tone: var(--t-green); } .tone-amber { --tone: var(--t-amber); } .tone-pink { --tone: var(--t-pink); } .tone-violet { --tone: var(--t-violet); }
.tone-orange { --tone: var(--t-orange); } .tone-cyan { --tone: var(--t-cyan); } .tone-sky { --tone: var(--t-sky); } .tone-gold { --tone: var(--t-gold); } .tone-grey { --tone: var(--t-grey); }

/* ---- library panel ---- */
.ed-v3 .bin-tabs { display: flex; align-items: center; }
.ed-v3 .bin-tabs .lib-close { margin-left: auto; }
.ed-v3 .bin-hint { display: none; }

/* ---- edit panel: docked or floating ---- */
.insp-wrap { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-left: 1px solid var(--line); }
.insp-wrap > .insp2, .insp-wrap > .inspector { flex: 1; min-height: 0; }
.insp-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(139,92,246,.18), rgba(59,130,246,.10)); }
.insp-bar .ic { width: 16px; height: 16px; color: var(--t-violet); } .insp-bar b { font-size: 13px; }
.ed-float { position: fixed; z-index: 60; min-width: 300px; min-height: 260px; max-width: 92vw; max-height: 88vh; resize: both; overflow: hidden; display: flex; border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(139,92,246,.35); background: var(--bg-2); }
.ed-float > .insp-wrap { flex: 1; border-left: 0; }
.ed-float .insp-bar { cursor: move; }

/* ---- timeline tool bar: icons, coloured groups, names on hover ---- */
.ed-v3 .tl-toolbar { padding: 5px 8px; gap: 4px 8px; background: #0e121c; flex-wrap: wrap; }
.ed-v3 .tl-tools { min-width: 0; }
@media (max-width: 1520px) { .ed-v3 .tl-total { display: none; } .ed-v3 .tl-zoomgroup input[type=range] { width: 90px; } }
.ed-v3 .tl-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 4px; }
.ed-v3 .tl-grp { --tone: var(--t-grey); display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 9%, #121725); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 24%, transparent); }
.tl-ib { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.tl-ib .ic { width: 17px; height: 17px; }
.tl-grp .tl-ib .ic { color: var(--tone); }
.tl-ib:hover { background: color-mix(in srgb, var(--tone, var(--t-blue)) 22%, transparent); }
.tl-ib.on, .tl-ib[aria-pressed='true'] { background: color-mix(in srgb, var(--tone, var(--t-blue)) 34%, transparent); box-shadow: inset 0 0 0 1px var(--tone, var(--t-blue)); }
.tl-ib:active { transform: scale(.94); }
/* the name and the shortcut, shown at once on hover (the browser's own tooltip is slow) */
.tl-ib[data-tip]:hover::after, .rail-b[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); white-space: nowrap; padding: 4px 8px; border-radius: 6px; background: #f8fafc; color: #0b1020; font-size: 11.5px; font-weight: 600; z-index: 80; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.rail-b[data-tip]:hover::after { left: calc(100% + 8px); bottom: auto; top: 50%; transform: translateY(-50%); }
.ed-v3 .tl-zoomgroup { display: flex; align-items: center; gap: 4px; }
.ed-v3 .tl-zoomgroup .tl-ib .ic { color: var(--t-cyan); }
.ed-v3 .tl-layers { width: 100%; }

/* ---- track colours by kind ---- */
.ed-v3 .tl-lab[data-lane='video'] { box-shadow: inset 3px 0 0 var(--trk-video); } .ed-v3 .tl-lab[data-lane='broll'] { box-shadow: inset 3px 0 0 var(--trk-broll); }
.ed-v3 .tl-lab[data-lane='text'] { box-shadow: inset 3px 0 0 var(--trk-text); } .ed-v3 .tl-lab[data-lane='music'] { box-shadow: inset 3px 0 0 var(--trk-music); }
.ed-v3 .tl-lab[data-lane='voice'] { box-shadow: inset 3px 0 0 var(--trk-voice); } .ed-v3 .tl-lab[data-lane='sfx'] { box-shadow: inset 3px 0 0 var(--trk-sfx); }
.ed-v3 .tl-lab[data-lane='fx'] { box-shadow: inset 3px 0 0 var(--trk-fx); } .ed-v3 .tl-lab[data-lane='overlay'] { box-shadow: inset 3px 0 0 var(--trk-overlay); }

/* ---- small screens: the library and the edit panel become overlays over the preview ---- */
@media (max-width: 980px) {
  .ed-grid { display: flex; flex-direction: column; position: relative; grid-template-columns: none; }
  .ed-grid > .dz-b { flex: 1 1 0; } .ed-grid > .dz-d { flex: none; height: var(--tl-h, 296px); }
  .ed-grid > .dz-a, .ed-grid > .dz-c { position: absolute; top: 0; bottom: calc(var(--tl-h, 296px) + 7px); z-index: 50; width: min(340px, 86vw); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
  .ed-grid > .dz-a { left: 0; } .ed-grid > .dz-c { right: 0; }
  .ed-grid > .dz.collapsed { display: none; }
  .ed-grid > .ed-vsplit { display: none; }
  .dz-grip { display: none; }
  .ed-v3 .tl-tools { flex-wrap: wrap; }
}

/* room for the lane names ("Video", "Music") beside their eye buttons */
@media (min-width: 981px) { .ed-v3 .tl-labels { width: 128px; } .ed-v3 .tl-lab { white-space: nowrap; overflow: hidden; font-size: 11.5px; } }

/* ---- sound on the timeline: track headers (eye, speaker, solo, level), the speaker and level line on every item, the track level popover ---- */
.tl-ctl { margin-left: auto; display: inline-flex; align-items: center; gap: 1px; flex: none; }
.tl-ctl .icon-btn { width: 20px; height: 20px; min-width: 0; padding: 0; display: grid; place-items: center; border-radius: 5px; opacity: .62; font-size: 10px; font-weight: 800; line-height: 1; }
.tl-ctl .icon-btn .ic { width: 13px; height: 13px; }
.tl-ctl .tl-eye { margin-left: 0; width: 20px; height: 20px; }
.tl-lab:hover .tl-ctl .icon-btn, .tl-ctl .icon-btn.off, .tl-ctl .icon-btn.on, .tl-ctl .icon-btn:focus-visible { opacity: 1; }
.tl-ctl .tl-spk.off { color: #f5b942; } .tl-ctl .tl-spk.quiet { opacity: .35; }
.tl-ctl .tl-solo.on { background: #f5b942; color: #1a1300; }
.tl-ctl .tl-lvl.on { color: var(--accent-2); }
.tl-ctl .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.ed-v3 .tl-lab { padding: 0 5px 0 8px; gap: 4px; }
.ed-v3 .tl-lab > .ic { display: none; }
@media (min-width: 981px) { .ed-v3 .tl-labels { width: 176px; } }
@media (max-width: 980px) { .ed-v3 .tl-labels { width: 62px; } .ed-v3 .tl-lab { padding: 0 2px; } .tl-ctl { margin-left: 0; flex-wrap: wrap; } .tl-ctl .tl-solo, .tl-ctl .tl-lvl { display: none; } .tl-ctl .icon-btn { width: 18px; } }
.iv-btn { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 6px; display: none; place-items: center; padding: 0; border: 0; background: rgba(8, 12, 22, .8); color: #e7ecf7; cursor: pointer; z-index: 9; }
.iv-btn .ic { width: 12px; height: 12px; }
.iv-btn.on { display: grid; color: #f5b942; }
.clip-block:hover .iv-btn, .clip-block.selected .iv-btn, .music-block:hover .iv-btn, .music-block.selected .iv-btn, .vo-bar:hover .iv-btn, .vo-bar.selected .iv-btn, .sfx-mark:hover .iv-btn, .sfx-mark.selected .iv-btn { display: grid; }
.sfx-mark .iv-btn { position: static; width: 16px; height: 16px; margin-left: 2px; }
.iv-line { position: absolute; left: 0; right: 0; height: 9px; margin-top: -4px; cursor: ns-resize; z-index: 8; display: none; touch-action: none; }
.iv-line::before { content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: #ffd166; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
.iv-line.off::before { background: #8791a5; }
.iv-tag { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); padding: 0 5px; border-radius: 5px; background: rgba(8, 12, 22, .85); color: #ffd166; font-size: 10px; font-weight: 700; line-height: 14px; pointer-events: none; }
.clip-block:hover .iv-line, .clip-block.selected .iv-line, .music-block:hover .iv-line, .music-block.selected .iv-line, .vo-bar:hover .iv-line, .vo-bar.selected .iv-line { display: block; }
.vo-bar { position: absolute; } .vo-wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; pointer-events: none; } .vo-bar > span { position: relative; z-index: 1; }
.vo-bar.item-mute, .vo-bar.item-mute .vo-wave { opacity: .5; }
.tl-pop { position: fixed; z-index: 400; width: 252px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .55); }
.tl-pop-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; margin-bottom: 8px; } .tl-pop-val { font-size: 11px; color: var(--accent-2); white-space: nowrap; }
.tl-pop input[type=range] { width: 100%; }
.tl-pop-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ia-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .ia-title .ic { width: 16px; height: 16px; flex: none; } .ia-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ia-db { margin: -2px 0 6px; }

/* ---- the transport under the preview wraps instead of running out of the column ---- */
.pl-controls .tp-row.ctl { flex-wrap: wrap; row-gap: 2px; }
.pl-controls .time-label { white-space: nowrap; font-size: 12px; }
.pl-bar { flex-wrap: wrap; gap: 6px 10px; }

/* ---- 24 Oct 2026: the top bar was allowed to wrap onto a second row inside a 46px bar, which hid the Export button (the last one) behind the workspace. One row now; it scrolls
   sideways when the window is narrow and the Export button stays pinned at the right edge, always visible. ---- */
.ed-v3 .ed-top { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; align-items: center; scrollbar-width: thin; row-gap: 0; padding-block: 0; min-height: 46px; }
.ed-v3 .ed-top > * { flex: none; }
.ed-v3 .ed-top > .grow { flex: 1 1 8px; min-width: 8px; }
.ed-v3 .ed-top .ed-export { position: sticky; right: 0; z-index: 4; box-shadow: -16px 0 14px -4px #151a2b; white-space: nowrap; }
.ed-v3 .ed-top .ed-name { width: clamp(120px, 16vw, 240px); }
@media (max-width: 1560px) { .ed-v3 .ed-top .lbl-always { display: none; } .ed-v3 .ed-top .btn.magic .lbl-always { display: inline; } }
/* the show / hide eye on every track must be easy to see and to hit */
.ed-v3 .tl-eye { opacity: .9; width: 22px; height: 22px; }
.ed-v3 .tl-eye.off { opacity: 1; background: rgba(245, 185, 66, .18); }

/* ---- AI generations (the media panel) and the B-roll layout chips ---- */
.ag-host { flex: none; max-height: 62%; overflow-y: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.aigen { display: flex; flex-direction: column; gap: 9px; }
.aigen .ag-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aigen textarea { width: 100%; resize: vertical; min-height: 78px; }
.aigen .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aigen .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.aigen .chip-btn[disabled] { opacity: .4; cursor: not-allowed; }
.ag-refs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ag-ref { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); }
.ag-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-ref .icon-btn { position: absolute; top: 1px; right: 1px; width: 20px; height: 20px; background: rgba(0, 0, 0, .65); }
.ag-jobs { display: flex; flex-direction: column; gap: 6px; }
.ag-job { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); }
.ag-job.failed, .ag-job.cancelled { border-color: rgba(255, 120, 120, .4); }
.ag-job.done { border-color: rgba(62, 207, 142, .35); }
.ag-job-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ag-job-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-layout { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; }
.br-make { display: flex; flex-direction: column; gap: 10px; min-width: min(460px, 86vw); }
.br-make textarea { width: 100%; min-height: 80px; }
.br-make .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ae-kind { padding-bottom: 12px; margin-bottom: 4px; } .ae-kind .chips { margin-bottom: 8px; } .ae-kind .chip-btn svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
