/* CREATIVE STUDIO 2.0 — one predictable responsive shell, no overlapping control overlays.
   The legacy engine's DOM remains intact and hidden in its original workspace. */
:root{color-scheme:dark;--cs-bg:#121315;--cs-top:#1b1c20;--cs-panel:#202126;--cs-surface:#2b2d33;--cs-border:#3b3e47;--cs-muted:#a2a6b2;--cs-fg:#f5f6f8;--cs-accent:#e4aa4b;--cs-blue:#76abf1}
body.cs-v2{margin:0!important;background:var(--cs-bg)!important;color:var(--cs-fg)!important;font:14px/1.45 'DM Sans',system-ui,-apple-system,sans-serif!important;overflow:hidden!important}
body.cs-v2 *,body.cs-v2 *::before,body.cs-v2 *::after{box-sizing:border-box}
body.cs-v2 button,body.cs-v2 input,body.cs-v2 textarea,body.cs-v2 select{font:inherit}
body.cs-v2 button{cursor:pointer}
body.cs-v2 :focus-visible{outline:2px solid var(--cs-blue);outline-offset:2px}
body.cs-v2>header,body.cs-v2 #studioAppHome,body.cs-v2 .mobile-editor-dock,body.cs-v2 #photoWorkspace main{display:none!important}
body.cs-v2 #videoWorkspace{display:block!important}
#cs-app{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--cs-bg)}
#cs-top{flex:0 0 58px;height:58px;min-width:0;display:flex;align-items:center;gap:9px;padding:0 14px;background:var(--cs-top);border-bottom:1px solid var(--cs-border)}
#cs-top button,#cs-top a{display:grid;place-items:center;min-height:35px;height:35px;min-width:36px;flex:0 0 auto;padding:0 12px;border:1px solid #45464e;border-radius:7px;background:#292a30;color:var(--cs-fg);text-decoration:none;font-size:12px;font-weight:700}
#cs-top button:hover,#cs-top a:hover{background:#35363e}
#cs-top .cs-icon{font-size:22px;line-height:1}
#cs-mark{display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:15px;font-weight:800;letter-spacing:-.035em}
#cs-mark em{font-style:normal;color:var(--cs-accent)}
.cs-logo{height:28px;width:28px;display:grid;place-items:center;border-radius:7px;background:var(--cs-accent);color:#171717;font-size:18px}
#cs-top-divider{height:24px;width:1px;background:#42454b;margin:0 3px}
#cs-top-project{max-width:28vw;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#b5b7bf}
.cs-spacer{flex:1 1 auto;min-width:0}
#cs-top .cs-primary,.cs-action-primary,#cs-home .cs-primary{background:#e0a84e!important;color:#191a1c!important;border-color:#e0a84e!important;font-weight:800!important}
#cs-top .cs-primary:hover,.cs-action-primary:hover{background:#edb85f!important}
#cs-editor{display:flex;flex:1 1 auto;min-height:0;min-width:0;overflow:hidden}
#cs-editor[hidden],#cs-video[hidden],#cs-home[hidden],#cs-inspector[hidden]{display:none!important}
#cs-rail{flex:0 0 76px;width:76px;min-width:0;display:flex;flex-direction:column;align-items:center;gap:3px;padding:10px 5px;background:#1b1c20;border-right:1px solid var(--cs-border);overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}
#cs-rail button{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;align-items:center;width:64px;min-height:54px;padding:4px 3px;gap:2px;border:1px solid transparent;border-radius:8px;background:transparent;color:#b1b5c1;font-size:10px;text-align:center;line-height:1.3;white-space:nowrap}
#cs-rail button:hover,#cs-rail button.active{background:#303136;border-color:#46484f;color:#fff}
.cs-rail-icon{font-size:23px;line-height:1.15;font-weight:500}
#cs-center{flex:1 1 auto;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:#16171b}
#cs-stage-head{height:45px;flex:0 0 45px;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 20px;border-bottom:1px solid #292c33;background:#191a1f}
.cs-doc-head{display:flex;align-items:center;gap:11px;min-width:0;font-size:12px}.cs-doc-head strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700}.cs-doc-head small{color:#9ba1ac;white-space:nowrap}
.cs-status-dot{height:8px;width:8px;display:block;flex:0 0 8px;border-radius:50%;background:#4eaf80}.cs-stage-actions{font-size:11px;color:#838895;white-space:nowrap}
#cs-pages-mount{flex:0 0 auto;min-width:0;max-width:100%;background:#1d1f24;border-bottom:1px solid #363942}
body.cs-v2 #cs-pages-mount #studioPages{position:relative!important;display:flex!important;align-items:center;gap:9px;width:100%;max-width:100%;padding:7px 14px!important;min-height:51px;height:51px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;flex-wrap:nowrap!important;visibility:visible!important;opacity:1!important;scrollbar-width:thin;scrollbar-color:#666b78 transparent;background:transparent!important;margin:0!important;border:0!important;z-index:auto!important}
body.cs-v2 #cs-pages-mount .page-tabs{display:flex!important;align-items:center;flex:0 0 auto;gap:6px;flex-wrap:nowrap!important}
body.cs-v2 #cs-pages-mount button{display:inline-flex!important;align-items:center;justify-content:center;min-height:32px;height:32px;max-width:none!important;min-width:max-content;padding:5px 11px!important;background:#2c2d33;color:#dce0e8;border:1px solid #464a55;border-radius:7px;white-space:nowrap;font-size:12px}
body.cs-v2 #cs-pages-mount button.page-active{background:#393b46;border-color:#e1aa50;color:#fff}
body.cs-v2 #cs-pages-mount #addPage{background:#3c392d;border-color:#8e744c;color:#f0ce92;font-weight:700}
body.cs-v2 #cs-pages-mount #clearPage{color:#adb1bb}
#pageCounter{font-size:11px;color:#a0a4af;white-space:nowrap;flex:0 0 auto}
#cs-stage{position:relative;flex:1 1 auto;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:20px;background:radial-gradient(ellipse at center,#25272f 0,#17191e 74%)}
#cs-stage .canvas-wrap{display:block!important;position:relative!important;flex:0 0 auto!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;width:auto;height:auto;overflow:visible!important;padding:0!important;margin:auto!important;background:transparent!important;box-shadow:none!important}
#cs-stage canvas{display:block!important;max-width:none!important;max-height:none!important;width:auto;height:auto;object-fit:fill!important;background:white;box-shadow:0 14px 45px #0009;touch-action:none}
#cs-status{height:39px;flex:0 0 39px;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:0 12px 0 18px;background:#1d1f24;border-top:1px solid #353841;font-size:11px;color:#a6aab3}
.cs-status-left{display:flex;align-items:center;gap:8px;min-width:0;white-space:nowrap}.cs-dot{opacity:.4}
#cs-zoom{display:flex;align-items:center;gap:7px;flex:0 0 auto}
#cs-zoom button{border:1px solid #4a4d56;background:#282a31;color:#e8e9eb;min-width:26px;height:26px;min-height:26px;padding:0 6px;border-radius:5px;font-size:13px}
#cs-zoom button.active{border-color:#d3a155;color:#eac180}
#cs-zoom-label{width:42px;text-align:center;font-variant-numeric:tabular-nums;font-size:11px}
#cs-inspector{position:relative!important;inset:auto!important;transform:none!important;flex:0 0 clamp(315px,28vw,410px);width:clamp(315px,28vw,410px);min-width:0;min-height:0;max-width:none;max-height:none;display:flex;flex-direction:column;gap:0!important;padding:0!important;margin:0;border:0;border-left:1px solid var(--cs-border);border-radius:0!important;background:var(--cs-panel);overflow:hidden;box-shadow:none!important}
#cs-inspector-head{flex:0 0 68px;min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 17px;border-bottom:1px solid #363941;background:#25262c}
#cs-inspector-head>div:first-child{display:flex;flex-direction:column;gap:3px;min-width:0}
#cs-eyebrow{font-size:9px;letter-spacing:.14em;font-weight:750;color:#999fae}
#cs-panel-title{font-size:15px;font-weight:750;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cs-panel-actions{display:flex;align-items:center;gap:5px;flex:0 0 auto}
#cs-inspector-head button{border:0;background:transparent;color:#aeb4c1;font-size:21px;padding:0;width:31px;min-height:31px;height:31px;border-radius:6px}
#cs-inspector-head button:hover{background:#3a3d47}
#cs-expand{display:none}
#cs-tabs{display:flex;flex:0 0 auto;gap:6px;align-items:center;padding:7px 12px;min-height:46px;max-width:100%;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid #343740;white-space:nowrap;scrollbar-width:thin;scrollbar-color:#646b76 transparent}
#cs-tabs:empty{display:none}
#cs-tabs button{flex:0 0 auto;white-space:nowrap;min-height:32px;padding:5px 11px;border-radius:7px;border:1px solid #42454d;background:#2b2d33;color:#b9bec9;font-size:11px}
#cs-tabs button.active{border-color:#c59b55;background:#41392c;color:#ffe0a6}
#cs-inspector-body{display:block!important;flex:1 1 auto;min-width:0;min-height:0;width:100%;max-height:none!important;height:auto!important;padding:15px 17px 24px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#5d636e transparent}
#cs-inspector-body>*{min-width:0;max-width:100%}
#cs-inspector-body button.cs-action,#cs-inspector-body button.cs-action-primary{display:block;width:100%;min-height:40px;margin:0 0 9px;padding:9px 12px;border:1px solid #4a4d58;border-radius:7px;background:#30323a;color:#f0f0f2;text-align:left;font-weight:650;font-size:12px}
#cs-inspector-body .cs-hint{font-size:12px;line-height:1.6;color:#aeb3bf;margin:0 0 16px}
#cs-inspector-body>label.cs-field,#cs-inspector-body .cs-field-row label{display:flex;flex-direction:column;gap:8px;font-size:11px;letter-spacing:.01em;color:#c3c7d0;font-weight:650;margin:0 0 18px}
#cs-inspector-body .cs-field-row{display:flex;flex-direction:column;gap:2px}
#cs-inspector-body :is(input:not([type=range]),select,textarea){display:block;width:100%!important;max-width:100%!important;min-width:0!important;min-height:38px;padding:8px 10px;border:1px solid #4b4e58;background:#2e3037;color:#f5f5f7;border-radius:7px}
#cs-inspector-body input[type=color]{min-height:44px;padding:3px}
#cs-inspector-body input[type=range]{display:block;width:100%!important;max-width:100%!important;min-width:0!important;accent-color:var(--cs-accent)}
#cs-inspector-body #selectedTools{display:flex!important;flex-direction:column!important;gap:12px;width:100%;min-width:0;max-width:100%;height:auto!important;overflow:visible!important;padding:0!important;margin:0!important}
#cs-inspector-body #selectedTools>details.editor-group{display:block!important;flex:0 0 auto;width:100%;min-width:0;max-width:100%;margin:0!important;background:transparent!important;border:0!important;border-radius:0!important;overflow:visible!important}
#cs-inspector-body #selectedTools>details.editor-group[hidden]{display:none!important}
#cs-inspector-body #selectedTools>details.editor-group>summary{display:none!important}
#cs-inspector-body #selectedTools>details.editor-group>.editor-group-body{display:flex!important;flex-direction:column;gap:12px;width:100%;min-width:0;padding:0!important;margin:0!important;background:transparent!important}
#cs-inspector-body #selectedTools>details.editor-group:not([open])>.editor-group-body{display:none!important}
#cs-inspector-body #selectedTools label{display:flex;flex-direction:column;gap:7px;width:100%;max-width:100%;min-width:0;font-size:12px;color:#cad0d8}
#cs-inspector-body #selectedTools .two{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px;min-width:0}
#cs-inspector-body #selectedTools button,#cs-inspector-body #layerList button{min-height:35px;border-radius:7px;border:1px solid #4a4d58;background:#30323a;color:#f0f2f7;padding:6px 9px}
#cs-inspector-body #selectedTools button:hover,#cs-inspector-body #layerList button:hover{background:#434650}
#cs-inspector-body #selectedTools .crop-controls{display:flex!important;flex-direction:column;gap:11px;width:100%;min-width:0;border:1px solid #40444d;background:#272930;border-radius:8px;padding:11px!important}
#cs-inspector-body #selectedTools .crop-shape-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;width:100%;min-width:0}
#cs-inspector-body #selectedTools .crop-shape{display:flex!important;flex-direction:column;min-width:0!important;padding:5px 1px!important;font-size:10px!important}
#cs-inspector-body #selectedTools .crop-shape small{font-size:9px}
#cs-inspector-body #selectedTools .position-nudge{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px;align-items:center;justify-items:stretch}
#cs-inspector-body #selectedTools .position-slider-controls{width:100%;min-width:0;display:grid!important;grid-template-columns:minmax(0,1fr) 60px 16px!important;gap:7px}
#cs-inspector-body #selectedTools .position-slider-controls input{min-width:0!important;max-width:100%!important}
#cs-inspector-body #selectedTools .photo-preset-picker.cs-has-thumbnails select{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
#cs-inspector-body .cs-filter-thumbs{width:100%;display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:4px 0 12px;scrollbar-width:thin;scroll-snap-type:x proximity}
#cs-inspector-body .cs-filter-thumb{flex:0 0 87px!important;display:flex!important;flex-direction:column;align-items:center;gap:5px;width:87px;max-width:87px;min-height:98px!important;padding:5px!important;scroll-snap-align:start;text-align:center}
#cs-inspector-body .cs-filter-thumb[aria-pressed=true]{border-color:#e1aa52!important;box-shadow:inset 0 0 0 1px #e1aa52}
.cs-filter-preview{display:block;width:73px;height:64px;flex:0 0 64px;border-radius:5px;background-color:#414550;background-size:cover;background-position:center}
.cs-filter-thumb small{width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f0f0f0;font-size:10px}
#cs-inspector-body #layerList{display:flex;flex-direction:column;gap:7px;width:100%;min-width:0;padding:0;margin:0}
#cs-inspector-body #layerList .layer{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%;padding:7px 5px;margin:0;border:1px solid #3d424d;border-radius:7px;background:#2b2d34}
#cs-inspector-body #layerList .layer.active{outline:1px solid #e2ad52;border-color:#d0a058}
#cs-inspector-body #layerList .layer button{min-width:28px;padding:6px 4px}
#cs-inspector-body #layerList .layer .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:transparent;border:0;text-align:left;font-weight:650}
#cs-inspector-body #layerList .layer.muted .name{opacity:.45}
#cs-home{flex:1 1 auto;min-height:0;overflow-y:auto;padding:40px;background:#14151b}
#cs-home-inner{max-width:880px;margin:0 auto}
.cs-kicker{font-size:11px;font-weight:750;letter-spacing:.16em;color:#d3a45d}
#cs-home h1{margin:18px 0 8px;font-size:clamp(32px,5vw,54px);letter-spacing:-.05em}
#cs-home p{color:#b7bbc7;line-height:1.6;max-width:640px}
.cs-home-actions{display:flex;gap:10px;flex-wrap:wrap;margin:26px 0 34px}
#cs-home button{color:#f5f5f5;background:#2e3038;border:1px solid #4b4e59;border-radius:9px;min-height:44px;padding:11px 15px;font-weight:650}
#cs-home h2{font-size:16px;margin:20px 0 14px}
#cs-preset-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#cs-preset-grid button{display:flex;flex-direction:column;gap:8px;align-items:flex-start;text-align:left;padding:12px;min-height:155px}
.cs-preset-art{width:100%;height:85px;display:grid;place-items:center;background:#242631;border-radius:5px}
.cs-preset-art:before{content:'';display:block;width:var(--w);height:var(--h);background:linear-gradient(130deg,#7c8faa,#3f546e);border-radius:2px}
#cs-preset-grid small{color:#9ea5b4}
#cs-home .cs-home-note{font-size:12px;margin:25px 0 0}
#cs-video{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;padding:18px;background:#15171b}
#cs-video .video-grid{display:grid;grid-template-columns:minmax(265px,330px) minmax(0,1fr);gap:18px;max-width:1300px;margin:auto}
#cs-video :is(.video-panel,.video-preview){min-width:0;padding:16px;border:1px solid #44474f;border-radius:11px;background:#22252b}
#cs-video input,#cs-video select{max-width:100%}
#cs-video button{min-height:39px;padding:7px 12px;border-radius:7px;background:#333841;color:#f3f3f3;border:1px solid #555c69}
#cs-video canvas{max-height:62dvh;max-width:100%;object-fit:contain}
body.cs-v2 #toast{z-index:200!important;bottom:54px!important}
body.cs-v2 .studio-update-notice{z-index:210!important}
@media(max-width:1050px) and (min-width:851px){#cs-inspector{flex-basis:315px;width:315px}#cs-rail{flex-basis:65px;width:65px}#cs-rail button{width:56px}}
/* Touch devices: the inspector is a docked ROW in normal layout, not a popup over the canvas. */
@media(max-width:850px){
 #cs-app{height:100dvh;max-height:100dvh}
 #cs-top{flex:0 0 50px;height:50px;padding:0 7px;gap:5px}
 #cs-top button,#cs-top a{min-width:31px;height:33px;min-height:33px;padding:0 8px;font-size:11px}
 #cs-top .cs-icon{font-size:20px}
 #cs-mark{font-size:12px;gap:4px}
 .cs-logo{width:25px;height:25px;font-size:17px}
 #cs-top-divider,#cs-top-project,#cs-top .cs-desktop{display:none!important}
 #cs-editor{flex-direction:column}
 #cs-center{order:1;flex:1 1 auto;min-height:0;overflow:hidden}
 #cs-stage-head{flex:0 0 34px;height:34px;padding:0 11px}.cs-doc-head{gap:6px;font-size:11px}.cs-doc-head small{font-size:10px}.cs-stage-actions{display:none}
 body.cs-v2 #cs-pages-mount #studioPages{height:43px;min-height:43px;padding:5px 8px!important;gap:6px}
 body.cs-v2 #cs-pages-mount button{height:31px;min-height:31px;padding:5px 9px!important}
 #cs-stage{padding:8px;overflow:auto}
 #cs-status{height:32px;flex:0 0 32px;padding:0 8px 0 11px}
 #cs-zoom{gap:3px}#cs-zoom button{min-width:23px;height:24px;min-height:24px;padding:0 4px}
 #cs-inspector{order:2;flex:0 0 207px;width:100%;height:207px;max-height:207px;min-height:0;border:0;border-top:1px solid var(--cs-border);border-radius:0!important}
 #cs-inspector.cs-expanded{flex-basis:min(46dvh,360px);height:min(46dvh,360px);max-height:min(46dvh,360px)}
 #cs-inspector-head{flex:0 0 40px;min-height:40px;padding:4px 12px}#cs-panel-title{font-size:13px}#cs-eyebrow{font-size:8px}#cs-expand{display:block}
 #cs-tabs{padding:4px 8px;min-height:40px}#cs-tabs button{min-height:30px;padding:4px 9px}
 #cs-inspector-body{padding:9px 13px 15px}
 #cs-rail{order:3;flex:0 0 calc(62px + env(safe-area-inset-bottom));height:calc(62px + env(safe-area-inset-bottom));width:100%;min-width:0;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:3px;padding:4px 7px env(safe-area-inset-bottom);border:0;border-top:1px solid #44464e;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:thin;scrollbar-color:#525662 transparent}
 #cs-rail button{flex:0 0 62px;width:62px;min-width:62px;min-height:49px;padding:3px 1px;font-size:10px;scroll-snap-align:start}
 #cs-rail .cs-rail-icon{font-size:20px}
 #cs-home{padding:22px 15px}#cs-preset-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 #cs-video{padding:8px}#cs-video .video-grid{display:flex;flex-direction:column-reverse}
 #cs-video canvas{max-height:32dvh}
}
@media(max-width:390px){#cs-mark>span:last-child{display:none}#cs-top button{padding:0 6px}#cs-top{gap:4px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition-duration:0s!important}}
/* Reset legacy page-tab ordering: Pages must appear before the counter and actions. */
body.cs-v2 #cs-pages-mount #studioPages .page-tabs{order:0!important}
body.cs-v2 #cs-pages-mount #studioPages #pageCounter{order:1!important}
body.cs-v2 #cs-pages-mount #studioPages #addPage{order:2!important}
body.cs-v2 #cs-pages-mount #studioPages #clearPage{order:3!important}


/* Studio 2.2: matching the legacy navy/blue brand, new text and photo effect controls. */
.text-effects-stack{display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px;padding:7px 0}
.text-effects-stack>strong{width:100%;font-size:12px}
.text-fx-toggle{display:inline-flex!important;align-items:center;gap:6px;min-width:130px;width:auto!important;background:#292a31;border:1px solid #40424b;border-radius:7px;padding:7px!important;font-size:12px}
.text-fx-toggle input[type=checkbox]{width:16px;min-width:16px;height:16px;accent-color:#e4aa4b}
.text-effect-value{display:flex;align-items:center;gap:7px;width:100%;min-width:0}
.text-effect-value input[type=range]{flex:1;min-width:50px}
.text-effect-value input[type=number]{flex:0 0 59px;width:59px;max-width:59px;height:32px;padding:4px;text-align:center}
.photo-effects-controls{display:flex;flex-direction:column;gap:10px;min-width:0;width:100%}
.photo-effects-controls>strong{font-size:12px;margin-top:6px;color:#f5d8a8}
.cs-photo-effect-thumbs{display:flex;overflow-x:auto;overflow-y:hidden;gap:8px;max-width:100%;padding:5px 1px;scrollbar-width:thin;touch-action:pan-x}
.cs-photo-effect{display:flex;flex-direction:column;align-items:center;gap:3px;flex:0 0 96px!important;width:96px!important;border:1px solid #40424b!important;border-radius:9px;background:#202126;color:#f5d8a8;padding:3px!important;cursor:pointer}
.cs-photo-effect.selected{border-color:#e4aa4b!important;box-shadow:0 0 0 1px #e4aa4b inset}
.cs-photo-effect canvas{width:90px;height:72px;object-fit:cover;border-radius:6px}
.cs-photo-effect small{font-size:10px;white-space:nowrap}
.cs-effect-color{display:flex!important;align-items:center;justify-content:space-between;gap:6px}
.cs-effect-color input[type=color]{width:54px;height:30px}
/* 2.2 workspace navigation: video editor has a persistent direct path back to photos. */
#cs-mode-switch{display:flex;align-items:center;flex:0 0 auto;gap:2px;padding:3px;border:1px solid #40424b;border-radius:9px;background:#222328;white-space:nowrap}
#cs-top #cs-mode-switch button{min-width:auto;height:31px;min-height:31px;padding:0 11px;border:1px solid transparent;border-radius:6px;background:transparent;color:#c7c3bb;font-size:12px;font-weight:750}
#cs-top #cs-mode-switch button.active{border-color:#b88944;background:#614626;color:#fff}
#cs-top #cs-mode-switch button:hover:not(.active){background:#313239}
#cs-video-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1300px;margin:0 auto 13px;padding:8px 12px;border:1px solid #3b3e47;border-radius:9px;background:#222328}
#cs-video-nav strong{font-size:14px;color:#f4f5fa}
#cs-video-nav #cs-video-to-photo{min-height:36px;padding:7px 13px;border:1px solid #b88944;border-radius:7px;background:#614626;color:white;font-weight:700}
@media(max-width:850px){
 #cs-top #cs-mode-switch{margin-right:auto}
 #cs-video-nav{margin:0 0 10px}
}
@media(max-width:590px){
 #cs-top #cs-mark,#cs-top #cs-top-project,#cs-top-divider,#cs-site-link{display:none!important}
 #cs-top{gap:4px!important;padding:0 5px!important}
 #cs-top #cs-mode-switch{padding:2px;gap:1px}
 #cs-top #cs-mode-switch button{padding:0 6px;font-size:11px}
 #cs-top .cs-mode-long{display:none}
 #cs-top #cs-save{padding:0 6px}
 #cs-top #cs-export{padding:0 7px}
 #cs-top .cs-spacer{display:none}
}
#cs-top button[hidden]{display:none!important}
#cs-top #cs-export{display:flex!important;align-items:center;justify-content:center;gap:4px}
@media(max-width:360px){
 #cs-top #cs-export .cs-export-label{display:none}
 #cs-top #cs-export{min-width:32px;max-width:32px;padding:0 6px}
 #cs-top #cs-save{min-width:38px;padding:0 5px}
 #cs-top .cs-icon{min-width:29px;padding:0 4px}
}



/* Creative Studio 2.4 — PHONE-FIRST SETTINGS
   Mobile only. Desktop layout and functionality above remain unchanged.
   Scroll vertically to view edit controls: no draggable slider lives in a sideways settings carousel.
   Tool tabs and gallery thumbnails are the ONLY horizontally scrolling control strips.
*/
@media(max-width:850px){
  #cs-app{--cs-mobile-rail:calc(61px + env(safe-area-inset-bottom));}
  #cs-editor{position:relative;isolation:isolate;flex-direction:column;}
  #cs-center{order:1;flex:1 1 auto;min-height:160px;width:100%;}
  #cs-rail{order:3;flex:0 0 var(--cs-mobile-rail)!important;height:var(--cs-mobile-rail)!important;
    width:100%!important;min-width:0;display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;
    background:#1b1c20;border-top:1px solid #44464e;border-right:0;gap:3px;
    overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;touch-action:pan-x;scrollbar-width:none;
    padding:4px 7px env(safe-area-inset-bottom);}
  #cs-rail::-webkit-scrollbar,#cs-tabs::-webkit-scrollbar{display:none;}
  #cs-rail button{flex:0 0 61px!important;width:61px!important;min-width:61px!important;
    height:49px;min-height:49px;padding:3px 2px!important;gap:2px;font-size:10px;line-height:1.15;}
  #cs-rail .cs-rail-icon{font-size:20px;line-height:1.1;}
  #cs-rail button.active{background:#3b352a;border-color:#b88944;color:#ffe1a4;}
  #cs-inspector{order:2;position:relative!important;inset:auto!important;
    flex:0 0 clamp(198px,32dvh,310px)!important;
    height:clamp(198px,32dvh,310px)!important;
    min-height:0!important;max-height:clamp(198px,32dvh,310px)!important;
    width:100%!important;max-width:100%!important;
    border:0;border-top:1px solid #484850;border-radius:0!important;
    background:#202126;overflow:hidden!important;box-shadow:none!important;z-index:4;}
  #cs-inspector.cs-expanded:not(.cs-gallery){flex:0 0 min(48dvh,420px)!important;
    height:min(48dvh,420px)!important;max-height:min(48dvh,420px)!important;}
  #cs-inspector-head{height:38px;min-height:38px;flex:0 0 38px;padding:3px 11px;
    background:#25262c;border-bottom:1px solid #3b3e47;}
  #cs-inspector-head>div:first-child{flex-direction:row;gap:8px;align-items:center;}
  #cs-eyebrow{display:none!important;}
  #cs-panel-title{font-size:13px;}
  #cs-mobile-swipe{display:inline!important;font-size:10px;color:#d9bc90;white-space:nowrap;}
  #cs-inspector-head button{height:30px;min-height:30px;width:30px;font-size:19px;}
  #cs-expand{display:block!important;}
  #cs-tabs{display:flex;flex:0 0 40px;min-height:40px;max-height:40px;flex-flow:row nowrap;
    gap:6px;padding:5px 9px;align-items:center;white-space:nowrap;
    overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch;
    touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:none;}
  #cs-tabs:empty{display:none!important;}
  #cs-tabs button{flex:0 0 auto;min-height:30px;height:30px;max-height:30px;
    white-space:nowrap;padding:4px 10px;font-size:11px;}
  /* Each settings group is now a simple, vertically scrollable page with full-width controls. */
  #cs-inspector-body,#cs-inspector.cs-expanded:not(.cs-gallery) #cs-inspector-body{
    display:block!important;flex:1 1 auto;min-width:0!important;min-height:0!important;
    height:auto!important;max-height:none!important;width:100%!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;touch-action:pan-y;
    padding:12px 14px 26px!important;scrollbar-width:thin;scrollbar-color:#64666e transparent;}
  #cs-inspector-body>*{width:100%!important;min-width:0!important;max-width:100%!important;
    height:auto!important;max-height:none!important;flex:none!important;margin:0 0 12px!important;}
  #cs-inspector-body .cs-hint{font-size:12px;line-height:1.5;margin:0 0 11px!important;overflow:visible;}
  #cs-inspector-body>button.cs-action,#cs-inspector-body>button.cs-action-primary{
    width:100%!important;max-width:100%!important;min-height:42px;height:auto!important;
    padding:10px 12px!important;margin:0 0 10px!important;text-align:left;font-size:12px;
    white-space:normal;}
  #cs-inspector-body .cs-field-row{display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;width:100%!important;}
  #cs-inspector-body .cs-field-row label,
  #cs-inspector-body>label.cs-field{width:100%!important;max-width:100%!important;
    min-width:0!important;height:auto!important;margin:0 0 12px!important;
    font-size:12px;gap:6px;}
  #cs-inspector-body :is(input:not([type=range]),select,textarea){
    display:block;width:100%!important;min-width:0!important;max-width:100%!important;
    min-height:42px!important;height:auto;padding:8px 10px;}
  #cs-inspector-body input[type=color]{height:43px!important;min-height:43px!important;}
  #cs-inspector-body input[type=range]{display:block!important;width:100%!important;
    min-width:0!important;max-width:100%!important;min-height:30px!important;height:30px!important;
    accent-color:#e4aa4b;}
  #cs-inspector-body #selectedTools{display:flex!important;flex-direction:column!important;
    height:auto!important;max-height:none!important;min-height:0!important;
    width:100%!important;max-width:100%!important;overflow:visible!important;padding:0!important;margin:0!important;}
  #cs-inspector-body #selectedTools>details.editor-group{
    display:block!important;flex:0 0 auto!important;width:100%!important;
    height:auto!important;max-height:none!important;overflow:visible!important;}
  #cs-inspector-body #selectedTools>details.editor-group[hidden]{display:none!important;}
  #cs-inspector-body #selectedTools>details.editor-group>.editor-group-body{
    display:flex!important;flex-flow:column nowrap!important;align-items:stretch;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:auto!important;max-height:none!important;gap:12px!important;
    overflow:visible!important;margin:0!important;padding:0!important;touch-action:auto;}
  #cs-inspector-body #selectedTools>details.editor-group:not([open])>.editor-group-body{display:none!important;}
  #cs-inspector-body #selectedTools>details.editor-group>.editor-group-body>*{
    flex:0 0 auto!important;min-width:0!important;max-width:100%!important;
    width:100%!important;height:auto!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:visible!important;}
  #cs-inspector-body #selectedTools label{display:flex;flex-direction:column;gap:7px;
    min-width:0!important;width:100%!important;max-width:100%!important;font-size:12px;overflow-wrap:break-word;}
  #cs-inspector-body #selectedTools .two{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;}
  #cs-inspector-body #selectedTools :is(.position-controls,.text-fx-controls,.crop-controls,.photo-effects-controls){
    display:flex!important;flex-direction:column!important;width:100%!important;
    max-width:100%!important;min-width:0!important;height:auto!important;max-height:none!important;
    overflow:visible!important;gap:12px!important;padding:9px!important;}
  #cs-inspector-body #selectedTools .position-controls{padding:0!important;}
  #cs-inspector-body #selectedTools .position-nudge{display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;}
  #cs-inspector-body #selectedTools .position-nudge button{min-width:0!important;
    width:100%!important;max-width:100%!important;min-height:43px!important;padding:8px 3px!important;}
  #cs-inspector-body #selectedTools .position-slider-controls{display:grid!important;
    grid-template-columns:minmax(0,1fr) 63px 16px!important;gap:7px!important;min-width:0!important;}
  #cs-inspector-body #selectedTools .position-slider-controls input[type=number]{
    width:63px!important;max-width:63px!important;min-width:0!important;}
  #cs-inspector-body #selectedTools .text-effects-stack{display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  #cs-inspector-body #selectedTools .text-effects-stack>strong{grid-column:1/-1;}
  #cs-inspector-body #selectedTools .text-fx-toggle{width:100%!important;min-width:0!important;
    flex-flow:row nowrap!important;align-items:center;gap:6px!important;padding:8px!important;}
  #cs-inspector-body #selectedTools .text-fx-toggle input[type=checkbox]{
    flex:0 0 16px!important;width:16px!important;max-width:16px!important;
    height:16px!important;min-height:16px!important;}
  #cs-inspector-body #selectedTools .text-effect-value{display:flex!important;
    flex-flow:row nowrap!important;align-items:center;gap:7px;}
  #cs-inspector-body #selectedTools .text-effect-value input[type=number]{
    flex:0 0 62px!important;width:62px!important;max-width:62px!important;}
  #cs-inspector-body #selectedTools .crop-shape-grid{display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px;}
  #cs-inspector-body #selectedTools .photo-preset-picker.cs-has-thumbnails select{display:none!important;}
  #cs-inspector-body #layerList{display:flex!important;flex-flow:column nowrap!important;
    width:100%!important;max-width:100%!important;overflow:visible!important;gap:8px!important;}
  #cs-inspector-body #layerList .layer{flex:0 0 auto!important;width:100%!important;
    min-width:0!important;max-width:100%!important;}
  /* Filter and creative-effects previews: horizontal ONLY for image thumbnails.
     Intensity sliders remain their own full-width row BELOW the thumbnails. */
  #cs-inspector-body :is(.cs-filter-thumbs,.cs-photo-effect-thumbs){
    display:flex!important;flex-flow:row nowrap!important;align-items:stretch;
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;
    touch-action:pan-x;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;
    gap:9px;padding:5px 1px 12px;scrollbar-width:thin;scrollbar-color:#746142 transparent;}
  #cs-inspector-body .cs-filter-thumb{flex:0 0 100px!important;width:100px!important;max-width:100px!important;}
  #cs-inspector-body .cs-photo-effect{flex:0 0 105px!important;width:105px!important;
    min-width:105px!important;max-width:105px!important;}
  #cs-inspector-body .cs-photo-effect canvas{width:95px!important;max-width:95px!important;}
  /* This is the only inspector presentation allowed to float over the artwork. */
  #cs-inspector.cs-gallery{position:absolute!important;left:0!important;right:0!important;
    top:auto!important;bottom:var(--cs-mobile-rail)!important;z-index:15;
    width:100%!important;flex:0 0 auto!important;
    height:min(53dvh,450px)!important;max-height:min(53dvh,450px)!important;
    min-height:min(250px,45dvh)!important;border-top:1px solid #b88944;
    box-shadow:0 -14px 35px #000b!important;}
  #cs-inspector.cs-gallery #cs-inspector-body{overflow-y:auto!important;overflow-x:hidden!important;}
  #cs-inspector.cs-gallery #cs-expand{display:none!important;}
}
@media(max-width:360px){
 #cs-inspector-head{padding:4px 8px;}
 #cs-mobile-swipe{font-size:9px;}
 #cs-inspector-body #selectedTools .two{grid-template-columns:minmax(0,1fr)!important;}
 #cs-inspector-body #selectedTools .text-effects-stack{grid-template-columns:minmax(0,1fr)!important;}
 #cs-rail button{flex-basis:59px!important;width:59px!important;min-width:59px!important;}
}
