/* The phone canvas is the workspace; controls live in a short, collapsible tray. */
.phone-text-tool,.tool-drawer{display:none}
@media(max-width:960px){
 html:has(body.mobile-editor){height:100%;overflow:hidden}
 body.mobile-editor{position:fixed;inset:0;top:var(--editor-top,0px);height:var(--editor-height,100dvh);padding:0;overflow:hidden;overscroll-behavior:none;background:#fff}
 .mobile-editor .topbar,.mobile-editor .studio-top,.mobile-editor .under-stage,.mobile-editor .preset-row,.mobile-editor .studio-note,.mobile-editor .project-actions,.mobile-editor .mobile-nav{display:none!important}
 .mobile-editor .workspace,.mobile-editor .studio{display:block;width:100%;height:100%;min-height:0;margin:0;padding:0;max-width:none;overflow:hidden}
 .mobile-editor #previewDock{position:relative;inset:auto;display:flex;flex-direction:column;width:100%;height:100%;min-height:0;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;overflow:hidden}
 .mobile-editor #previewDock .stage{position:relative;flex:1 1 0;height:auto!important;min-height:0;width:100%;overflow:hidden}
 .mobile-editor #artboard{height:100%;width:100%;display:block;touch-action:none}
 .mobile-editor .stage-corner,.mobile-editor .stage-bottom{display:none}
 .mobile-editor #previewDock .stage-toolbar{height:calc(44px + env(safe-area-inset-top));min-height:44px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:0;padding:env(safe-area-inset-top) 4px 0;border-bottom:1px solid #e7edf2}
 .mobile-editor #selectedName,.mobile-editor #focusCanvas{display:none}
 .mobile-editor .background-picker{display:flex;gap:0;flex-shrink:0}
 .mobile-editor .bg-option{height:44px;width:24px;padding:0;border-radius:9px}
 .mobile-editor #fit{width:40px;height:44px;padding:0;font-size:11px;flex-shrink:0}
 .mobile-editor .header-actions{display:flex;gap:0;align-items:center;margin:0}
 .mobile-editor .header-actions button{width:44px;height:44px;min-height:44px;padding:0;margin:0;background:transparent;border:0;border-radius:9px;color:#4e728c;font-size:11px;display:flex;align-items:center;justify-content:center}
 .mobile-editor .header-actions svg{width:19px;height:19px}
 .mobile-editor .header-actions #save{color:#168eba;font-weight:600}
 .mobile-editor .header-actions #exportTop{background:#e4f6ff;color:#168eba}
 .mobile-editor #openDrafts{font-size:22px}
 .mobile-editor .tool-strip{flex:0 0 auto;display:flex;height:calc(60px + env(safe-area-inset-bottom));padding:3px 3px calc(3px + env(safe-area-inset-bottom));gap:0;border-top:1px solid #dce7ef;z-index:2}
 .mobile-editor .tool-strip button{min-width:0;flex:1;min-height:54px;height:54px;gap:2px;font-size:10px;padding:4px 0;border-radius:9px}
 .mobile-editor .tool-strip button b,.mobile-editor .tool-strip button>svg{height:27px;width:27px;font-size:20px}
 .mobile-editor .phone-text-tool{display:flex}
 .mobile-editor .tool-drawer{display:flex;flex-direction:column;flex:0 0 min(232px,calc(var(--editor-height,100dvh) * .27));min-height:0;border-top:1px solid #cee3ef;background:#fff;overflow:hidden}
 .mobile-editor .drawer-heading{height:44px;flex-shrink:0;display:flex;align-items:center;padding-left:14px;border-bottom:1px solid #edf2f6;gap:10px}
 .mobile-editor .drawer-heading strong{font-size:12px;color:#3a5b72}
 .mobile-editor .drawer-heading span{font-size:9px;color:#8da1b1;flex:1}
 .mobile-editor #closeTools{height:44px;width:44px;flex-shrink:0;font-size:25px;color:#398aae}
 .mobile-editor #mobileContent{display:block!important;flex:1;min-height:0;height:auto;margin:0;padding:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scroll-padding:10px;-webkit-overflow-scrolling:touch}
 .mobile-editor #mobileContent>[data-drawer-panel]{display:block!important;margin:0;border:0;border-radius:0;padding:12px 14px;max-height:none;overflow:visible;scroll-margin:0}
 .mobile-editor #mobileContent>[data-drawer-panel][hidden],.mobile-editor #toolDrawer[hidden]{display:none!important}
 .mobile-editor #mobileContent>.text-dock{display:flex!important;flex-direction:column;gap:8px;align-items:stretch;min-height:0;height:auto}
 .mobile-editor #mobileContent .text-dock label{font-size:9px;max-width:45px}
 .mobile-editor #mobileContent .text-dock textarea{min-width:0;flex:1;min-height:44px;height:44px;line-height:32px;font-size:22px}
 .mobile-editor #mobileContent .text-dock .iconbutton{height:44px;width:44px;flex-shrink:0}
 .mobile-editor #mobileContent .panel-heading,.mobile-editor #mobileContent .action-heading .eyebrow,.mobile-editor #mobileContent .action-heading h2,.mobile-editor #mobileContent .quick-color-head .eyebrow{display:none}
 .mobile-editor #actionControls .action-heading{float:right;margin:0 0 5px 10px}
 .mobile-editor #actionControls .action-reset{min-height:32px}
 .mobile-editor .action-slider-grid{clear:both;gap:10px 16px}
 .mobile-editor .slider-guide{display:none}
 .mobile-editor .action-slider input[type=range]{height:36px}
 .mobile-editor .slider-step{height:36px}
 .mobile-editor #shapeAdvanced{min-height:36px;align-items:center;font-size:11px}
 .mobile-editor .action-shortcuts{margin-top:5px;padding-top:8px}
 .mobile-editor #mobileContent .font-list{max-height:none;height:auto;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr))}
 .mobile-editor #mobileContent .font-card{min-height:99px}
 .mobile-editor #mobileContent .searchbox{min-height:40px;margin-bottom:9px}
 .mobile-editor #mobileContent .library{position:relative}
 .mobile-editor #mobileContent .library .searchbox{padding-right:44px}
 .mobile-editor #mobileContent .categories{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;margin:0 0 9px;padding:2px 0}
 .mobile-editor #mobileContent .categories button{white-space:nowrap;flex:0 0 auto;min-height:32px;font-size:10px}
 .mobile-editor #mobileContent .library-toolbar{position:absolute;top:12px;right:14px;margin:0;height:40px}
 .mobile-editor #mobileContent .library-toolbar #results{display:none}
 .mobile-editor #favoriteFilter{width:40px;height:40px}
 .mobile-editor #mobileContent .range-control{margin:12px 0}
 .mobile-editor .photo-hint{margin:8px 0}
 .mobile-editor .photo-name{margin:10px 0}
 .mobile-editor .canvas-zoom{right:8px;bottom:8px;border-radius:24px}
 .mobile-editor .canvas-zoom button{width:44px;height:44px}
 .mobile-editor .canvas-zoom output{font-size:11px;min-width:38px}
 .mobile-editor #toast{bottom:calc(70px + env(safe-area-inset-bottom));z-index:30;max-width:calc(100% - 24px)}
 .mobile-editor dialog{max-height:calc(var(--editor-height,100dvh) - 24px);max-width:calc(100vw - 24px);overflow:auto}
}
@media(max-width:359px){.mobile-editor .header-actions button{width:40px}.mobile-editor #fit{width:30px}.mobile-editor .bg-option{width:22px}.mobile-editor .tool-strip button{font-size:9px}.mobile-editor .drawer-heading span{display:none}}
