.editor-panel-header{display:none}
.object-tools{display:none}
.object-tools.contour-tools{display:flex;align-items:center;gap:6px;flex-shrink:0;overflow-x:auto;padding:5px 8px;border-bottom:1px solid var(--border);background:#211b2b}
.object-tools button{flex:0 0 auto;white-space:nowrap;min-height:44px;padding:8px 12px;font-size:12px}
.object-tool-hint{flex:0 0 auto;font-size:11px;color:#bfb3cf;white-space:nowrap}
.image-quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.image-quick-actions button{font-size:11px;padding:8px}
.layer-selection-actions{flex-wrap:wrap}
.layer-selection-actions [aria-pressed=true],.object-tools [aria-pressed=true]{background:#ac91ff35;border-color:#c1a0ff;color:#edddff}
.crop-preview{display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(#302a3c 0% 25%,#231e2c 0% 50%) 0/18px 18px;padding:12px;border-radius:12px;min-height:100px;overflow:hidden}
.crop-preview canvas{display:block;max-width:100%;max-height:45dvh;width:auto;height:auto;touch-action:none;cursor:crosshair}
.crop-bottom{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.crop-bottom button{min-height:44px}
.processing-design .object-tools{pointer-events:none;opacity:.6}
@media(max-width:850px),(max-width:1024px) and (pointer:coarse){
  body.editor-active{overflow:hidden;overscroll-behavior:none}
  body.editor-active button{touch-action:manipulation}
  body.editor-active #toast{bottom:calc(78px + env(safe-area-inset-bottom,0px));max-width:calc(100% - 24px);pointer-events:none}
  body.editor-active .header{height:52px;min-height:52px;padding:6px 12px;gap:8px;flex-wrap:nowrap;align-content:normal}
  body.editor-active .header .brand{flex:1;min-width:0;font-size:14px}
  body.editor-active .header .brand-avatar{width:34px;height:34px;flex-shrink:0}
  body.editor-active .header .brand span{font-size:14px!important}
  body.editor-active .header .header-tools{flex:0 0 auto;max-width:none;flex-wrap:nowrap}
  body.editor-active .header #account-nav{flex-basis:auto}
  body.editor-active .header .avatar-dot{width:40px;height:40px}
  body.editor-active .header nav,body.editor-active .header-socials,body.editor-active #language-picker,body.editor-active .header .brand small,body.editor-active .header .crystal-nav,body.editor-active .header .nickname-medals,body.editor-active .header .badge,body.editor-active .header .user-name{display:none}
  .studio{height:var(--editor-height,calc(100dvh - 52px));min-height:0;min-width:0;width:100%;overflow:hidden;position:relative}
  .studio-top{height:auto;min-height:0;flex-shrink:0;flex-wrap:nowrap;flex-direction:column;align-items:stretch;padding:7px 8px;gap:5px}
  .studio-title{height:44px;min-width:0;flex:none;gap:6px}
  .studio-title input{width:0;min-width:0;flex:1;font-size:16px;min-height:44px}
  .studio-title .icon-button{width:44px;height:44px;min-height:44px}
  .studio .save-state{display:none}
  .studio-actions{display:flex;flex-wrap:nowrap;min-width:0;overflow-x:auto;gap:6px;padding-bottom:3px;scrollbar-width:thin;overscroll-behavior-x:contain}
  .studio-actions button,.studio-actions .primary,.studio-actions #improve,.studio-actions #export,.studio-actions .add-picture-button{flex:0 0 auto;min-height:44px;min-width:44px;padding:10px 12px;font-size:12px;white-space:nowrap}
  .studio-actions #save-project{display:inline-flex;order:-3}
  .studio-actions #export{order:-2}
  .studio-actions #add-picture{order:-1}
  .studio-actions .desktop-help{display:none}
  .studio-body{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) calc(68px + env(safe-area-inset-bottom,0px));grid-template-areas:'canvas' 'tools';overflow:hidden;min-height:0}
  .canvas-area{grid-area:canvas;min-height:0;overflow:hidden}
  .object-tools{display:flex;align-items:center;gap:6px;flex-shrink:0;overflow-x:auto;min-height:48px;padding:2px 8px;border-bottom:1px solid var(--border);background:#211b2b;scrollbar-width:thin;overscroll-behavior-x:contain}
  .canvas-toolbar{min-height:52px;flex-shrink:0;flex-wrap:nowrap;overflow-x:auto;padding:4px 8px;gap:5px;scrollbar-width:thin;overscroll-behavior-x:contain}
  .canvas-toolbar button,.canvas-toolbar select{min-height:44px;flex:0 0 auto;padding:8px 10px;font-size:12px;white-space:nowrap}
  .canvas-toolbar select{font-size:16px;max-width:160px}
  .canvas-toolbar #toggle-properties{display:inline-flex;order:-1}
  .canvas-toolbar .spacer{display:none}
  .workspace{min-height:0;min-width:0;padding:12px;align-items:flex-start;justify-content:flex-start;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .canvas-wrapper{margin:auto}
  .canvas-status{height:44px;min-height:44px;flex-shrink:0;gap:4px;padding:0 6px}
  #canvas-info{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
  .canvas-status .desktop-help{display:none}
  .zoom-controls{flex:0 0 auto;gap:0}
  .zoom-controls button{min-height:44px;min-width:44px;font-size:20px}
  .tool-rail{grid-area:tools;display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;gap:4px;overflow-x:auto;overflow-y:hidden;padding:5px 8px calc(5px + env(safe-area-inset-bottom,0px));border-right:0;border-top:1px solid var(--border);scrollbar-width:thin;overscroll-behavior-x:contain}
  .tool-rail>div{display:none}
  .tool-rail .rail-button{flex:0 0 62px;width:62px;min-height:54px;padding:5px 3px;font-size:10px;gap:4px}
  .rail-button[aria-expanded=true]{background:#ac91ff25;color:#d8c6ff}
  .studio .left-panel,.studio .properties{display:none;position:absolute;inset:auto 8px calc(74px + env(safe-area-inset-bottom,0px));width:auto;height:58%;max-height:calc(100% - 82px);min-height:0;overflow:auto;z-index:40;border:1px solid #bca1ff55;border-radius:16px;padding:0 14px 16px;box-shadow:0 -12px 40px #0009;overscroll-behavior:contain;scroll-padding-block:64px 16px;-webkit-overflow-scrolling:touch}
  .studio .left-panel.mobile-open,.studio .properties.mobile-open{display:block}
  .editor-panel-header{display:flex;position:sticky;top:0;z-index:2;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:6px 0;margin-bottom:10px;background:#1a1a24;border-bottom:1px solid var(--border)}
  .editor-panel-header strong{font-size:14px}
  .editor-panel-close{min-height:44px;padding:8px 14px;font-size:14px}
  .studio .left-panel button,.studio .properties button{min-height:44px}
  .studio .field{font-size:13px}
  .studio .field input,.studio .field select,.studio .field textarea{font-size:16px;min-height:44px;min-width:0}
  .studio .field input[type=color]{padding:4px}
  .studio .field input[type=checkbox]{min-height:24px;min-width:24px}
  body.editor-keyboard-open .studio .mobile-open{position:fixed;inset:calc(var(--editor-visible-top,0px) + 8px) 8px auto;height:calc(var(--editor-visible-height,100dvh) - 16px);max-height:calc(var(--editor-visible-height,100dvh) - 16px);z-index:80}
  body.editor-active dialog{width:calc(100% - 16px);max-width:650px;max-height:calc(var(--editor-visible-height,100dvh) - 16px);padding:20px;margin:auto;overflow:auto;overscroll-behavior:contain}
  body.editor-active dialog button{min-height:44px}
  body.editor-active dialog input,body.editor-active dialog select,body.editor-active dialog textarea{font-size:16px;min-height:44px}
  body.editor-active dialog .modal-close{width:44px;height:44px;z-index:5}
  body.editor-active dialog.wide[open]:has(.cutout-layout){height:calc(var(--editor-visible-height,100dvh) - 16px);max-height:calc(var(--editor-visible-height,100dvh) - 16px);max-width:1000px;padding:12px;overflow:hidden}
  body.editor-active dialog:has(.cutout-layout) #modal-content{height:100%;display:flex;flex-direction:column;min-height:0}
  .cutout-head{flex-shrink:0;padding-right:36px}
  .cutout-head .eyebrow,.cutout-head>p{display:none}
  .cutout-head h2{font-size:20px;margin:4px 0 8px}
  .cutout-algorithms{flex-shrink:0;flex-wrap:nowrap;overflow-x:auto;margin:4px 0 8px;gap:5px}
  .cutout-algorithms button{flex:0 0 auto;white-space:nowrap;min-height:44px;font-size:11px;padding:8px}
  .cutout-layout{flex:1;min-height:0;max-height:none;grid-template-columns:1fr;grid-template-rows:minmax(90px,1.1fr) minmax(100px,1fr);gap:8px;margin:0 0 8px}
  .cutout-preview{height:100%;min-height:0;max-height:none;padding:8px 8px 34px;border-radius:10px}
  .cutout-image-wrap{width:auto;height:100%;min-height:0;max-height:100%;align-items:center;justify-content:center}
  .cutout-preview canvas{max-height:100%;max-width:100%;width:auto;height:auto;object-fit:contain}
  .cut-status{bottom:5px;left:5px;max-width:calc(100% - 10px);font-size:10px}
  .cutout-tools{min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:8px;padding-right:5px}
  .cutout-tools .brush-modes{order:-2;flex-direction:row;flex-wrap:wrap;gap:5px;position:sticky;top:0;z-index:2;background:#1d1926;padding:3px 0}
  .cutout-tools .brush-modes button{flex:1;min-width:95px;width:auto;justify-content:center}
  .cutout-tools .field:has(#cut-brush){order:-1}
  .cutout-tools button{min-height:44px;padding:8px 10px}
  .cutout-tools input[type=range]{min-height:44px;height:44px}
  .cutout-tools .preview-backdrops button{min-width:44px;width:44px}
  .cutout-bottom{position:static;flex-shrink:0;margin:0;padding:8px 0 0;background:transparent;flex-wrap:nowrap}
  .cutout-bottom>.subtle{display:none}
  .cutout-bottom .btn-row{width:100%;margin:0;display:flex;justify-content:flex-end}
  .cutout-bottom button{padding:9px 18px;min-height:44px}
  .crop-preview canvas{max-height:35dvh}
  .crop-bottom{position:sticky;bottom:-20px;background:#1d1926;padding:10px 0;margin-bottom:-10px;z-index:2}
  .studio .layer-row{min-height:48px;font-size:13px}
  .studio .layer-row button{min-width:44px;min-height:44px}
  .tour-popover{width:calc(100% - 24px);max-width:380px;bottom:calc(76px + env(safe-area-inset-bottom,0px));max-height:40dvh;overflow:auto}
  .tour-popover button{min-height:44px}
}
@media(max-width:850px) and (orientation:landscape) and (max-height:500px),(max-width:1024px) and (pointer:coarse) and (orientation:landscape) and (max-height:500px){
  body.editor-active .header{display:none}
  .studio-top{flex-direction:row;align-items:center;padding:4px 8px;gap:8px}
  .studio-title{flex:0 1 160px;min-width:100px;height:44px}
  .studio-title input{font-size:16px}
  .studio-actions{flex:1;padding-bottom:0}
  .studio-body{grid-template-rows:minmax(0,1fr) calc(58px + env(safe-area-inset-bottom,0px))}
  .tool-rail{padding-top:2px;padding-bottom:calc(2px + env(safe-area-inset-bottom,0px))}
  .tool-rail .rail-button{min-height:50px}
  .canvas-toolbar{min-height:48px;padding-block:2px}
  .cutout-layout{grid-template-columns:minmax(0,1fr) minmax(200px,.8fr);grid-template-rows:minmax(0,1fr)}
  .cutout-algorithms{margin:0 0 4px}
  .cutout-head h2{font-size:18px;margin:0 0 3px}
  .canvas-status{height:44px;min-height:44px}
  .zoom-controls button{min-height:44px}
  .studio .left-panel,.studio .properties{bottom:calc(64px + env(safe-area-inset-bottom,0px));height:72%;max-height:calc(100% - 70px)}
}
