.modal.editor-modal{width:min(1320px,calc(100vw - 36px));max-height:calc(100dvh - 36px)}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:26px}.editor-preview{min-width:0}.editor-canvas-wrap{display:flex;justify-content:center;align-items:center;background:var(--media-bg);border:1px solid var(--line);border-radius:10px;padding:14px;min-height:300px;overflow:hidden}.editor-canvas-wrap canvas{display:block;max-width:100%;max-height:58vh;width:auto;height:auto;touch-action:none;cursor:grab}.editor-canvas-wrap canvas:active{cursor:grabbing}.editor-source{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.editor-transport{display:flex;align-items:center;gap:12px;margin-top:14px}.editor-transport input{flex:1;min-width:40px;padding:0}.editor-time{font:11px ui-monospace,monospace;min-width:58px;text-align:right}.editor-controls{display:grid;gap:13px;align-content:start}.editor-controls label{display:grid;gap:7px;font-size:11px;color:var(--muted)}.editor-control-head{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line);padding-bottom:10px}.editor-control-head h3{margin:0;color:var(--ink);font-size:15px}.editor-control-head span{font-size:10px;color:var(--muted)}.editor-fit{display:flex;gap:6px;flex-wrap:wrap}.editor-fit .btn{flex:1;font-size:10px;padding:8px}.editor-fit .active,.editor-segment.active{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}.editor-segments{display:grid;gap:5px;max-height:180px;overflow:auto}.editor-segment{display:flex;align-items:center;gap:10px;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px;text-align:left;font:11px ui-monospace,monospace}.editor-segment b{font:11px system-ui}.editor-time-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.editor-time-fields input{width:100%;min-width:0}.editor-footer{position:sticky;bottom:-28px;margin-top:24px;background:var(--bg-1);padding:17px 0 6px;border-top:1px solid var(--line);display:flex;align-items:center;gap:20px;z-index:2}.editor-footer>div:first-child{flex:1}.editor-footer strong{font-size:12px}.editor-footer p{margin:6px 0;max-width:660px;font-size:10px}.editor-footer-actions{display:flex;gap:9px;flex-wrap:wrap}.editor-result{margin-top:18px;border:1px solid var(--line);border-radius:9px;padding:14px;background:var(--bg-2)}.editor-result strong{display:block;font-size:12px}.editor-result video{display:block;max-height:260px;width:100%;object-fit:contain;background:var(--media-bg);margin:12px 0}.editor-loading{padding:45px;text-align:center;color:var(--muted)}.version-list{display:grid;gap:12px}.version-row{display:flex;gap:15px;align-items:center;border-bottom:1px solid var(--line);padding:13px 0}.version-row>div{flex:1;min-width:0}.version-row p{font-size:11px;color:var(--muted);margin:7px 0}.version-actions{display:flex;gap:7px;flex-wrap:wrap}.version-row .version-thumb{width:70px;height:80px;object-fit:contain;background:var(--media-bg);border-radius:5px}.permission-note{font-size:10px;color:var(--muted);line-height:1.6;margin-top:10px}@media(max-width:800px){.editor-layout{grid-template-columns:1fr}.editor-controls{grid-template-columns:1fr 1fr}.editor-control-head,.editor-segments,.editor-controls>.fine,.editor-fit,.editor-time-fields{grid-column:1/-1}.editor-footer{display:block;bottom:-20px}.editor-footer-actions{margin-top:13px}.editor-canvas-wrap canvas{max-height:45vh}.editor-transport{flex-wrap:wrap}.editor-controls label{min-width:0}.version-row{flex-wrap:wrap}.version-actions{flex-basis:100%}.modal.editor-modal{width:100%;max-height:calc(100dvh - 24px)}}
@media(min-width:801px){.editor-controls{max-height:calc(100dvh - 300px);overflow-y:auto;padding-right:7px;scrollbar-width:thin}.editor-preview{position:sticky;top:0;align-self:start}}.version-list .version-row:first-child{padding-top:0}
@media(min-width:801px){.editor-controls{display:flex;flex-direction:column}.editor-controls>*{flex-shrink:0}.editor-segments{min-height:36px}}

