/* Phase 2D: one-screen desktop composition. Media semantics stay in the existing editor model. */
.editor-v2-phase2{--rail:104px}
.editor-v2-phase2 .editor-topbar{height:52px}
.editor-v2-phase2 .top-export{gap:7px;border-color:var(--accent);background:var(--accent);color:#fff}
.editor-v2-phase2 .top-export:hover{background:#0b554d;color:#fff}
.editor-v2-phase2 .top-export.disabled{opacity:.48;cursor:not-allowed;pointer-events:none}
.editor-v2-phase2 .top-export-icon{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.editor-v2-phase2 .editor-top-actions{gap:8px}
.editor-v2-phase2 .editor-language-control{width:76px;height:44px;flex:0 0 76px}
.editor-v2-phase2 .editor-language-control summary{box-sizing:border-box;width:100%;height:44px;min-height:44px}
.editor-v2-phase2 .editor-topbar .top-export{box-sizing:border-box;width:100px;flex:0 0 100px}
.editor-v2-phase2 #empty-preview{padding:18px 24px}
.editor-v2-phase2 #empty-preview .direct-import h3{margin-bottom:8px;font-size:1.15rem;line-height:1.25}
.editor-v2-phase2 #empty-preview .direct-import-form{gap:6px}
.editor-v2-phase2 #empty-preview .direct-import-row input,.editor-v2-phase2 #empty-preview .direct-import-row button{min-height:44px}
.editor-v2-phase2 #empty-preview #direct-import-help{font-size:.72rem;line-height:1.35}
.editor-v2-phase2 #empty-preview .import-divider{margin:10px 0 6px}
.editor-v2-phase2 #empty-preview .upload-mark{width:52px;height:52px;min-height:52px}
.editor-v2-phase2 #empty-preview>h3{margin:4px 0 0;font-size:1rem;line-height:1.25}
.editor-v2-phase2 #empty-preview>p{margin:4px 0 0;font-size:.74rem;line-height:1.35}
.editor-v2-phase2 #empty-preview .file-button{min-height:44px;margin-top:10px}
.editor-v2-phase2 .editor-shell>.tool-rail{top:52px;height:calc(100vh - 52px);padding:8px 6px;overflow-y:auto}
.editor-v2-phase2 .editor-shell>.tool-rail .tool-button{min-height:62px;gap:3px;padding:6px 5px;font-size:.72rem;line-height:1.18}
.editor-v2-phase2 .editor-shell>.tool-rail .tool-icon{font-size:1.1rem;line-height:1}
.editor-v2-phase2 .editor-shell>.tool-rail .tool-button>span:last-child{display:block;width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:center}
.editor-v2-phase2 .v2-context-panel .tool-controls,.editor-v2-phase2 .v2-context-panel .choice-row,.editor-v2-phase2 .v2-context-panel button,.editor-v2-phase2 .v2-context-panel label{min-width:0;max-width:100%}
.editor-v2-phase2 .v2-context-panel button,.editor-v2-phase2 .v2-context-panel label,.editor-v2-phase2 .v2-context-panel p{white-space:normal;overflow-wrap:anywhere}
.editor-v2-phase2 .v2-workspace-main{padding:12px clamp(14px,2vw,28px) 32px}
.editor-v2-phase2 .workspace-intro{display:none}
.editor-v2-phase2 .v2-core-grid{grid-template-columns:112px minmax(480px,720px) minmax(260px,280px) 112px;justify-content:center;gap:12px}
.editor-v2-phase2 .v2-preview-column{display:flex;justify-content:center;min-height:0}
.editor-v2-phase2 .v2-preview-column>.tool-card{width:100%;min-width:0}
.editor-v2-phase2 .v2-ad-slot{height:min(420px,calc(var(--v2-preview-workspace-height,540px) - 24px));margin-top:12px;border:1px dashed #d6dad8;border-radius:12px;background:#eef1f0;opacity:.64;pointer-events:none}
.editor-v2-phase2 .v2-context-panel{max-height:var(--v2-preview-workspace-height,540px);overflow:auto;overscroll-behavior:contain}
.editor-v2-phase2 #preview-stage{width:var(--v2-preview-workspace-width,720px);max-width:100%;height:var(--v2-preview-workspace-height,540px);min-height:0;margin-inline:auto;justify-self:center;overflow:hidden}
.editor-v2-phase2 #preview-surface{width:var(--v2-preview-media-width,100%);height:var(--v2-preview-media-height,100%);max-width:100%;max-height:100%;margin:auto}
.editor-v2-phase2 #preview-canvas{display:block;width:100%;height:100%;object-fit:contain}
.editor-v2-phase2 .v2-timeline-region{margin-top:12px}
.editor-v2-phase2 .v2-timeline-region .timeline-panel{position:relative;padding:6px 10px}
.editor-v2-phase2 .v2-timeline-region .panel-heading{min-height:0;height:0;padding:0}
.editor-v2-phase2 .v2-timeline-region .compact-title{display:none}
.editor-v2-phase2 .v2-timeline-region #preview-selection,.editor-v2-phase2 .v2-timeline-region .current-time{display:none}
.editor-v2-phase2 .v2-timeline-region .timeline-heading-tools{position:absolute;top:10px;right:16px;z-index:5;margin:0;pointer-events:none}
.editor-v2-phase2 .v2-timeline-region .zoom-controls{gap:2px;padding:2px;border:1px solid rgba(255,255,255,.14);border-radius:9px;background:rgba(19,28,26,.74);pointer-events:auto}
.editor-v2-phase2 .v2-timeline-region .zoom-button{width:32px;min-height:32px}
.editor-v2-phase2 .v2-timeline-region .timeline-visual{height:76px;margin:0 0 4px}
.editor-v2-phase2 .v2-timeline-region .timeline-canvas{height:74px}
.editor-v2-phase2 .v2-timeline-region .timeline-ruler{top:17px;height:42px}
.editor-v2-phase2 .v2-timeline-region .track{top:38px;height:42px}
.editor-v2-phase2 .v2-timeline-region .playhead{height:54px}
.editor-v2-phase2 .v2-timeline-region .timeline-range{top:38px;height:42px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-webkit-slider-thumb{height:50px;margin-top:-24px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-moz-range-thumb{height:48px}
.editor-v2-phase2 .v2-timeline-region .time-controls{grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) minmax(170px,1.1fr);gap:5px}
.editor-v2-phase2 .v2-timeline-region .time-controls label,.editor-v2-phase2 .v2-timeline-region .duration-card{min-height:30px;grid-template-columns:auto minmax(56px,1fr);gap:5px;padding:1px 6px;border-radius:7px;font-size:.74rem}
.editor-v2-phase2 .v2-timeline-region .duration-card{grid-template-columns:1fr auto}
.editor-v2-phase2 .v2-timeline-region .duration-card span{font-weight:650}
.editor-v2-phase2 .v2-timeline-region .time-controls input{min-height:26px;padding:1px 5px}
.editor-v2-phase2 .v2-timeline-region .range-review{display:block;margin-top:2px}
.editor-v2-phase2 .v2-timeline-region #requested-range{display:none}
.editor-v2-phase2 .v2-timeline-region #actual-range{min-height:18px;padding:1px 5px;background:transparent;color:var(--muted);font-size:.68rem;font-weight:600;text-align:right}
.editor-v2-phase2 .v2-timeline-region .fast-trim-help{display:none}
.editor-v2-phase2 .v2-export-region{display:none}
.editor-v2-phase2 .v2-result-region{margin-top:12px}
.editor-v2-phase2 .v2-result-layout{display:grid;grid-template-columns:112px minmax(0,820px) 112px;justify-content:center;align-items:stretch;gap:12px}
.editor-v2-phase2 .v2-result-core{min-width:0}
.editor-v2-phase2 .v2-result-ad-slot{height:auto;max-height:none;margin-top:0;align-self:stretch}
.editor-v2-phase2 .v2-result-region .result-panel{padding:18px 20px}
.editor-v2-phase2 .export-lifecycle-viewport{--result-preview-max-height:clamp(260px,42vh,400px);position:relative;display:grid;place-items:center;width:min(100%,calc(var(--result-preview-max-height)*var(--result-aspect,1.7777778)));height:auto;max-height:var(--result-preview-max-height);aspect-ratio:var(--result-aspect,1.7777778);margin:14px auto 0;overflow:hidden;border:1px solid var(--editor-border);border-radius:12px;background:#0c1614}
.editor-v2-phase2 .export-lifecycle-viewport video{display:block;width:100%;height:100%;max-width:100%;max-height:100%;margin:0;border-radius:0;object-fit:contain;object-position:center}
.editor-v2-phase2 .export-processing-visual{display:grid;place-items:center;width:100%;height:100%;background:var(--editor-surface-subtle,#eef1f0)}
.editor-v2-phase2 .export-processing-mark{width:34px;height:34px;border:3px solid rgba(16,95,85,.18);border-top-color:var(--accent);border-radius:50%;animation:export-spin .9s linear infinite}
@keyframes export-spin{to{transform:rotate(360deg)}}
.editor-v2-phase2 .export-progress-region{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;width:min(100%,820px);min-height:70px;margin:0 auto;padding:12px 0 6px}
.editor-v2-phase2 .export-progress-region .status{margin:0;text-align:left;font-weight:750}
.editor-v2-phase2 .export-progress-value{color:var(--v2-muted);font-size:.82rem;font-variant-numeric:tabular-nums}
.editor-v2-phase2 .export-progress-region progress{display:block;grid-column:1/-1;width:100%;height:8px;margin:0;accent-color:var(--accent)}
.editor-v2-phase2 .export-progress-region .error{grid-column:1/-1;margin-top:0}
.editor-v2-phase2 .v2-result-region .result-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;width:min(100%,820px);margin:8px auto 0}
.editor-v2-phase2 .v2-result-region .result-actions>*{flex:0 0 auto;min-width:132px;min-height:44px}
.editor-v2-phase2 #download-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--accent);color:#fff;border:1px solid var(--accent);font-weight:800}
.editor-v2-phase2 #download-button:hover{background:#0b554d}
.editor-v2-phase2 .result-save-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.editor-v2-phase2 #start-over,.editor-v2-phase2 #return-editor{background:var(--panel);color:var(--accent-dark);border:1px solid #8ebbb5}
.editor-v2-phase2 #cancel-button{min-width:110px}
.editor-v2-phase2 .playback-controls{left:10px;right:auto;bottom:max(10px,env(safe-area-inset-bottom));z-index:10;width:max-content;max-width:calc(100% - 20px);gap:4px;padding:0;border:0;background:transparent;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.editor-v2-phase2 .playback-controls button{width:44px;min-height:44px;padding:5px;background:rgba(255,255,255,.9);background-clip:content-box;box-shadow:0 0 0 1px rgba(0,0,0,.12);opacity:.92}
.editor-v2-phase2 .playback-controls button:hover,.editor-v2-phase2 .playback-controls button:focus-visible{opacity:1;box-shadow:0 0 0 2px rgba(255,255,255,.72)}
.editor-v2-phase2 .playback-controls span{font-size:.68rem;font-weight:600;opacity:.74;text-shadow:0 1px 2px rgba(0,0,0,.85)}
@media(max-width:1279px){.editor-v2-phase2 .v2-ad-slot{display:none}.editor-v2-phase2 .v2-core-grid{grid-template-columns:minmax(0,1fr) minmax(260px,280px);gap:12px}.editor-v2-phase2 .v2-result-layout{grid-template-columns:minmax(0,820px)}}
@media(max-width:980px) and (min-width:761px){.editor-v2-phase2 .v2-core-grid{grid-template-columns:minmax(0,1fr)}.editor-v2-phase2 #preview-stage{max-width:720px}.editor-v2-phase2 .v2-context-panel{margin-top:10px}}
@media(max-width:760px){.editor-v2-phase2{--rail:84px}.editor-v2-phase2 .editor-topbar{height:54px}.editor-v2-phase2 .v2-workspace-main{padding:10px 12px 32px}.editor-v2-phase2 #preview-stage{max-width:100%;height:var(--v2-preview-workspace-height,auto)}.editor-v2-phase2 .v2-timeline-region .timeline-panel{padding:10px}.editor-v2-phase2 .v2-timeline-region .timeline-visual{height:98px}.editor-v2-phase2 .v2-timeline-region .timeline-canvas{height:96px}}

/* Mobile workspace order is fixed: Preview → current tool panel → Timeline → Toolbar. */
@media(max-width:760px){
.editor-v2-phase2 .v2-workspace-main{display:flex;flex-direction:column}
.editor-v2-phase2 .workspace-intro{order:0}
.editor-v2-phase2 .v2-core-grid{display:contents}
.editor-v2-phase2 .v2-preview-column{order:1}
.editor-v2-phase2 .v2-context-panel{order:2;margin-top:8px;max-height:none;overflow:visible;overscroll-behavior:auto}
.editor-v2-phase2 .v2-timeline-region{order:3;margin-top:8px}
.editor-v2-phase2 #mobile-tools{order:4;position:relative;top:auto;z-index:8;margin-top:8px}
.editor-v2-phase2 .v2-export-region{order:5}
.editor-v2-phase2 .v2-result-region{order:6}
.editor-v2-phase2 .v2-ad-slot{display:none}
.editor-v2-phase2 #preview-stage{height:clamp(260px,40svh,390px);min-height:260px;max-height:390px}
.editor-v2-phase2 #preview-stage[data-aspect="portrait"]{height:clamp(320px,52svh,520px);max-height:520px}
.editor-v2-phase2 #preview-surface{max-width:100%;max-height:100%}
.editor-v2-phase2 .playback-controls{z-index:14;pointer-events:auto}
.editor-v2-phase2 .playback-controls button{pointer-events:auto}
.editor-v2-phase2.text-editing #preview-stage{height:clamp(260px,calc(var(--editor-visual-height,600px)*.44),420px);min-height:260px;max-height:420px}
.editor-v2-phase2.text-editing .v2-context-panel{order:2}
.editor-v2-phase2.text-editing .v2-timeline-region{order:3}
.editor-v2-phase2.text-editing #mobile-tools{order:4}
}

/* Mobile tools use their natural compact height; 170px is a hard ceiling, never a default slot. */
@media(max-width:760px){
.editor-v2-phase2 .v2-context-panel{height:auto;max-height:170px;overflow:hidden;transition:max-height .16s ease,margin-top .16s ease}
.editor-v2-phase2[data-tool-panel-open="false"] .v2-context-panel{height:0;max-height:0;margin-top:0;border:0;overflow:hidden}
.editor-v2-phase2 .v2-context-panel .edit-panel{height:auto;max-height:170px;padding:7px 9px;overflow:hidden}
.editor-v2-phase2 .v2-context-panel .edit-panel>header{display:none}
.editor-v2-phase2 .v2-context-panel .tool-controls{max-height:154px;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.editor-v2-phase2[data-active-tool="frame"] .edit-panel-help{display:none}
.editor-v2-phase2[data-active-tool="frame"] #frame-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.editor-v2-phase2[data-active-tool="frame"] #frame-controls .choice-row{display:contents}
.editor-v2-phase2[data-active-tool="frame"] #frame-controls button{width:100%;min-width:0;min-height:44px;padding:4px 6px;font-size:.74rem;line-height:1.05}
.editor-v2-phase2[data-active-tool="crop"] .edit-panel-help,.editor-v2-phase2[data-active-tool="rotate"] .edit-panel-help,.editor-v2-phase2[data-active-tool="flip"] .edit-panel-help,.editor-v2-phase2[data-active-tool="audio"] .edit-panel-help{display:none}
.editor-v2-phase2[data-active-tool="crop"] #crop-controls p{display:none}
.editor-v2-phase2[data-active-tool="crop"] #crop-controls,.editor-v2-phase2[data-active-tool="rotate"] #rotate-controls,.editor-v2-phase2[data-active-tool="flip"] #flip-controls,.editor-v2-phase2[data-active-tool="audio"] #audio-controls{display:flex;align-items:center;gap:6px;min-height:44px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap}
.editor-v2-phase2[data-active-tool="crop"] #crop-controls button,.editor-v2-phase2[data-active-tool="rotate"] #rotate-controls button,.editor-v2-phase2[data-active-tool="flip"] #flip-controls button{flex:1 1 0;width:auto;min-width:88px;min-height:44px;padding:5px 8px;font-size:.78rem}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls label{flex:1 0 auto;min-height:44px;padding:4px 9px;font-size:.78rem}
.editor-v2-phase2[data-active-tool="text"] .v2-context-panel .tool-controls{overflow:hidden}
}
@media(max-width:380px){.editor-v2-phase2[data-active-tool="frame"] #frame-controls{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* R40 mobile acceptance: compact timing UI, wrapping evidence rows and keyboard-safe text editing. */
@media(max-width:760px){
.editor-v2-phase2 .v2-workspace-main,.editor-v2-phase2 .v2-core-grid,.editor-v2-phase2 .v2-preview-column,.editor-v2-phase2 .v2-context-panel,.editor-v2-phase2 .v2-timeline-region,.editor-v2-phase2 .timeline-panel,.editor-v2-phase2 .time-controls,.editor-v2-phase2 .range-review{width:100%;max-width:100%;min-width:0}
.editor-v2-phase2 .v2-timeline-region .timeline-panel{padding:7px 8px}
.editor-v2-phase2 .v2-timeline-region .timeline-visual{height:70px;margin-bottom:2px}
.editor-v2-phase2 .v2-timeline-region .timeline-canvas{height:68px}
.editor-v2-phase2 .v2-timeline-region .timeline-ruler{top:15px;height:36px}
.editor-v2-phase2 .v2-timeline-region .track{top:32px;height:36px}
.editor-v2-phase2 .v2-timeline-region .playhead{height:46px}
.editor-v2-phase2 .v2-timeline-region .timeline-range{top:32px;height:36px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-webkit-slider-thumb{height:44px;margin-top:-21px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-moz-range-thumb{height:42px}
.editor-v2-phase2 .v2-timeline-region .time-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.editor-v2-phase2 .v2-timeline-region .duration-card{grid-column:1/-1;min-width:0}
.editor-v2-phase2 .v2-timeline-region .range-review{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;margin-top:3px}
.editor-v2-phase2 .v2-timeline-region #requested-range,.editor-v2-phase2 .v2-timeline-region #actual-range{display:block;min-width:0;min-height:18px;margin:0;padding:2px 5px;background:transparent;color:var(--muted);font-size:.68rem;font-weight:600;line-height:1.25;text-align:left;white-space:normal;overflow-wrap:anywhere}
.editor-v2-phase2 .v2-timeline-region .timeline-heading-tools{top:6px;right:10px}
.editor-v2-phase2 .v2-timeline-region .zoom-button{width:30px;min-height:30px}
.editor-v2-phase2.text-editing #preview-stage{height:clamp(240px,min(46svh,calc(var(--editor-visual-height,600px)*.46)),400px);min-height:240px;max-height:400px}
.editor-v2-phase2.text-editing #preview-surface{height:100%;max-height:100%}
.editor-v2-phase2.text-editing .v2-context-panel{max-height:170px;overflow:hidden}
.editor-v2-phase2.text-editing .playback-controls{z-index:12}
}
.editor-v2-phase2 .mobile-text-delete{display:none}

/* Day140 mobile density: preserve the Day139 workspace order and Preview sizing. */
@media(max-width:760px){
.editor-v2-phase2 .empty-preview p{display:none}
.editor-v2-phase2 .v2-timeline-region{margin-top:6px}
.editor-v2-phase2 .v2-timeline-region .timeline-panel{padding:4px 6px}
.editor-v2-phase2 .v2-timeline-region .timeline-visual{height:64px;margin:0 0 2px;padding:0}
.editor-v2-phase2 .v2-timeline-region .timeline-canvas{height:62px}
.editor-v2-phase2 .v2-timeline-region .time-scale{top:1px;height:15px}
.editor-v2-phase2 .v2-timeline-region .time-scale span{font-size:.58rem;line-height:1}
.editor-v2-phase2 .v2-timeline-region .timeline-ruler{top:24px;height:32px}
.editor-v2-phase2 .v2-timeline-region .track{top:24px;height:32px}
.editor-v2-phase2 .v2-timeline-region .playhead{height:42px}
.editor-v2-phase2 .v2-timeline-region .timeline-range{top:18px;height:44px;min-height:44px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-webkit-slider-thumb{height:42px;margin-top:-20px}
.editor-v2-phase2 .v2-timeline-region .timeline-range::-moz-range-thumb{height:42px}
.editor-v2-phase2 .v2-timeline-region .time-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:center;gap:4px;margin:0}
.editor-v2-phase2 .v2-timeline-region .time-controls label,.editor-v2-phase2 .v2-timeline-region .duration-card{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;padding:0 4px;border-radius:7px;font-size:.72rem}
.editor-v2-phase2 .v2-timeline-region .time-controls label span,.editor-v2-phase2 .v2-timeline-region .duration-card span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2 .v2-timeline-region .time-controls input{width:100%;min-width:0;min-height:44px;padding:2px 3px;text-align:center;font-size:.78rem;font-variant-numeric:tabular-nums}
.editor-v2-phase2 .v2-timeline-region .duration-card{grid-column:auto;min-width:42px;padding-inline:3px}
.editor-v2-phase2 .v2-timeline-region .duration-card strong{font-size:.72rem;white-space:nowrap}
.editor-v2-phase2 .v2-timeline-region .range-review,.editor-v2-phase2 .v2-timeline-region .fast-trim-help{display:none!important}
.editor-v2-phase2 .v2-timeline-region .timeline-heading-tools{top:5px;right:7px}
.editor-v2-phase2 .v2-timeline-region .zoom-controls{gap:1px;padding:1px}
.editor-v2-phase2 .v2-timeline-region .zoom-button{width:44px;min-width:44px;min-height:44px;font-size:1rem}
.editor-v2-phase2 .mobile-tool-rail{min-height:54px;max-height:58px;gap:4px;padding:4px 6px;scrollbar-width:none}
.editor-v2-phase2 .mobile-tool-rail .tool-button{width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;max-height:44px;justify-content:center;gap:0;padding:0}
.editor-v2-phase2 .mobile-tool-rail .tool-icon{width:23px;height:23px;flex-basis:23px}
.editor-v2-phase2 .mobile-tool-rail .tool-icon svg{width:22px;height:22px}
.editor-v2-phase2 .mobile-tool-rail .tool-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2 .compact-control-icon{display:block;width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.editor-v2-phase2 .compact-control-copy{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2[data-active-tool="frame"] .edit-panel{padding:5px 6px}
.editor-v2-phase2[data-active-tool="frame"] #frame-controls{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
.editor-v2-phase2[data-active-tool="frame"] #frame-controls button{height:44px;min-height:44px;padding:0 3px;border-radius:7px;font-size:.68rem;line-height:1}
.editor-v2-phase2[data-active-tool="crop"] #crop-controls,.editor-v2-phase2[data-active-tool="rotate"] #rotate-controls,.editor-v2-phase2[data-active-tool="flip"] #flip-controls{justify-content:flex-start;gap:5px;min-height:44px;padding:0}
.editor-v2-phase2[data-active-tool="crop"] #crop-controls button,.editor-v2-phase2[data-active-tool="rotate"] #rotate-controls button,.editor-v2-phase2[data-active-tool="flip"] #flip-controls button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:8px}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls{display:flex;justify-content:flex-start;gap:3px;min-height:44px;overflow:visible}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls label{position:relative;display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:8px}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls input{position:absolute;inset:0;width:44px;height:44px;margin:0;opacity:0;cursor:pointer}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls .audio-control-copy{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls label:has(input:checked){border-color:var(--editor-accent-active);background:color-mix(in srgb,var(--editor-accent) 30%,white);box-shadow:inset 0 -2px var(--editor-accent-active)}
.editor-v2-phase2[data-active-tool="audio"] #audio-controls label:focus-within{outline:3px solid rgba(23,102,94,.28);outline-offset:2px}
.editor-v2-phase2[data-active-tool="text"] .edit-panel{padding:5px 6px}
.editor-v2-phase2[data-active-tool="text"] .v2-context-panel .tool-controls{max-height:154px;overflow:hidden}
.editor-v2-phase2[data-active-tool="text"] .text-tool-row{grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:44px 44px 44px;gap:3px;width:100%;min-width:0}
.editor-v2-phase2[data-active-tool="text"] .text-tool-group{min-width:0;padding:0;border:0}
.editor-v2-phase2[data-active-tool="text"] .text-add-group{display:grid;grid-column:1/-1;grid-row:1;grid-template-columns:44px minmax(76px,1fr) repeat(3,44px);gap:4px;width:100%;overflow:hidden}
.editor-v2-phase2[data-active-tool="text"] .text-add-group #add-text{display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
.editor-v2-phase2[data-active-tool="text"] .text-add-group label{display:block;min-width:0}
.editor-v2-phase2[data-active-tool="text"] .text-add-group label>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2[data-active-tool="text"] .text-add-group select{width:100%;min-width:0;height:44px;min-height:44px;padding:4px 6px;font-size:.75rem}
.editor-v2-phase2[data-active-tool="text"] .mobile-text-recovery,.editor-v2-phase2[data-active-tool="text"] .mobile-text-delete{display:inline-grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
.editor-v2-phase2[data-active-tool="text"] .text-style-group,.editor-v2-phase2[data-active-tool="text"] .text-value-group,.editor-v2-phase2[data-active-tool="text"] .text-align-group,.editor-v2-phase2[data-active-tool="text"] .text-align-group .choice-row{display:contents}
.editor-v2-phase2[data-active-tool="text"] #edit-text-inline,.editor-v2-phase2[data-active-tool="text"] #text-bold,.editor-v2-phase2[data-active-tool="text"] #text-italic,.editor-v2-phase2[data-active-tool="text"] .text-color-control,.editor-v2-phase2[data-active-tool="text"] [data-text-align]{grid-row:2}
.editor-v2-phase2[data-active-tool="text"] #edit-text-inline{grid-column:1}
.editor-v2-phase2[data-active-tool="text"] #text-bold{grid-column:2}
.editor-v2-phase2[data-active-tool="text"] #text-italic{grid-column:3}
.editor-v2-phase2[data-active-tool="text"] .text-color-control{grid-column:4;display:grid;place-items:center;min-width:0}
.editor-v2-phase2[data-active-tool="text"] .text-color-control>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2[data-active-tool="text"] .text-color-control input{width:44px;height:44px;min-height:44px;padding:2px;border-radius:50%}
.editor-v2-phase2[data-active-tool="text"] [data-text-align="left"]{grid-column:5}
.editor-v2-phase2[data-active-tool="text"] [data-text-align="center"]{grid-column:6}
.editor-v2-phase2[data-active-tool="text"] [data-text-align="right"]{grid-column:7}
.editor-v2-phase2[data-active-tool="text"] .text-align-group .choice-row button{width:44px;height:44px;min-height:44px;padding:0}
.editor-v2-phase2[data-active-tool="text"] .text-size-control{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:5px;min-width:0;margin:0;font-size:.68rem}
.editor-v2-phase2[data-active-tool="text"] .text-size-control>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.editor-v2-phase2[data-active-tool="text"] .text-size-control:before,.editor-v2-phase2[data-active-tool="text"] .text-size-control:after{color:var(--editor-text-secondary);font-weight:750;white-space:nowrap}
.editor-v2-phase2[data-active-tool="text"] .text-size-control:before{content:"A−"}
.editor-v2-phase2[data-active-tool="text"] .text-size-control:after{content:"A+"}
.editor-v2-phase2[data-active-tool="text"] .text-size-control input{width:100%;min-width:0;min-height:44px;margin:0}
}
@media(max-width:380px){.editor-v2-phase2[data-active-tool="frame"] #frame-controls{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:761px){.editor-v2-phase2 .compact-control-icon{display:none}}

/* Day141: keep Timeline zoom targets out of the native trim-slider hit area. */
@media(max-width:760px){
.editor-v2-phase2 .editor-topbar{height:50px;min-height:50px;padding-block:0}
.editor-v2-phase2 .editor-topbar .brand{font-size:1.25rem;line-height:1.15}
.editor-v2-phase2 .editor-language-control summary{height:44px;min-height:44px}
.editor-v2-phase2 .editor-topbar .top-export{height:44px;min-height:44px;padding:0 10px}
.editor-v2-phase2 #editor:has(#tool-card[data-state="IDLE"]) .v2-context-panel,
.editor-v2-phase2 #editor:has(#tool-card[data-state="IDLE"]) .v2-timeline-region{display:none!important}
.editor-v2-phase2 .v2-timeline-region .timeline-heading-tools{top:70px;right:6px}
.editor-v2-phase2 .v2-timeline-region .time-controls{box-sizing:border-box;padding-right:188px}
.editor-v2-phase2 .v2-timeline-region .zoom-controls{display:flex;gap:2px;padding:0;border:0;border-radius:0;background:transparent}
.editor-v2-phase2 .v2-timeline-region .zoom-button{box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px;padding:5px;background-clip:content-box;font-size:1rem}
}

/* Day142: idle mobile state keeps the disabled tool rail as the final import affordance. */
@media(max-width:760px){
.editor-v2-phase2 .editor-topbar{height:46px;min-height:46px;padding-block:0}
.editor-v2-phase2 .editor-topbar .brand{font-size:1.125rem;line-height:1.15}
.editor-v2-phase2 .editor-language-control summary{box-sizing:border-box;height:44px;min-height:44px}
.editor-v2-phase2 .editor-topbar .top-export{box-sizing:border-box;height:44px;min-height:44px;padding:2px 8px;gap:5px;background-clip:content-box}
.editor-v2-phase2 .editor-topbar .top-export-icon{width:16px;height:16px;flex-basis:16px}
.editor-v2-phase2 #preview-stage[data-aspect="empty"],.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])){overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .empty-preview,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .empty-preview{padding:10px 12px}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .direct-import h3,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .direct-import h3{margin-bottom:5px;font-size:.95rem;line-height:1.2}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .direct-import-form,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .direct-import-form{gap:5px}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .direct-import-row input,.editor-v2-phase2 #preview-stage[data-aspect="empty"] .direct-import-row button,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .direct-import-row input,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .direct-import-row button{min-height:44px}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] #direct-import-help,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) #direct-import-help{font-size:.72rem;line-height:1.25}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .import-divider,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .import-divider{margin:7px 0 4px}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .upload-mark,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .upload-mark{width:40px!important;height:40px!important;min-height:40px!important;border-radius:12px;font-size:1.5rem}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .empty-preview>h3,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .empty-preview>h3{margin:3px 0 0!important;font-size:.9rem!important;line-height:1.2}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .empty-preview>p,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .empty-preview>p{margin:3px 0 0;font-size:.72rem;line-height:1.25}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .file-button,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .file-button{display:flex}
.editor-v2-phase2 #preview-stage[data-aspect="empty"] .file-button,.editor-v2-phase2 #preview-stage:has(#empty-preview:not([hidden])) .file-button{min-height:44px;margin-top:6px}
.editor-v2-phase2 #editor:has(#tool-card[data-editor-ready="false"]) .v2-context-panel,
.editor-v2-phase2 #editor:has(#tool-card[data-editor-ready="false"]) .v2-timeline-region{display:none!important}
}

/* Day143: one visible Export surface inside its 44px mobile hit box. */
@media(max-width:760px){
.editor-v2-phase2 .editor-topbar .top-export{position:relative;isolation:isolate;appearance:none;-webkit-appearance:none;border:0;background:transparent;background-clip:border-box;box-shadow:none;padding:2px 8px}
.editor-v2-phase2 .editor-topbar .top-export:before{content:"";position:absolute;z-index:-1;inset:2px;border-radius:10px;background:var(--accent);pointer-events:none}
.editor-v2-phase2 .editor-topbar .top-export:hover:before{background:#0b554d}
}
