*{box-sizing:border-box}body{margin:0;background:#171a23;color:#f4f5fa;font:14px system-ui,-apple-system,sans-serif}button,.button,select,input{font:inherit}button,.button{background:#303849;border:1px solid #4b566e;color:white;border-radius:9px;padding:10px;cursor:pointer;text-align:center}button:focus-visible,.button:focus-visible{outline:2px solid #69c8ff}button:hover,.button:hover{background:#40506a}header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:#10131b;border-bottom:1px solid #303749;min-height:60px}header strong{font-size:15px;letter-spacing:.05em}header small{font-size:10px;color:#9aa6bc}.brand{color:#e7eaf4;text-decoration:none}.actions{display:flex;gap:6px}.actions button{padding:8px}#export,.primary{background:#2468bc}main{display:grid;grid-template-columns:260px minmax(0,1fr) 260px;height:calc(100dvh - 60px)}aside{padding:16px;background:#202531;overflow-y:auto;display:flex;flex-direction:column;gap:10px}#tools{border-right:1px solid #3a4151}#layers{border-left:1px solid #3a4151}h2{font-size:15px;margin:4px 0 8px}label{display:flex;flex-direction:column;gap:6px}select,input[type=color],input[type=number],input[type=text]{background:#111722;color:white;border:1px solid #58627b;border-radius:7px;padding:8px;width:100%}input[type=color]{height:42px}.workspace{min-width:0;overflow:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;background:#151820;touch-action:pan-x pan-y}.canvas-wrap{width:min(100%,650px);max-height:calc(100% - 45px);display:flex;justify-content:center;align-items:center;overflow:hidden}canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;background:white;touch-action:none;box-shadow:0 10px 40px #0009}.hint{font-size:11px;line-height:1.5;color:#a6afc1;margin:6px 0}.layer{display:flex;align-items:center;gap:5px;padding:7px;background:#303849;border-radius:8px;margin-bottom:7px}.layer.active{outline:2px solid #67b8ff}.layer button{padding:6px;min-width:30px}.layer .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:transparent;border:0;color:white;text-align:left}.layer.muted .name{opacity:.45}.panel-title{display:flex;justify-content:space-between;align-items:center}.bottom,.mobile-only{display:none}#toast{position:fixed;bottom:70px;left:50%;transform:translateX(-50%);background:#303c53;border-radius:8px;padding:10px 18px;display:none;z-index:20}#selectedTools{display:grid;gap:8px}#selectedTools .two{display:grid;grid-template-columns:1fr 1fr;gap:6px}hr{width:100%;border:0;border-top:1px solid #41495a}@media(max-width:800px){header{padding:8px;flex-wrap:wrap;min-height:54px}header strong{font-size:12px}.brand{font-size:11px}.actions button{font-size:11px;padding:7px}.actions #save,.actions #export{display:none}main{display:block;height:calc(100dvh - 114px)}.workspace{height:100%;padding:8px;justify-content:center}.canvas-wrap{max-height:calc(100% - 48px)}aside{position:fixed;bottom:60px;left:0;right:0;z-index:10;max-height:72dvh;border-radius:18px 18px 0 0;border:1px solid #515b72;box-shadow:0 -8px 25px #0009;display:none}aside.open{display:flex}.bottom{display:grid;grid-template-columns:repeat(4,1fr);height:60px;position:fixed;bottom:0;left:0;right:0;background:#111621;gap:6px;padding:7px;z-index:11}.bottom button{padding:5px}.mobile-only{display:block}}
/* Adobe Express-inspired scrollable mobile action strip */
@media(max-width:800px){
.bottom{display:flex;align-items:stretch;gap:2px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;height:84px;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));bottom:0;white-space:nowrap} .bottom::-webkit-scrollbar{display:none}
.bottom button{background:transparent;border:0;min-width:78px;flex:0 0 78px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:11px;padding:4px 2px;scroll-snap-align:start}.bottom button span{font-size:24px;line-height:1.15;font-weight:500}.bottom button:active{background:#293248}
main{height:calc(100dvh - 138px - env(safe-area-inset-bottom,0px))} aside{bottom:calc(84px + env(safe-area-inset-bottom,0px))}#toast{bottom:105px}
.layer{flex-wrap:wrap}.layer .name{min-width:95px}.layer .trash{color:#ffb8b8;border-color:#8b4850}
}
.adjust-title{font-weight:700;margin:12px 0 0}.adjust-range{display:flex;flex-direction:column;gap:5px}.adjust-range input{width:100%;accent-color:#69baff}.adjust-range .adjust-value{color:#aab8d0;font-size:11px}
.layer .trash{color:#ffb8b8;border-color:#8b4850}

#selectedTools select{background:#111722;color:white;border:1px solid #58627b;border-radius:7px;padding:10px;width:100%;min-height:44px}#selectedTools select option{color:#111;background:#fff}

/* Context-sensitive editing dock: never overlays the artboard */
.mobile-editor-dock{display:none}
@media(max-width:800px){
.mobile-editor-dock{display:flex;flex-direction:column;position:fixed;bottom:0;left:0;right:0;height:174px;padding-bottom:env(safe-area-inset-bottom,0px);background:#111621;border-top:1px solid #495268;z-index:11}
.context-controls{height:85px;flex:0 0 85px;display:flex;align-items:center;gap:10px;overflow-x:auto;overflow-y:hidden;padding:7px 10px;scrollbar-width:none;white-space:nowrap}
.context-controls::-webkit-scrollbar{display:none}
.context-label{font-weight:700;font-size:12px;min-width:45px;color:#d6e5ff}
.context-field{display:flex;flex-direction:column;justify-content:center;gap:4px;flex:0 0 145px;font-size:11px;color:#e1e7f4}
.context-field:has(input[type=color]){flex-basis:90px}
.context-field:has(input[type=text]){flex-basis:170px}
.context-field input[type=range]{width:100%;accent-color:#70bbff}
.context-field input[type=text],.context-field select{height:35px;min-width:0;width:100%;padding:5px}
.context-field input[type=color]{height:34px;width:75px;padding:2px}
.context-controls>button{flex:0 0 auto;min-height:38px;padding:6px 10px}
.bottom{position:relative;bottom:auto;left:auto;right:auto;height:75px;flex:1 1 auto;padding-bottom:6px}
main{height:calc(100dvh - 228px - env(safe-area-inset-bottom,0px))}
aside{bottom:calc(174px + env(safe-area-inset-bottom,0px));max-height:45dvh}
#toast{bottom:calc(185px + env(safe-area-inset-bottom,0px))}
.workspace{min-height:0;height:100%;overflow:hidden}
.canvas-wrap{max-height:calc(100% - 36px)}
}

.font-picker-overlay{position:fixed;inset:0;z-index:9999;background:#07090bd9;display:flex;align-items:center;justify-content:center;padding:14px}
.font-picker-panel{background:#202635;border:1px solid #65718b;border-radius:15px;width:min(520px,100%);max-height:80dvh;display:flex;flex-direction:column;overflow:hidden}
.font-picker-heading{display:flex;justify-content:space-between;align-items:center;padding:12px 15px;border-bottom:1px solid #404b60}
.font-picker-list{overflow-y:auto;padding:10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.font-preview-choice{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;min-height:78px;font-size:24px;white-space:nowrap;overflow:hidden}
.font-preview-choice small{font:12px system-ui,sans-serif;color:#cbd4e8}
.font-preview-choice.active{outline:2px solid #77b9ff}
@media(max-width:600px){.font-picker-overlay{align-items:flex-end;padding:0}.font-picker-panel{border-radius:16px 16px 0 0;max-height:68dvh;width:100%}.font-preview-choice{font-size:21px}}

/* Creative Studio Android installation panel */
.studio-install-banner{display:flex;align-items:center;gap:14px;padding:10px 18px;background:#20253a;border-bottom:1px solid #48547a;color:#f7f7ff;font:14px system-ui,sans-serif}
.studio-install-banner>div{flex:1;min-width:0}.studio-install-banner strong{font-size:14px}.studio-install-banner p{margin:3px 0 0;color:#c7cde2;font-size:12px;line-height:1.35}.studio-install-banner button{border:1px solid #7888b9;background:#344269;color:white;border-radius:9px;padding:10px 12px;cursor:pointer;white-space:nowrap}.studio-install-banner #dismissInstallBanner{padding:7px 11px;background:transparent;border-color:transparent;font-size:20px}.studio-install-banner[hidden]{display:none!important}
@media(max-width:600px){.studio-install-banner{padding:9px;gap:7px}.studio-install-banner button{font-size:12px;padding:8px}.studio-install-banner p{font-size:11px}}

/* Direct text editing over the design canvas */
.studio-inline-text{position:absolute;z-index:40;box-sizing:border-box;padding:0 5px;white-space:pre-wrap;overflow-wrap:break-word;outline:2px solid #3c9fff;outline-offset:3px;background:transparent;caret-color:#149aff;touch-action:auto;user-select:text;-webkit-user-select:text;cursor:text;}
.studio-inline-text:focus{outline-color:#00b9fa;}

/* Creative Studio non-destructive image crop and shape controls */
.crop-controls{display:flex;flex-wrap:wrap;align-items:center;gap:9px;padding:10px;border:1px solid rgba(145,164,199,.28);border-radius:10px;background:rgba(16,20,35,.4)}
.crop-controls strong{width:100%;font-size:13px}
.crop-controls label{display:flex;flex-direction:column;gap:5px;min-width:120px;flex:1;font-size:12px}
.crop-controls select,.crop-controls input{max-width:100%;min-height:32px}
.crop-controls output{font-size:11px;opacity:.85}
.crop-controls button{align-self:end}

.studio-update-notice[hidden]{display:none!important}.studio-update-notice{position:fixed;z-index:9999;bottom:16px;left:50%;transform:translateX(-50%);width:min(94vw,510px);display:flex;align-items:center;justify-content:space-between;gap:16px;background:#181c29;color:#fff;border:1px solid #6a7bba;border-radius:14px;box-shadow:0 8px 30px #0009;padding:14px 16px;font-family:system-ui,sans-serif}.studio-update-notice p{font-size:12px;line-height:1.4;margin:5px 0 0;color:#c6cde0}.studio-update-actions{display:flex;gap:7px;flex-shrink:0}.studio-update-actions button{padding:9px 11px;border-radius:7px;border:1px solid #8b9acb;background:#304a91;color:white;cursor:pointer}.studio-update-actions button:last-child{background:transparent}@media(max-width:560px){.studio-update-notice{bottom:80px;align-items:stretch;flex-direction:column}.studio-update-actions button{flex:1}}

/* Contextual editing sidebar */
#selectedTools{display:flex;flex-direction:column;gap:9px}#selectedTools .editor-group{border:1px solid #46516a;border-radius:10px;background:#242c3b;overflow:visible}#selectedTools .editor-group>summary{cursor:pointer;padding:13px 12px;font-weight:700;list-style:none;display:flex;justify-content:space-between;align-items:center}#selectedTools .editor-group>summary:after{content:'▾';opacity:.7}#selectedTools .editor-group[open]>summary:after{content:'▴'}#selectedTools .editor-group-body{padding:3px 11px 12px;display:flex;flex-direction:column;gap:10px}#selectedTools .editor-group-body>label{display:flex;flex-direction:column;gap:5px}#selectedTools .editor-group-body input:not([type=range]),#selectedTools .editor-group-body select{max-width:100%;width:100%}#selectedTools .text-fx-controls{display:flex;flex-direction:column;gap:9px}#selectedTools .text-fx-controls>strong{display:none}#selectedTools .editor-subgroup{border:1px solid #4b5973;border-radius:8px;padding:8px}#selectedTools .editor-subgroup>summary{cursor:pointer;font-weight:600;padding:6px}#selectedTools .editor-subgroup>button{display:block;margin:6px 0;width:100%}#selectedTools .font-picker{position:relative;width:100%}#selectedTools .font-picker>summary{background:#182030;border:1px solid #596784;border-radius:8px;padding:12px;cursor:pointer;list-style:none}#selectedTools .font-picker-options{max-height:260px;overflow:auto;background:#192132;border:1px solid #667592;border-radius:8px;margin-top:4px;padding:5px;display:flex;flex-direction:column;gap:4px}#selectedTools .font-picker-options button{text-align:left;font-size:18px;min-height:43px}#tools>h2{margin:6px 0}#tools hr{width:100%;border:0;border-top:1px solid #3c465a}

/* Mobile: keep the canvas unobstructed; selected actions are compact and contextual. */
@media(max-width:800px){
.mobile-editor-dock{height:126px!important;max-height:calc(126px + env(safe-area-inset-bottom,0px));}
.context-controls{height:47px!important;flex:0 0 47px!important;gap:6px!important;padding:5px 10px!important;align-items:center!important;overflow-x:auto!important;}
.context-controls>button{min-height:34px!important;padding:6px 11px!important;font-size:12px!important;white-space:nowrap!important;}
.context-label,.context-field{display:none!important;}
.bottom{height:79px!important;flex:0 0 79px!important;}
main{height:calc(100dvh - 180px - env(safe-area-inset-bottom,0px))!important;}
aside{bottom:calc(126px + env(safe-area-inset-bottom,0px))!important;max-height:65dvh!important;}
.workspace{min-height:0!important;}
}

/* Position tool layout */
.position-controls{display:grid;gap:12px;min-width:0}.position-controls p{margin:0;color:#b9c5db;font-size:.86rem}.position-nudge{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.position-nudge button:first-child{grid-column:2}.position-nudge button:last-child{grid-column:2}.position-nudge button{min-width:0;padding:9px 3px}.position-flips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.position-flips button{min-width:0;white-space:normal}.position-precise{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.position-precise input,.position-controls input,.position-controls select{max-width:100%;box-sizing:border-box}

/* Mobile canvas-safe workspace: tools occupy layout space, never float over artwork. */
@media(max-width:800px){
 body:has(#photoWorkspace:not([hidden])){min-height:100dvh;overflow-x:hidden}
 #photoWorkspace main{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(190px,1fr) minmax(0,auto)!important;height:calc(100dvh - 205px - env(safe-area-inset-bottom,0px))!important;min-height:330px!important;overflow:hidden!important;position:relative}
 #photoWorkspace .workspace{grid-row:1;grid-column:1;height:100%!important;min-height:190px!important;padding:6px!important;overflow:hidden!important}
 #photoWorkspace .canvas-wrap{max-height:calc(100% - 30px)!important;max-width:100%!important}
 #photoWorkspace aside{position:relative!important;inset:auto!important;bottom:auto!important;left:auto!important;right:auto!important;grid-row:2;grid-column:1;z-index:1!important;display:none!important;max-height:min(35dvh,280px)!important;min-height:0!important;height:auto!important;border-radius:10px 10px 0 0!important;box-shadow:none!important;border:1px solid #45526a!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding:10px 12px!important}
 #photoWorkspace aside.open{display:flex!important}
 .mobile-editor-dock{position:relative!important;bottom:auto!important;left:auto!important;right:auto!important;height:126px!important;z-index:3!important}
 .font-picker-overlay{position:fixed!important;inset:auto 0 calc(126px + env(safe-area-inset-bottom,0px)) 0!important;z-index:25!important;align-items:flex-end!important;padding:0!important;background:transparent!important;pointer-events:none!important}
 .font-picker-panel{pointer-events:auto!important;max-height:min(33dvh,280px)!important;border-radius:12px 12px 0 0!important}
 .studio-update-notice:not([hidden]){bottom:calc(126px + env(safe-area-inset-bottom,0px))!important;max-height:28dvh;overflow:auto}
 #toast{bottom:calc(126px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:780px){
 #videoWorkspace .video-grid{display:flex!important;flex-direction:column!important;gap:10px!important}
 #videoWorkspace .video-preview{position:sticky!important;top:0!important;z-index:2!important;background:#171c29!important;padding:6px 0!important}
 #videoWorkspace .video-preview canvas{max-height:36dvh!important;width:auto!important;max-width:100%!important;margin:auto!important}
 #videoWorkspace .video-panel{max-width:100%!important;overflow:visible!important}
}

/* Installed Creative Studio app shell */
.studio-app-home{display:none}
.studio-installed .studio-app-home:not([hidden]){display:flex;position:fixed;inset:0;z-index:110;flex-direction:column;justify-content:center;align-items:center;gap:22px;padding:28px;background:linear-gradient(155deg,#11131b,#222943);color:#fff;text-align:center}
.studio-app-home h1{font-size:clamp(28px,7vw,42px);margin:0}.studio-app-home p{max-width:340px;color:#c1cbe0;margin:0}.studio-app-home .app-home-actions{display:grid;gap:12px;width:min(100%,330px)}.studio-app-home button{padding:17px;border:1px solid #66748d;border-radius:14px;background:#303e5b;color:white;font-size:1.05rem;font-weight:700}.studio-app-home button:first-child{background:#137fba;border-color:#137fba}
.studio-installed header .brand{display:none!important}.studio-app-home[hidden]{display:none!important}
.studio-home-button{display:none}.studio-installed .studio-home-button{display:inline-flex;align-items:center;justify-content:center}
@media(max-width:800px){.studio-installed header{gap:5px}.studio-installed header strong{font-size:12px}.studio-installed .studio-home-button{font-size:12px;padding:7px!important}}

/* Mobile: show one editor category at a time; never expose the entire desktop sidebar. */
@media(max-width:800px){
 #photoWorkspace #tools > :not(#selectedTools){display:none!important}
 #photoWorkspace #selectedTools > details.editor-group{display:none!important}
 #photoWorkspace #selectedTools > details.editor-group.mobile-group-active{display:block!important}
 #photoWorkspace #selectedTools > details.editor-group.mobile-group-active > summary{display:none!important}
 #photoWorkspace #selectedTools > details.editor-group.mobile-group-active > .editor-group-body{display:flex!important}
 #photoWorkspace #selectedTools > :not(details.editor-group){display:none!important}
 #photoWorkspace #tools{overflow-y:auto!important}
}


/* CREATIVE STUDIO / MODERN DARK — responsive visual system v1 */
:root{color-scheme:dark;--cs-bg:#0c0e13;--cs-panel:#151920;--cs-raised:#1d222c;--cs-border:#303744;--cs-ink:#f4f5f8;--cs-muted:#9ba7ba;--cs-accent:#a9a0ff;--cs-accent2:#72d9d0;--cs-radius:16px}
body{background:var(--cs-bg);color:var(--cs-ink);font-family:'DM Sans',system-ui,-apple-system,sans-serif;font-size:13px;letter-spacing:.005em}
header{background:#101319;border-bottom:1px solid #252b35;min-height:68px;padding:10px 20px;gap:16px;box-shadow:0 1px 0 #ffffff07}
header strong{font-size:16px;letter-spacing:.035em;font-weight:800}header small{font-size:9px;letter-spacing:.13em;text-transform:uppercase;border:1px solid #4c4968;padding:3px 6px;border-radius:50px;color:#b9b0ff;margin-left:5px}
header .brand{color:var(--cs-muted);font-size:12px}header .brand:hover{color:white}
button,.button{background:#242a35;border:1px solid #363f4e;color:#f5f6fa;border-radius:11px;padding:10px 12px;transition:background .15s,border-color .15s,transform .15s;min-height:38px;font-weight:600}
button:hover,.button:hover{background:#303848;border-color:#69758b}button:active{transform:scale(.985)}button:focus-visible,.button:focus-visible{outline:2px solid var(--cs-accent);outline-offset:2px}
#export,.primary,#videoExport{background:#a99aff;color:#151322;border-color:#b7aaff;font-weight:800}#export:hover,.primary:hover,#videoExport:hover{background:#c1b8ff}
.actions{gap:8px;align-items:center}.actions #undo,.actions #redo{font-size:20px;width:40px;padding:5px}.actions #save{background:#252c38}
.studio-mode-picker{font-size:11px;font-weight:700;color:var(--cs-muted)!important;gap:5px}.studio-mode-picker select{font-size:13px;font-weight:700;min-width:146px}
main{grid-template-columns:290px minmax(0,1fr) 252px;height:calc(100dvh - 68px)}
aside{background:var(--cs-panel);padding:18px 15px;gap:12px;scrollbar-color:#424a58 transparent;scrollbar-width:thin}
#tools{border-right:1px solid #2c323d}#layers{border-left:1px solid #2c323d}
h2{font-size:12px;letter-spacing:.13em;text-transform:uppercase;color:#adb7c8;font-weight:800;margin:7px 0 5px}
#tools>button,#tools>.button{min-height:43px;text-align:left;padding-left:14px}
#tools>label:not(.button){font-size:12px;color:#c2cbd9;font-weight:600}
input[type=text],input[type=number],select,input[type=color],textarea,#selectedTools select{background:#0f131a;border:1px solid #394252;border-radius:10px;color:#f4f5fa;min-height:41px;padding:9px 11px}
input[type=color]{padding:4px;min-height:42px;cursor:pointer}input[type=range]{accent-color:var(--cs-accent);cursor:pointer}
.workspace{background-color:#0e1118;background-image:radial-gradient(#343b48 0.8px,transparent .8px);background-size:19px 19px;border:0;padding:24px;position:relative}
.canvas-wrap{width:min(100%,790px);max-height:calc(100% - 45px)}
#canvas{box-shadow:0 24px 85px #000b,0 0 0 1px #ffffff18;border-radius:2px}
.workspace>.hint{background:#171b23d9;border:1px solid #2b3240;border-radius:40px;padding:8px 14px;font-size:11px;margin-top:14px;color:#aeb8c9}
#selectedTools{gap:9px}#selectedTools .editor-group{background:#1b2029;border:1px solid #303948;border-radius:13px;overflow:hidden}#selectedTools .editor-group>summary{font-size:12px;padding:14px 13px;letter-spacing:.01em}#selectedTools .editor-group[open]>summary{background:#232936;color:#f4f1ff}#selectedTools .editor-group-body{padding:13px;gap:12px}
#selectedTools .editor-subgroup{border-radius:11px;border-color:#394252;background:#151a22}#selectedTools .font-picker>summary{background:#10141b;border-color:#3d4757;border-radius:10px}
#selectedTools .font-picker-options{background:#151b25;border-color:#424d60;border-radius:11px}
.layer{background:#202630;border:1px solid #343e4d;border-radius:11px;padding:9px 7px}.layer.active{outline:1px solid var(--cs-accent);border-color:var(--cs-accent);background:#2b2a3f}
.layer .name{font-size:12px}.layer button{min-height:32px;border-radius:8px}
.crop-controls{background:#161b24;border-color:#3a4455;border-radius:13px;padding:12px}
.font-picker-panel{background:#191e28;border-color:#434d60;box-shadow:0 24px 80px #000b}.font-preview-choice{background:#242b38}
.studio-install-banner{background:#1d2030;border-color:#37374e}.studio-app-home h1{font-weight:900;letter-spacing:-.04em}.studio-installed .studio-app-home:not([hidden]){background:radial-gradient(ellipse at 20% 15%,#353153 0%,transparent 48%),linear-gradient(155deg,#11141b,#181e2a)}
.studio-app-home button{background:#262c3b;border-radius:16px}.studio-app-home button:first-child{background:#a99aff;color:#171325;border-color:#a99aff}
.video-workspace{background:#0e1118}.video-panel{background:#171c25!important;border-color:#303948!important;border-radius:16px!important}.video-preview{background:#10141b!important;border-radius:16px!important}
@media(min-width:801px){#tools{padding-top:22px}#layers{padding-top:22px}.workspace{min-height:0}}
@media(max-width:800px){
 body{background:#0c0f15}header{min-height:58px;padding:7px 10px;gap:7px;background:#11151d;border-color:#2a303c}header strong{font-size:12px;letter-spacing:0}header small{display:none}.studio-mode-picker{font-size:10px}.studio-mode-picker select{min-width:0;max-width:124px;font-size:11px;padding:5px;min-height:33px}header .actions{gap:4px}header .actions button{border-radius:9px;min-height:33px}
 #photoWorkspace main{height:calc(100dvh - 190px - env(safe-area-inset-bottom,0px))!important;grid-template-rows:minmax(165px,1fr) minmax(0,auto)!important;min-height:0!important;background:#0d1017}
 #photoWorkspace .workspace{padding:12px 8px!important;min-height:155px!important;background-size:17px 17px}
 #photoWorkspace .workspace>.hint{font-size:10px;padding:5px 10px;margin:6px 0 0;text-align:center}
 #photoWorkspace aside{background:#181d27!important;border:1px solid #343c4b!important;border-radius:16px 16px 0 0!important;max-height:min(39dvh,340px)!important;padding:13px 15px!important;box-shadow:none!important}
 #photoWorkspace #selectedTools .editor-group.mobile-group-active{background:transparent;border:0;border-radius:0}
 #photoWorkspace #selectedTools .editor-group.mobile-group-active>.editor-group-body{padding:3px 0 12px;gap:12px}
 .mobile-editor-dock{height:132px!important;background:#131821!important;border-top:1px solid #323a48!important;box-shadow:0 -4px 24px #0005;}
 .context-controls{height:48px!important;flex:0 0 48px!important;padding:5px 10px!important;gap:7px!important}
 .context-controls>button{background:#252d3b!important;border:1px solid #3b4555!important;border-radius:9px!important;font-size:11px!important}
 .bottom{height:84px!important;flex:0 0 84px!important;gap:4px!important;padding:6px 8px calc(8px + env(safe-area-inset-bottom,0px))!important;background:transparent!important}
 .bottom button{min-width:70px!important;flex-basis:70px!important;border-radius:12px!important;color:#b8c3d3!important;font-size:10px!important;font-weight:700!important;gap:3px!important}
 .bottom button span{font-size:21px!important;color:#e0dcff!important}
 .bottom button:active,.bottom button:focus-visible{background:#34304e!important;color:#fff!important}
 #photoWorkspace .canvas-wrap{max-height:calc(100% - 30px)!important}
 .font-picker-overlay{bottom:calc(132px + env(safe-area-inset-bottom,0px))!important}
 .font-picker-panel{max-height:min(35dvh,310px)!important}
 .studio-update-notice:not([hidden]){bottom:calc(132px + env(safe-area-inset-bottom,0px))!important}
 #toast{bottom:calc(132px + env(safe-area-inset-bottom,0px))!important}
 #videoWorkspace .video-preview{background:#0d1119!important;border:1px solid #2c3443;padding:10px!important}
 #videoWorkspace .video-panel{border-radius:14px!important}
}
@media(max-width:390px){header .brand{display:none}header .studio-mode-picker select{max-width:105px}.bottom button{min-width:65px!important;flex-basis:65px!important}}
@media(prefers-reduced-motion:reduce){button,.button{transition:none}}

/* Focused crop workspace — fewer controls, large direct manipulation targets */
.crop-redesign{display:flex;flex-direction:column;gap:12px!important}.crop-redesign .crop-heading{display:flex;flex-direction:column;gap:3px}.crop-redesign .crop-heading small,.crop-tip{color:#aab2c1;font-size:12px;line-height:1.4;margin:0}.crop-shape-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.crop-shape{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;padding:10px 2px!important;border-radius:12px!important;background:#242a35!important;border:1px solid #384254!important;color:#dce2ee!important}.crop-shape span{font-size:24px;line-height:1.1}.crop-shape small{font-size:10px}.crop-shape.active,.crop-mode-switch button.active,.crop-move-btn.active{background:#494067!important;border-color:#b2a2ff!important;color:#fff!important}.crop-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px}.crop-mode-switch button{padding:10px!important;background:#242a35!important;border:1px solid #384254!important;border-radius:10px!important}.crop-action-row{display:flex;gap:8px}.crop-action-row button:first-child{flex:1}.crop-action-row button{padding:10px!important;border-radius:10px!important}.crop-zoom{display:grid!important;grid-template-columns:1fr auto;gap:6px!important}.crop-zoom input{grid-column:1/-1;width:100%}.crop-zoom output{justify-self:end}.crop-tip{font-size:11px}
@media(max-width:800px){#photoWorkspace aside{max-height:min(31dvh,260px)!important;padding:10px 12px!important}#photoWorkspace main{grid-template-rows:minmax(210px,1fr) minmax(0,auto)!important}.crop-shape-grid{gap:4px}.crop-shape{padding:7px 1px!important}.crop-shape span{font-size:21px}.crop-redesign{gap:9px!important}.crop-tip{display:none}.workspace>.hint{display:none!important}.context-controls>button{min-width:fit-content}.bottom button{font-size:10px!important}}

/* Mobile workspace v2: one canvas, one compact context rail, one in-flow inspector. */
@media (max-width:800px){
 #photoWorkspace{min-width:0;overflow:hidden}
 #photoWorkspace main{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(160px,1fr) auto!important;height:calc(100dvh - 190px - env(safe-area-inset-bottom,0px))!important;min-height:0!important;overflow:hidden!important}
 #photoWorkspace .workspace{grid-row:1!important;min-height:0!important;height:100%!important;overflow:hidden!important;padding:8px!important}
 #photoWorkspace .canvas-wrap{max-height:calc(100% - 16px)!important;min-height:0!important}
 #photoWorkspace aside#tools,#photoWorkspace aside#layers{grid-row:2!important;grid-column:1!important;position:relative!important;inset:auto!important;bottom:auto!important;left:auto!important;right:auto!important;width:100%!important;max-width:100%!important;min-width:0!important;max-height:min(31dvh,280px)!important;height:auto!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;display:none!important;padding:10px 12px!important;border-radius:12px 12px 0 0!important;overscroll-behavior:contain!important;box-shadow:none!important}
 #photoWorkspace aside#tools.open,#photoWorkspace aside#layers.open{display:flex!important}
 #photoWorkspace #selectedTools{width:100%!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:8px!important}
 #photoWorkspace #selectedTools > details.editor-group{width:100%!important;min-width:0!important;max-width:none!important;margin:0!important}
 #photoWorkspace #selectedTools .editor-group-body{width:100%!important;min-width:0!important;max-width:none!important;display:flex;flex-direction:column;gap:10px}
 #photoWorkspace #selectedTools label,#photoWorkspace #selectedTools input,#photoWorkspace #selectedTools select,#photoWorkspace #selectedTools textarea{max-width:100%!important;min-width:0!important}
 #photoWorkspace #selectedTools button{min-width:0!important;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 #photoWorkspace #selectedTools .two{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%}
 #photoWorkspace #selectedTools .crop-shape-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;width:100%}
 #photoWorkspace #selectedTools .crop-shape{min-width:0!important;width:100%!important;padding:6px 1px!important;font-size:10px!important}
 #photoWorkspace #selectedTools .editor-group.mobile-group-active>.editor-group-body{display:flex!important}
 .mobile-editor-dock{display:flex!important;position:relative!important;inset:auto!important;width:100%!important;height:132px!important;flex:0 0 132px!important;min-height:0!important;z-index:4!important}
 .context-controls{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;width:100%!important;min-width:0!important;scrollbar-width:none;scroll-snap-type:x proximity;gap:7px!important;padding:5px 10px!important}
 .context-controls>button{flex:0 0 auto!important;white-space:nowrap!important;scroll-snap-align:start;min-width:fit-content!important;padding:7px 11px!important}
 .bottom{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;width:100%!important;min-width:0!important;scrollbar-width:none;gap:5px!important}
 .bottom button{flex:0 0 68px!important;min-width:68px!important;max-width:76px!important;padding:5px 3px!important}
}

/* Position controls: a compact, accessible D-pad on desktop and mobile. */
.position-controls .position-nudge{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(3,auto)!important;gap:6px!important;width:min(100%,310px)!important;max-width:100%!important;margin:10px auto 16px!important;align-items:stretch!important;justify-items:stretch!important;overflow:visible!important}
.position-controls .position-nudge>button{width:100%!important;min-width:0!important;max-width:none!important;min-height:42px!important;padding:8px 4px!important;white-space:nowrap!important;font-size:clamp(12px,1.2vw,14px)!important;line-height:1.2!important;box-sizing:border-box!important}
.position-controls .position-nudge-up{grid-column:2!important;grid-row:1!important}
.position-controls .position-nudge-left{grid-column:1!important;grid-row:2!important}
.position-controls .position-nudge-right{grid-column:3!important;grid-row:2!important}
.position-controls .position-nudge-down{grid-column:2!important;grid-row:3!important}
@media(max-width:700px){.position-controls .position-nudge{width:min(100%,280px)!important}.position-controls .position-nudge>button{font-size:13px!important;min-height:44px!important}}

/* Rotate / opacity: full visible range slider and compact exact numeric entry. */
#photoWorkspace .position-controls .position-slider{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
#photoWorkspace .position-controls .position-slider-controls{display:grid!important;grid-template-columns:minmax(0,1fr) 64px 16px!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
#photoWorkspace .position-controls .position-slider-controls input[type=range]{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;flex:none!important;margin:0!important;box-sizing:border-box!important;appearance:auto!important;-webkit-appearance:auto!important;touch-action:pan-y!important}
#photoWorkspace .position-controls .position-slider-controls input[type=number]{display:block!important;width:64px!important;min-width:0!important;max-width:64px!important;flex:none!important;padding:7px 3px!important;box-sizing:border-box!important;text-align:center!important;font-size:14px!important}
#photoWorkspace .position-controls .position-slider-controls>span{width:16px!important;min-width:0!important;text-align:left!important}
@media(max-width:400px){#photoWorkspace .position-controls .position-slider-controls{grid-template-columns:minmax(0,1fr) 58px 14px!important;gap:5px!important}#photoWorkspace .position-controls .position-slider-controls input[type=number]{width:58px!important;max-width:58px!important}}

.studio-extra-elements,.studio-draw-tools{display:grid;gap:8px;margin:12px 0;padding:10px;border:1px solid #485064;border-radius:10px}.studio-extra-elements button,.studio-draw-tools button{min-width:0}.studio-draw-tools label,.vector-edit label{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.studio-draw-tools input[type=number],.vector-edit input[type=number]{width:62px}.stock-placeholder{padding:9px;border:1px dashed #666;border-radius:8px}.stock-placeholder p{font-size:12px}.vector-edit{display:grid;gap:8px;margin:10px 0;padding:12px;border:1px solid #526079;border-radius:10px}#drawMode[aria-pressed=true]{outline:2px solid #45baff}

/* Multi-page project navigation */
.studio-pages{display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:100%;padding:10px 12px;background:#161a24;border:1px solid #394253;border-radius:12px;margin-bottom:12px;box-sizing:border-box}
.studio-pages .page-tabs{display:flex;gap:6px;overflow-x:auto;min-width:0;flex:1;padding-bottom:2px}
.studio-pages button{flex-shrink:0;padding:7px 11px;border:1px solid #475168;border-radius:8px;background:#272f40;color:#fff;cursor:pointer;font-size:13px}
.studio-pages button.page-active{background:#276a82;border-color:#60d5ed}
.studio-pages #pageCounter{font-size:12px;color:#cbd5e1;white-space:nowrap}
@media(max-width:800px){.studio-pages{gap:6px;padding:8px}.studio-pages .page-tabs{flex-basis:100%;order:2}.studio-pages #pageCounter{margin-right:auto}.studio-pages button{padding:7px 9px}}

/* Keep page actions visible in the desktop and mobile canvas workspace. */
#photoWorkspace .workspace{justify-content:flex-start!important;align-items:stretch!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
#photoWorkspace #studioPages{display:flex!important;visibility:visible!important;opacity:1!important;position:relative!important;z-index:3!important;flex:0 0 auto!important;width:100%!important;min-height:48px!important;margin:0 0 8px!important;align-items:center!important;justify-content:flex-start!important}
#photoWorkspace #studioPages #addPage{display:inline-flex!important;visibility:visible!important;align-items:center!important;background:#246b7b!important;color:white!important;border:1px solid #6cd3e8!important;font-weight:700!important}
#photoWorkspace #studioPages #clearPage{display:inline-flex!important;visibility:visible!important;align-items:center!important}
#photoWorkspace .canvas-wrap{flex:1 1 auto!important;min-height:0!important;max-height:none!important;width:100%!important}
@media(max-width:800px){#photoWorkspace #studioPages{min-height:44px!important;gap:5px!important}#photoWorkspace .canvas-wrap{min-height:110px!important}}