.editor-controls{scroll-padding-top:12px;padding-top:2px}.editor-control-head{flex-shrink:0;min-height:30px}
/* Dedicated editor workspace. The host persists when another section is open. */
.editor-workspace{max-width:1600px}.editor-workspace .editor-preview{position:relative;top:auto}.editor-workspace .editor-layout{grid-template-columns:minmax(0,1fr) 300px;gap:22px}.editor-workspace .editor-controls{max-height:72vh}.editor-workspace .editor-canvas-wrap{background:var(--media-bg);min-height:250px}.editor-workspace .editor-canvas-wrap canvas{max-height:49vh}.editor-history-bar{display:flex;align-items:center;gap:8px;margin:5px 0 14px}.editor-history-bar span{margin-left:auto}.editor-timeline-wrap{margin:18px 0;border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--surface)}.editor-timeline{display:flex;position:relative;min-height:64px;gap:4px;margin:14px 0 8px;touch-action:none}.editor-clip{position:relative;display:flex;align-items:center;justify-content:center;background:var(--surface-muted);border:1px solid var(--line);border-radius:6px;min-width:25px;overflow:hidden;cursor:grab}.editor-clip.selected{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.editor-clip span{font-size:11px;pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 10px}.editor-clip small{display:block;font-size:9px;color:var(--muted);margin-top:4px}.editor-trim-handle{position:absolute;inset-block:0;width:10px;padding:0;border:none;background:var(--accent);cursor:ew-resize;touch-action:none;z-index:2}.editor-trim-handle:after{content:'';position:absolute;top:23px;height:18px;width:2px;background:var(--accent-ink);left:4px}.editor-trim-handle.left{left:0}.editor-trim-handle.right{right:0}.editor-timeline-needle{position:absolute;top:-9px;height:85px;width:3px;background:var(--accent);border:0;padding:0;cursor:ew-resize;z-index:4;transform:translateX(-50%);touch-action:none}.editor-timeline-needle:before{content:'';position:absolute;left:-5px;top:0;border:6px solid transparent;border-top-color:var(--accent)}.editor-text-track{height:26px;margin:4px 0;overflow:hidden}.editor-text-track button{height:25px;display:block;padding:3px 7px;border:1px solid var(--accent);color:var(--ink);background:var(--surface-muted);font-size:10px;text-align:left;border-radius:4px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.editor-text-controls{display:grid;gap:12px;border-top:1px solid var(--line);padding-top:15px}.editor-text-controls textarea{min-height:80px}.editor-draft-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 22px;border-bottom:1px solid var(--line)}.editor-draft-row strong{font-size:13px}.editor-workspace .editor-footer{bottom:0;padding:14px 0;background:var(--canvas)}
@media(max-width:800px){.editor-workspace .editor-layout{grid-template-columns:1fr}.editor-workspace .editor-controls{max-height:none}.editor-timeline-wrap{padding:10px}.editor-workspace .page-heading .heading-actions{flex-wrap:wrap}.editor-history-bar{flex-wrap:wrap}.editor-history-bar span{flex-basis:100%;margin:0}.editor-workspace .editor-footer{position:relative}.editor-workspace .editor-canvas-wrap canvas{max-height:44vh}.editor-timeline{min-height:70px}}
/* Editing controls must remain reachable at laptop heights; status also lives in global activity. */
.editor-footer,.editor-workspace .editor-footer{position:static;bottom:auto;margin-top:20px;padding-block:18px}.editor-timeline-wrap{scroll-margin-bottom:24px}
.editor-workspace .page-heading{margin-bottom:18px}.editor-workspace .page-heading h1{font-size:clamp(25px,2.5vw,34px)}.editor-workspace .editor-canvas-wrap canvas{max-height:39vh}.editor-workspace .editor-controls{max-height:66vh}.nav-item.active:before{background:var(--accent)}
@media(max-width:800px){.editor-workspace .editor-controls{max-height:none}.editor-workspace .editor-canvas-wrap canvas{max-height:42vh}}
/* V6 persistent workspace: media/history at left, viewer at right, one full-width timeline. */
.editor-shell{outline:none;min-width:0}.editor-shell .editor-layout,.editor-workspace .editor-shell .editor-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:16px}.editor-media-panel{border:1px solid var(--line);border-radius:12px;background:var(--surface);max-height:54vh;min-height:350px;overflow:auto;scrollbar-width:thin}.editor-panel-tabs{display:flex;position:sticky;top:0;z-index:2;background:var(--surface);border-bottom:1px solid var(--line)}.editor-panel-tabs button{flex:1;background:none;color:var(--muted);border:0;padding:13px 10px;font-size:11px;cursor:pointer}.editor-panel-tabs button.active{color:var(--ink);box-shadow:inset 0 -2px var(--accent)}.editor-media-tools,.editor-history-panel{padding:14px}.editor-import-area{padding:16px 10px;border:1px dashed var(--line-strong,var(--line));border-radius:8px;background:var(--surface-muted);text-align:center;cursor:pointer;display:grid;gap:5px}.editor-import-area:hover{border-color:var(--accent)}.editor-import-symbol{font-size:23px;color:var(--accent)}.editor-import-area strong{font-size:12px}.editor-import-area small{font-size:10px;color:var(--muted)}.editor-vault-button{width:100%;margin-top:9px}.editor-source-card{display:grid;gap:5px;padding:14px 0;border-bottom:1px solid var(--line);margin-bottom:15px;overflow-wrap:anywhere}.editor-source-card strong{font-size:12px}.editor-source-card span{font-size:10px;color:var(--muted)}.editor-shell .editor-controls,.editor-workspace .editor-shell .editor-controls{max-height:none;overflow:visible;padding:0;display:grid;gap:12px}.editor-shell .editor-controls input:not([type=checkbox]),.editor-shell .editor-controls select,.editor-shell .editor-controls textarea{width:100%;min-width:0}.editor-shell .editor-controls input[type=range]{padding:0}.editor-shell .editor-preview{position:relative;top:auto;align-self:start}.editor-shell .editor-canvas-wrap{position:relative;min-height:350px;height:calc(54vh - 80px);background:var(--media-bg);padding:10px}.editor-shell .editor-canvas-wrap canvas,.editor-workspace .editor-shell .editor-canvas-wrap canvas{max-height:100%;height:100%;max-width:100%;object-fit:contain}.editor-empty-preview{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:30px;background:var(--media-bg);color:var(--ink)}.editor-empty-preview[hidden]{display:none}.editor-empty-preview>span{font-size:9px;letter-spacing:.17em;color:var(--muted)}.editor-empty-preview strong{font-size:clamp(17px,2vw,24px);margin-top:13px}.editor-empty-preview p{font-size:11px;color:var(--muted);max-width:330px;line-height:1.6;margin:12px 0 20px}.editor-shell .editor-transport{margin-top:10px;gap:10px}.editor-shell .editor-time{min-width:132px;font-size:10px}.editor-viewer-help{font-size:10px;margin:9px 0}.editor-shell .editor-timeline-wrap{grid-column:1/-1;margin:0;padding:13px 16px 10px;min-width:0}.editor-timeline-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap}.editor-tool-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.editor-exact-playhead{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--muted);margin-left:auto}.editor-exact-playhead input{width:80px;padding:6px 8px;font:11px ui-monospace,monospace}.editor-track-label{display:flex;justify-content:space-between;gap:15px;margin-top:20px}.editor-track-label>span{font-size:9px;letter-spacing:.13em;color:var(--muted)}.editor-track-label small{font-size:9px;color:var(--muted)}.editor-shell .editor-timeline{display:block;min-height:106px;height:106px;margin:0 0 8px;gap:0;cursor:crosshair}.editor-ruler{height:28px;position:relative;pointer-events:none}.editor-ruler span{position:absolute;top:8px;font:9px ui-monospace,monospace;color:var(--muted);transform:translateX(-50%)}.editor-ruler span:first-child{transform:none}.editor-ruler span:last-child{transform:translateX(-100%)}.editor-clips{display:flex;height:74px;gap:0;width:100%}.editor-shell .editor-clip{flex:none;min-width:0;border-radius:5px;border-width:1px;box-sizing:border-box;background:var(--bg-2);will-change:width}.editor-shell .editor-clip.selected{background:var(--bg-3);border-color:var(--accent)}.editor-shell .editor-clip span{font-size:10px;padding:9px 13px}.editor-shell .editor-trim-handle{width:9px;opacity:.65}.editor-shell .editor-clip.selected .editor-trim-handle,.editor-shell .editor-trim-handle:hover{opacity:1}.editor-shell .editor-timeline-needle{top:20px;height:86px;width:2px;background:var(--accent)}.editor-shell .editor-timeline-needle:before{border-top-color:var(--accent);left:-6px;top:-5px}.editor-timeline-empty{width:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);background:var(--surface-muted);border:1px dashed var(--line);border-radius:6px}.editor-shortcuts{font-size:9px;color:var(--muted);margin:12px 0 0}.editor-state-list{display:grid;gap:5px;margin:13px 0 22px}.editor-state,.editor-saved-version,.editor-saved-draft{display:grid;gap:4px;text-align:left;border:1px solid var(--line);border-radius:6px;padding:10px;background:var(--surface-muted);color:var(--ink);cursor:pointer;width:100%}.editor-state>span{font-size:9px;color:var(--muted)}.editor-state>strong,.editor-saved-version strong,.editor-saved-draft strong{font-size:11px;font-weight:600}.editor-state small,.editor-saved-version small,.editor-saved-draft small{font-size:9px;color:var(--muted)}.editor-state.current{border-color:var(--accent);background:var(--bg-2)}.editor-version-list,.editor-draft-library{display:grid;gap:6px}.editor-draft-library:empty{display:none}.editor-draft-library{margin-bottom:15px}.editor-advanced summary{font-size:11px;cursor:pointer;margin:6px 0 12px;color:var(--muted)}.editor-advanced>.btn{width:100%;margin-top:8px}.editor-drop-active{outline:2px dashed var(--accent);outline-offset:5px}.editor-shell .editor-footer{padding:14px 0;margin-top:12px}.editor-shell .editor-footer p{font-size:10px}.editor-shell .editor-result video{max-height:180px}.editor-shell .editor-history-bar{margin:0 0 12px}.editor-shell .editor-history-bar>span{font-size:10px}.editor-workspace .editor-heading{margin-bottom:15px}.editor-workspace .editor-heading h1{font-size:26px}.editor-workspace .editor-heading .subtitle{font-size:11px}
@media(max-width:1050px) and (min-width:801px){.editor-shell .editor-layout,.editor-workspace .editor-shell .editor-layout{grid-template-columns:235px minmax(0,1fr)}.editor-shell .editor-transport{flex-wrap:wrap}.editor-shell .editor-time{min-width:110px}.editor-shell .editor-canvas-wrap{min-height:310px}}
@media(max-width:800px){.editor-shell .editor-layout,.editor-workspace .editor-shell .editor-layout{grid-template-columns:1fr}.editor-media-panel{max-height:290px;min-height:0}.editor-shell .editor-canvas-wrap{height:390px;min-height:280px}.editor-shell .editor-timeline-wrap{padding:10px}.editor-shell .editor-controls{grid-template-columns:1fr}.editor-shell .editor-transport{flex-wrap:wrap}.editor-shell .editor-time{flex:1}.editor-exact-playhead{margin-left:0}.editor-track-label small{max-width:180px;text-align:right}.editor-shortcuts{line-height:1.6}.editor-shell .editor-history-bar>span{flex-basis:100%;margin:0}.editor-shell .editor-footer-actions .btn{font-size:11px}.editor-shell .editor-media-panel [hidden]{display:none}}

