/* SnipyCut mobile preview-first, original OpenReel functions preserved. */
@media(max-width:759px){
.editor-shell.editor-compact .editor-workspace{grid-template-rows:minmax(0,1fr) minmax(195px,27dvh)!important;min-height:0}
.editor-shell.editor-compact .editor-stage,.editor-shell.editor-compact #editor-panel-timeline{min-height:0}
.editor-shell.editor-compact [data-tour=preview]{position:relative;isolation:isolate;overflow:visible!important}
.editor-shell.editor-compact [data-tour=preview]>.border-b{min-height:30px!important;height:30px;padding:3px 10px!important}
.editor-shell.editor-compact [data-tour=preview]>.flex-1{min-height:0;padding:3px 3px 50px!important}
.editor-shell.editor-compact [data-tour=preview]>.flex-1>div{max-width:100%;max-height:100%}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t{position:absolute!important;inset:auto 0 0!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;overflow:visible!important;z-index:50;pointer-events:none}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t:before{content:"";position:absolute;left:3px;right:3px;bottom:48px;height:98px;pointer-events:none;background:linear-gradient(0deg,#110d1bcc,#110d1b55 50%,transparent);border-radius:10px 10px 0 0}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t>:first-child{position:absolute!important;left:12px;right:12px;bottom:52px;height:4px!important;border-radius:6px;background:#ffffff66!important;z-index:8;pointer-events:auto}
.editor-shell.editor-compact [data-preview-transport]{position:static!important;display:contents!important}
.editor-shell.editor-compact [data-preview-timecode]{position:absolute!important;left:9px;bottom:76px;width:auto!important;max-width:49%;min-width:0;z-index:8;gap:3px!important;pointer-events:auto}
.editor-shell.editor-compact [data-preview-timecode],.editor-shell.editor-compact [data-preview-timecode] *{color:#fff!important;text-shadow:0 1px 2px #000a}
.editor-shell.editor-compact [data-preview-timecode] input{max-width:88px;min-width:0!important;font-size:11px!important}
.editor-shell.editor-compact [data-preview-playback]{position:absolute!important;right:9px;bottom:67px;display:flex!important;justify-content:flex-end;gap:2px!important;margin:0!important;z-index:8;pointer-events:auto}
.editor-shell.editor-compact [data-preview-playback] button{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;color:#fff!important;background:#0004!important;border-radius:9px!important}
.editor-shell.editor-compact [data-preview-playback] button:nth-child(2){width:42px!important;height:42px!important;color:#251833!important;background:#fffffff0!important;border-radius:50%!important}
.editor-shell.editor-compact [data-preview-tools]{position:absolute!important;left:3px!important;right:3px!important;bottom:3px!important;width:auto!important;height:42px!important;min-height:42px!important;display:flex!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:space-between!important;gap:3px!important;padding:1px 2px!important;margin:0!important;overflow:visible!important;background:var(--bg-1,#fff);border-radius:9px;pointer-events:auto;z-index:15}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-loop,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-mute,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-snap{display:grid!important;place-items:center!important;flex:0 0 39px!important;min-width:39px!important;width:39px!important;min-height:39px!important;height:39px!important;padding:2px!important;margin:0!important;border-radius:9px!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-loop{order:1}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-mute{order:2}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-aspect{order:3;flex:0 1 65px;min-width:50px;max-width:69px;height:39px!important;margin:0!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-aspect button{height:39px!important;min-height:39px!important;width:100%!important;padding:2px 3px!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-snap{order:6}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-quality,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-zoom,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-grid,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-safe,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-fullscreen,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-maximize{display:none!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-trigger{order:4;flex:0 0 44px;display:flex;align-items:center;justify-content:center;width:44px;height:39px;padding:0 2px!important;border:1px solid var(--border,#ddd);border-radius:9px;background:var(--bg-2,#efeff2);color:var(--fg-1,#292331);font-size:18px;font-weight:700;cursor:pointer;touch-action:manipulation}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-layout-trigger{order:5}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-trigger[aria-expanded=true]{background:#eae2ff;border-color:#9e84ff;color:#5939bc}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-trigger small{font-size:9px}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-trigger:focus-visible{outline:2px solid #9e84ff;outline-offset:2px}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom{display:flex!important;position:absolute!important;right:48px!important;width:154px!important;height:44px!important;align-items:center;justify-content:flex-end;padding:3px 6px!important;margin:0!important;background:var(--bg-1,#fff);border:1px solid #d9caff;box-shadow:0 8px 20px #24104435;z-index:90}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality{bottom:48px!important;border-radius:0 0 9px 9px}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom{bottom:91px!important;border-radius:9px 9px 0 0}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality:before,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom:before{position:absolute;left:9px;top:13px;font-size:11px;color:#75648b;pointer-events:none}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality:before{content:"Kalite"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom:before{content:"Yakınlık"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality button,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom button{height:35px!important;min-height:35px!important;max-width:94px}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-grid,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-safe,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-fullscreen,.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-maximize{display:flex!important;position:absolute!important;right:0!important;width:166px!important;height:40px!important;justify-content:flex-start!important;align-items:center!important;gap:8px;margin:0!important;padding:5px 8px!important;background:var(--bg-1,#fff)!important;border:1px solid #d9caff;box-shadow:0 8px 20px #24104435;z-index:90}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-grid{bottom:48px!important;border-radius:0 0 9px 9px}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-safe{bottom:88px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-fullscreen{bottom:128px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-maximize{bottom:168px!important;border-radius:9px 9px 0 0}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-grid:after{content:"Kılavuz ızgara"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-safe:after{content:"Güvenli alan"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-fullscreen:after{content:"Tam ekran"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-maximize:after{content:"Büyük önizleme"}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-grid,.sc-preview-safe,.sc-preview-fullscreen,.sc-preview-maximize):after{font-size:12px;font-weight:600;white-space:nowrap;pointer-events:none}
}

/* Locale-specific labels for the existing compact menus. */
@media(max-width:759px){
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality:before{content:"Quality"}
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom:before{content:"Zoom"}
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-grid:after{content:"Composition grid"}
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-safe:after{content:"Safe margins"}
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-fullscreen:after{content:"Full screen"}
html[lang="en"] .editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>.sc-preview-maximize:after{content:"Large preview"}
}

/* Step 6: usable compact headers and panels. Native actions remain native. */
@media(max-width:759px){
.editor-shell.editor-compact>header{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto 44px;
  grid-template-areas:"mode mode language" "project export export";
  grid-template-rows:44px 44px;height:auto!important;min-height:100px;
  gap:4px 6px;padding:4px max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left));
}
.editor-shell.editor-compact>header>[data-editor-header="mode"]{
  grid-area:mode;justify-self:start;min-width:0;max-width:100%;height:44px;padding:0;
}
.editor-shell.editor-compact>header>[data-editor-header="mode"] button{
  min-width:0;min-height:44px;padding:4px 8px;white-space:normal;line-height:1.2;
}
.editor-shell.editor-compact>header>[data-editor-header="project"]{grid-area:project;min-width:0;justify-content:flex-start}
.editor-shell.editor-compact>header>[data-editor-header="project"]>*{min-width:0;max-width:100%}
.editor-shell.editor-compact>header>[data-editor-header="project"] button{
  max-width:100%;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-inline:6px;
}
.editor-shell.editor-compact>header>[data-editor-header="language"]{grid-area:language;width:44px;height:44px;padding:4px}
.editor-shell.editor-compact>header>[data-editor-header="export"]{grid-area:export;min-width:0}
.editor-shell.editor-compact>header>[data-editor-header="export"] button{padding-inline:8px;min-height:44px}
.editor-shell.editor-compact .editor-workspace-tabs{padding-inline:max(4px,env(safe-area-inset-left));gap:2px}
.editor-shell.editor-compact .editor-workspace-tabs button{min-width:0;padding:4px 2px;font-size:12px;overflow-wrap:anywhere}
.editor-shell.editor-compact [data-tour="assets"]{flex-direction:column}
.editor-shell.editor-compact [data-tour="assets"]>div:first-child{
  width:100%;flex-direction:row;align-items:center;overflow-x:auto;overflow-y:hidden;
  padding:4px;gap:4px;border-right:0;border-bottom:1px solid var(--border);flex-shrink:0;
  overscroll-behavior-x:contain;
}
.editor-shell.editor-compact [data-tour="assets"]>div:first-child>button{flex:0 0 64px;width:64px;height:60px}
.editor-shell.editor-compact [data-tour="assets"]>div:nth-child(2){min-width:0;min-height:0}
.editor-shell.editor-compact #editor-panel-inspector :is(input:not([type="range"]),textarea,select){
  font-size:16px;min-height:44px;max-width:100%;
}
.editor-shell.editor-compact #editor-panel-inspector textarea{min-height:88px}
.editor-shell.editor-compact .editor-panel{overscroll-behavior:contain}
body:has(.editor-shell.editor-compact) [role="dialog"]{
  max-width:calc(100dvw - 16px);max-height:calc(100dvh - 24px);overflow-y:auto;
}
}
@media(min-width:760px){
.editor-shell.editor-compact>header>[data-editor-header="language"]{
  position:fixed!important;top:calc(var(--sc-work-top,0px) + 3px);
  right:18px;width:44px;height:44px;min-height:44px;pointer-events:auto;z-index:52;
}
.editor-shell.editor-compact>header>[data-editor-header="project"]{
  top:calc(var(--sc-work-top,0px) + 55px)!important;height:44px!important;
}
.editor-shell.editor-compact>header>[data-editor-header="project"] button{max-width:100%;min-width:0}
.editor-shell.editor-compact>header>[data-editor-header="export"]{top:calc(var(--sc-work-top,0px) + 108px)!important}
}

/* Step 7 — readable selection chrome, outside the actual text. */
[data-text-selection] .sc-text-selection-edge{position:absolute;inset:-10px;border:1px solid var(--accent);pointer-events:none}
[data-text-selection] .sc-text-move{position:absolute;left:50%;top:50%;width:100%;height:100%;min-width:44px;min-height:28px;transform:translate(-50%,-50%);cursor:move;pointer-events:auto;touch-action:none;background:transparent}
[data-text-selection] .sc-text-resize{position:absolute;width:24px;height:24px;pointer-events:auto;touch-action:none;z-index:2}
[data-text-selection] .sc-text-resize:after{content:"";position:absolute;inset:7px;border:2px solid var(--accent);border-radius:3px;background:var(--bg-1)}
[data-text-selection] .sc-text-resize-nw{left:-22px;top:-22px;cursor:nwse-resize}
[data-text-selection] .sc-text-resize-ne{right:-22px;top:-22px;cursor:nesw-resize}
[data-text-selection] .sc-text-resize-sw{left:-22px;bottom:-22px;cursor:nesw-resize}
[data-text-selection] .sc-text-resize-se{right:-22px;bottom:-22px;cursor:nwse-resize}
[data-text-selection] .sc-text-ratio{position:absolute;width:108px;min-height:36px;padding:4px 6px;pointer-events:auto;z-index:3;border:1px solid var(--border-strong);border-radius:8px;background:var(--bg-1);color:var(--fg-2);font-size:11px;white-space:nowrap;box-shadow:0 2px 6px #0002}
[data-text-selection] .sc-text-ratio[aria-pressed="true"]{background:var(--selected);color:var(--accent);border-color:var(--accent)}
@media(pointer:coarse){
[data-text-selection] .sc-text-resize{width:44px;height:44px}
[data-text-selection] .sc-text-resize:after{inset:16px}
[data-text-selection] .sc-text-resize-nw{left:-32px;top:-32px}
[data-text-selection] .sc-text-resize-se{right:-32px;bottom:-32px}
[data-text-selection] .sc-text-resize-ne,[data-text-selection] .sc-text-resize-sw{display:none}
[data-text-selection] .sc-text-ratio{min-height:44px}
}
@media(max-width:759px){
.editor-shell.editor-compact [data-tour=preview]>.flex-1{padding-bottom:58px!important}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t{display:block!important}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t:before{bottom:54px}
.editor-shell.editor-compact [data-tour=preview]>.shrink-0.border-t>:first-child{bottom:60px}
.editor-shell.editor-compact [data-preview-tools]{height:50px!important;min-height:50px!important}
.editor-shell.editor-compact [data-preview-tools]>:is(.sc-preview-loop,.sc-preview-mute,.sc-preview-snap){
flex:0 0 44px!important;min-width:44px!important;width:44px!important;min-height:44px!important;height:44px!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-preview-aspect,.editor-shell.editor-compact [data-preview-tools]>.sc-preview-aspect button{
height:44px!important;min-height:44px!important}
.editor-shell.editor-compact [data-preview-tools]>.sc-mobile-trigger{height:44px!important;min-height:44px!important;color:var(--fg-2)}
.editor-shell.editor-compact [data-preview-playback]{bottom:73px}
.editor-shell.editor-compact [data-preview-playback] button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
.editor-shell.editor-compact [data-preview-playback] button:nth-child(2){width:48px!important;height:48px!important}
.editor-shell.editor-compact [data-preview-timecode]{bottom:85px;max-width:calc(100% - 160px)}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-quality{bottom:56px!important;height:48px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>.sc-preview-zoom{bottom:103px!important;height:48px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>:is(.sc-preview-quality,.sc-preview-zoom) button{height:44px!important;min-height:44px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-grid,.sc-preview-safe,.sc-preview-fullscreen,.sc-preview-maximize){
width:calc(50% - 3px)!important;height:48px!important;min-height:48px!important;padding:4px 6px!important;color:var(--fg-2)!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-grid,.sc-preview-fullscreen){bottom:103px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-safe,.sc-preview-maximize){bottom:56px!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-grid,.sc-preview-safe){left:0!important;right:auto!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-fullscreen,.sc-preview-maximize){right:0!important;left:auto!important}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=layout]>:is(.sc-preview-grid,.sc-preview-safe,.sc-preview-fullscreen,.sc-preview-maximize):after{font-size:11px}
.editor-shell.editor-compact [data-preview-tools][data-sc-menu=scale]>:is(.sc-preview-quality,.sc-preview-zoom):before{color:var(--fg-2)}
}
