/* Both layouts retain every control; landscape dock scrolls on short screens. */
html,body{overscroll-behavior:none;touch-action:auto;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.app,.app *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.app{grid-template-columns:minmax(0,1fr);min-width:0;width:100%;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.dock{flex-wrap:nowrap!important;min-width:0;width:100%;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.tool-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px}.tool-btn svg{width:25px;height:25px;flex-shrink:0}
.studio-extras{display:flex;align-items:center;justify-content:space-between;gap:4px 10px;flex-wrap:wrap;flex-shrink:0;font-size:12px}.studio-extras a{color:#323c39}.studio-extras button{min-height:36px;background:#eee9dc;border:1px solid #817e74;padding:4px 8px;color:#17181a}.studio-extras button[aria-pressed=true]{background:#c9ded2}#motionStatus:empty{display:none}#motionStatus{flex-basis:100%;font-size:12px}
.save-sheet{width:min(92vw,540px);max-height:85dvh;overflow:auto;padding:20px;border:1px solid #777;background:#eee9dc;color:#17181a}.save-sheet::backdrop{background:#0009}.save-sheet img{display:block;max-width:100%;height:auto;-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto;touch-action:auto}.save-sheet p{font-size:15px;line-height:1.4}.close-save{float:right;width:44px;height:44px;font-size:25px}
.app{height:100vh;height:100dvh;padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.easel{max-height:none;flex-shrink:0}
.dock{touch-action:pan-y;overscroll-behavior:contain}
button,input{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#paint{touch-action:none}
@media(pointer:coarse),(max-width:760px){
 .app{grid-template-rows:48px minmax(0,1fr) auto}
 .titlebar{padding:0 8px;gap:6px}.hint{display:none}.logo{font-size:14px}
 .winbtn{width:44px;height:42px;font-size:20px}.top-actions{gap:5px}
 .dock{gap:6px;padding:8px 8px max(8px,env(safe-area-inset-bottom));max-height:48dvh;overflow-y:auto;min-height:0}
 .tool-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;overflow:visible;flex-shrink:0;width:100%}
 .mobile-tool{display:flex;align-items:center;gap:8px;flex-shrink:0;font-size:14px}
 .mobile-tool select{flex:1;min-width:0;height:40px;font-size:16px;color:#17181a;background:#eee9dd;border:1px solid #777;border-radius:4px}
 .tool-btn{height:58px;min-height:44px;min-width:0;flex-direction:column;gap:2px;padding:3px 0;font-size:11px}
 .tool-row .material{display:none}.material-row{position:static;flex-wrap:wrap;gap:4px;flex-shrink:0}
 .palette{width:100%;display:flex;justify-content:space-between;gap:0;order:0;margin:0;padding:3px 0}
 .palette .swatch{width:calc(100% / 9);height:40px;min-width:0;border:6px solid #c7c3b7;box-shadow:none;outline-offset:-5px;transform:none}
 .sizebox{display:flex;width:100%;margin:0;justify-content:space-between;font-size:14px}
 .sizebox input{height:34px;width:calc(100% - 80px)}
 .supply-row{flex-wrap:wrap;gap:4px 6px;flex-shrink:0}.refill{min-height:44px;white-space:normal;flex:1;margin:0;font-size:14px}
 .reserve{font-size:14px}.reserve meter{width:60px}#supplyHint{display:block;flex-basis:100%;font-size:12px;line-height:1.25}
 .frame{padding:10px}
}
@media(orientation:landscape) and (max-height:600px){
 .app{grid-template-columns:minmax(0,1fr) 236px;grid-template-rows:48px minmax(0,1fr)}
 .titlebar{grid-column:1 / -1}.studio{grid-column:1;grid-row:2;min-width:0}
 .dock{grid-column:2;grid-row:2;max-height:none;height:100%;overflow-y:auto;align-content:start;justify-content:flex-start;border-top:0;border-left:3px solid white;padding:6px 8px max(8px,env(safe-area-inset-bottom));gap:8px}
 .tool-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;padding:0;overflow:visible;flex-shrink:0}
 .mobile-tool{display:flex;align-items:center;gap:6px;flex-shrink:0;font-size:14px}
 .mobile-tool select{min-width:0;flex:1;height:38px;font-size:16px}
 .tool-btn{height:52px;min-width:0;width:100%;padding:3px 0;flex-direction:column;gap:2px;font-size:10px}.tool-btn span{display:block}.tool-row .material{display:none}
 .material-row{position:static;display:flex;flex-direction:column;align-items:stretch;gap:6px}
 .palette{display:grid;grid-template-columns:repeat(5,1fr);width:100%;gap:0;margin:0;order:0}
 .palette .swatch{width:100%;height:32px;border:4px solid #c7c3b7;box-shadow:none;transform:none;outline-offset:-4px}
 .sizebox{display:flex;margin:0;width:100%;font-size:14px;justify-content:space-between}.sizebox input{width:135px;height:34px}
 .supply-row{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:6px}.reserve{justify-content:space-between}.reserve meter{width:82px}#supplyHint{flex-basis:auto;min-width:0;white-space:normal}
 .refill{min-height:44px;margin:0;flex:none}#supplyHint{display:block;font-size:12px;line-height:1.3}
 .easel{max-height:none}.frame{padding:8px}
}
.cleanup-row{display:flex;flex-wrap:wrap;gap:6px;flex-shrink:0}
.cleanup-btn{min-height:42px;padding:4px 12px;font:15px Tahoma,sans-serif;color:#222;background:#d5d2c7;border:2px solid;border-color:white #777 #777 white;cursor:pointer}
.cleanup-btn[aria-pressed=true]{background:#c7b8db;border-color:#777 white white #777;box-shadow:inset 1px 1px 3px #777}
.sweep-bottom{min-height:36px;padding:5px 10px;font:13px Tahoma,sans-serif;background:#d5d2c7;border:2px solid;border-color:white #777 #777 white;cursor:pointer}
.cleanup-cursor{display:none;position:fixed;z-index:24;pointer-events:none;transform:translate(-50%,-50%);border:1px solid #242424;border-radius:25%;box-shadow:0 0 0 1px #fff9;background:#eee9dc33}
.cleanup-cursor[data-mode=solvent]{border-radius:50%;background:#d7e7ef44;border-style:dashed}
@media(pointer:coarse),(max-width:760px){.cleanup-btn{min-height:44px;flex:1;padding:4px;font-size:12px}.tool-btn{font-size:12px}.dock{max-height:52dvh}.tool-row{padding:0}}
@media(orientation:landscape) and (max-height:600px){.dock{max-height:none}.cleanup-row{display:grid;grid-template-columns:1fr 1fr}.tool-btn{font-size:12px}}