.editor-shell .editor-clip{user-select:none}.editor-shell .editor-clip.editor-drop-target{outline:2px dashed var(--accent);outline-offset:-4px}

/* V7: real media filmstrips, reusable history states and timed text handles. */
.editor-shell .editor-filmstrip{position:absolute;inset:0;display:flex;overflow:hidden;pointer-events:none;background:var(--bg-3)}
.editor-shell .editor-filmstrip img{display:block;flex:1 1 0;min-width:0;width:0;height:100%;object-fit:cover;opacity:.8}
.editor-shell .editor-clip>span{position:relative;z-index:1;background:linear-gradient(transparent,rgba(0,0,0,.8));color:var(--fg-1);text-shadow:0 1px 2px rgba(0,0,0,1);align-self:stretch;justify-content:flex-end;padding:12px 18px 6px}
.editor-shell .editor-clip.selected{outline:2px solid var(--accent);outline-offset:-2px}
.editor-shell .editor-trim-handle{z-index:3}
.editor-shell .editor-history-item{border:1px solid var(--line);border-radius:9px;overflow:hidden;margin-bottom:9px;background:var(--bg-1)}
.editor-shell .editor-history-item>.editor-state,.editor-shell .editor-history-item>.editor-saved-version{width:100%;margin:0;border:0;border-radius:0;cursor:grab}
.editor-shell .editor-history-item>.btn{width:100%;font-size:11px;border-top:1px solid var(--line);border-radius:0;white-space:normal}
.editor-shell .editor-history-previews{display:flex;min-height:55px;max-height:110px;width:100%;gap:3px;background:var(--bg-2);border-radius:4px;overflow:hidden;margin-bottom:6px}
.editor-shell .editor-history-previews img{display:block;flex:1;min-width:0;object-fit:contain;max-width:100%;background:var(--media-bg)}
.editor-shell .editor-history-empty{font-size:11px;margin:auto;color:var(--muted)}
.editor-shell .editor-saved-version img{max-height:100px;width:100%;object-fit:contain;background:var(--media-bg);margin-bottom:5px}
.editor-shell .editor-source-library{display:grid;gap:6px;margin:8px 0 16px}
.editor-shell .editor-media-source{display:grid;grid-template-columns:36px 1fr;gap:2px 8px;text-align:left;padding:7px;border:1px solid var(--line);border-radius:7px;background:var(--bg-1);color:var(--ink);cursor:pointer}
.editor-shell .editor-media-source>img,.editor-shell .editor-media-source>span{grid-row:span 2;width:36px;height:40px;object-fit:cover;background:var(--bg-2);display:grid;place-content:center;border-radius:3px}
.editor-shell .editor-media-source strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-shell .editor-media-source small{font-size:10px;color:var(--muted)}
.editor-shell .editor-text-track{height:30px;position:relative;margin:5px 0}
.editor-shell .editor-text-strip{display:flex;align-items:stretch;position:relative;min-width:20px;height:29px;border-radius:5px;background:var(--bg-3);border:1px solid var(--accent);overflow:hidden;touch-action:none}
.editor-shell .editor-text-strip.selected{outline:2px solid var(--accent)}
.editor-shell .editor-text-strip button[data-ed]{display:block;flex:1;min-width:0;width:auto!important;margin:0!important;background:none;border:0;border-radius:0;color:var(--ink);padding:4px 5px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:grab}
.editor-shell .editor-text-strip .editor-text-edge{flex:0 0 9px;padding:0;border:0;border-radius:0;background:var(--accent);cursor:ew-resize;touch-action:none;min-width:9px}
.editor-shell .editor-empty-preview[hidden]{display:none!important}
.editor-shell .editor-timeline.editor-history-over{outline:2px dashed var(--accent)}
.editor-shell .editor-text-strip{background:var(--bg-3)}
.editor-shell>.editor-result{margin:12px 0 0;padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface);display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.editor-shell>.editor-result[hidden]{display:none}.editor-shell>.editor-result details{flex:1;min-width:0}.editor-shell>.editor-result summary{font-size:12px;cursor:pointer;color:var(--ink);padding:7px 0}.editor-shell>.editor-result video{display:block;max-width:100%;max-height:260px;margin-top:10px}.editor-shell>.editor-result .btn{font-size:11px}
@media(max-width:600px){.editor-shell>.editor-result{flex-direction:column}}
