.phone-status,.phone-bottom{display:none}
body.phone-desktop{--phone-top:calc(27px + env(safe-area-inset-top));--phone-bottom:calc(78px + env(safe-area-inset-bottom));background:#080a0e;font-family:Helvetica,Arial,sans-serif}
body.phone-desktop #wallpaper{inset:var(--phone-top) 0 var(--phone-bottom);background:repeating-linear-gradient(0deg,#212831 0 2px,#1e252d 2px 4px)!important}
body.phone-desktop #crunch{display:none}
body.phone-desktop .phone-status{position:fixed;display:flex;justify-content:space-between;align-items:center;inset:0 0 auto;height:var(--phone-top);padding:env(safe-area-inset-top) 12px 0;background:linear-gradient(#42474e,#12151a);color:#fff;font:bold 11px Helvetica;z-index:310;text-shadow:0 -1px #000}
body.phone-desktop #desktop{inset:var(--phone-top) 0 var(--phone-bottom);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:100px;align-content:start;padding:26px 12px 115px;gap:12px 2px;overflow-y:auto;overscroll-behavior:contain}
body.phone-desktop .dicon{position:relative!important;left:auto!important;top:auto!important;width:auto;min-width:0;align-self:start;padding:4px 0;touch-action:manipulation!important;background:transparent!important}
body.phone-desktop .dicon svg{width:58px;height:58px;padding:10px;border-radius:13px;background:linear-gradient(#b7dbea,#316999 50%,#174d78 51%,#4488ad);border:1px solid #ffffff77;box-shadow:0 3px 5px #0009,inset 0 1px 2px #fff9;margin-bottom:8px;image-rendering:auto}
body.phone-desktop #icon-paint svg{background:linear-gradient(#fffbe0,#ddd6ac)}body.phone-desktop #icon-cat svg{background:linear-gradient(#adcf91,#326b38)}body.phone-desktop #icon-notes svg{background:linear-gradient(#fff8b1,#d2b85d)}body.phone-desktop #icon-walk svg{background:linear-gradient(#858fbc,#272c59)}
body.phone-desktop .dicon-label{font:bold 11px/1.3 Helvetica;color:white;max-width:88px;text-shadow:0 1px 2px black}
body.phone-desktop #taskbar{display:none}
body.phone-desktop .phone-bottom{position:fixed;inset:auto 0 0;height:var(--phone-bottom);display:flex;align-items:center;justify-content:space-between;padding:8px 24px calc(8px + env(safe-area-inset-bottom));background:linear-gradient(#24272c,#050607);border-top:1px solid #5b5d63;z-index:310}
.phone-bottom button,.phone-bottom a{border:0;background:transparent;color:#aaa;font:11px Helvetica;text-decoration:none;min-width:65px;min-height:44px;display:grid;place-items:center}
.phone-bottom #phone-home{width:52px;height:52px;min-width:52px;border:1px solid #505258;border-radius:50%;background:linear-gradient(#1c1f23,#060709);box-shadow:inset 0 2px 5px #000;cursor:pointer}.phone-bottom #phone-home::after{content:'';width:16px;height:16px;border:2px solid #9c9ea0;border-radius:4px}
body.phone-desktop .win,body.phone-desktop #draw-win,body.phone-desktop #cat-win,body.phone-desktop #notes-win{left:0!important;right:0!important;top:var(--phone-top)!important;bottom:var(--phone-bottom)!important;width:100%!important;height:auto!important;max-width:none!important;max-height:none!important;border:0;border-radius:0;box-shadow:none;z-index:25}
body.phone-desktop .win.top{z-index:30}body.phone-desktop .win.open{animation:phone-app-in .22s ease-out}
body.phone-desktop .titlebar{height:44px;padding:0 14px;background:linear-gradient(#b2c1d2,#7c93ad 50%,#6983a0 51%,#58728e);border-radius:0;touch-action:manipulation}
body.phone-desktop .ttitle{font:bold 17px Helvetica;text-align:center;text-shadow:0 -1px #456}
body.phone-desktop .wbtns,body.phone-desktop .resize-grip,body.phone-desktop .menubar{display:none}
body.phone-desktop #dtoolbar{padding:8px;gap:6px;background:linear-gradient(#ebeff4,#c7d0db)}body.phone-desktop .tbtn2{min-height:36px;font-size:12px;padding:6px 10px;border-radius:6px}body.phone-desktop .cswatch{width:28px;height:28px;border-radius:5px}body.phone-desktop .szbtn{width:32px;height:32px}
body.phone-desktop #draw-canvas-wrap{min-height:150px}body.phone-desktop #draw-status{padding:8px;font-size:11px}body.phone-desktop #print-btn{min-height:38px;font-size:12px;border-radius:6px}
body.phone-desktop #cat-screen{background:repeating-linear-gradient(90deg,#dbe3ed 0 3px,#d4deea 3px 5px);gap:20px;overflow:auto;padding:24px 12px;justify-content:center}
body.phone-desktop #cat-viewport{width:224px;height:160px;border:5px solid #8c9c8e;box-shadow:0 2px 8px #40534433}body.phone-desktop #cat-canvas{width:100%;height:100%}body.phone-desktop #catstats{font-size:12px;color:#34503c}body.phone-desktop #catbtns{flex-wrap:wrap;justify-content:center;gap:8px}body.phone-desktop .catbtn{min-height:42px;padding:8px 12px;font-size:13px;border-radius:8px;background:linear-gradient(#fff,#c3d1c6);color:#284a34;border:1px solid #99aa9c}body.phone-desktop #shakebar{width:224px;height:8px}
body.phone-desktop #notes-area{font:18px/1.7 Georgia;padding:18px 20px;background:repeating-linear-gradient(#fff8d2 0 29px,#b9cce0 29px 30px);color:#32312b}
body.phone-desktop .cat-dock{bottom:calc(var(--phone-bottom) + 7px);left:10px;right:10px;justify-content:center;flex-wrap:wrap}body.phone-desktop .cat-dock button{min-height:38px}
body.phone-desktop #achievement-notices{bottom:calc(var(--phone-bottom) + 12px)}
@keyframes phone-app-in{from{opacity:.4;scale:.92}to{opacity:1;scale:1}}
@media(max-width:700px){
 html,body{max-width:100%;-webkit-text-size-adjust:100%}input:not([type=range]),textarea,select{font-size:16px!important}button,a{touch-action:manipulation}#cur{display:none!important}.world-return{bottom:calc(12px + env(safe-area-inset-bottom));left:12px;padding:12px 16px}
 body[data-world=worldwideweb] #os-bar{height:38px}body[data-world=worldwideweb] #browser{top:38px}body[data-world=worldwideweb] .os-btn{height:30px;font-size:12px}body[data-world=worldwideweb] #menubar{display:none}body[data-world=worldwideweb] #navrow{gap:5px;padding:4px 0}body[data-world=worldwideweb] .nbtn{height:36px;min-width:32px}body[data-world=worldwideweb] #urlbar{min-width:0;height:36px;width:0}body[data-world=worldwideweb] #address-label{display:none}body[data-world=worldwideweb] #go-btn{height:36px}body[data-world=worldwideweb] #status-secure{display:none}.home-header{padding:20px!important;flex-wrap:wrap}.home-search{width:100%!important}.home-search input{min-width:0!important}.home-body{display:grid!important;grid-template-columns:1fr!important;padding:16px!important;gap:14px!important}.home-panel{width:100%!important;min-width:0!important;padding:16px!important}.home-panel a,.home-panel p{font-size:14px!important;line-height:1.6!important}.home-links{flex-wrap:wrap!important;gap:8px!important;padding:12px!important}.home-links a{padding:7px;font-size:13px!important}.wiki-tab{min-height:44px}.yt-search{flex:1}.yt-search button{min-height:40px}.yt-grid{grid-template-columns:1fr!important}.gargo-input input{width:0}.gargo-tile{min-height:48px}.gargo-actions{flex-wrap:wrap}.gargo-actions button{min-height:40px}.terminal-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}.terminal-grid .panel{min-width:0;min-height:140px}.terminal-grid .panel-title{font-size:10px!important;overflow-wrap:anywhere}
 body[data-world=achievements] #content{padding:30px 18px 85px!important;width:100%!important}.ach{padding:16px 12px!important;gap:10px!important}.ach-title{font-size:14px!important;line-height:1.4}.ach-desc{font-size:13px!important;line-height:1.5}.ach-icon{font-size:25px!important}.ach-badge,.lock-icon{font-size:15px!important}#quantum-gate{padding:20px;margin:20px auto}
 body[data-world=tree] #water-ui{max-width:calc(100vw - 28px);padding:12px 16px;bottom:65px}body[data-world=tree] #water-btn{min-height:44px}body[data-world=tree] #back-portal{bottom:12px}
 body[data-world=factory]{overflow:auto;height:auto;min-height:100dvh;align-items:flex-start}body[data-world=factory] #factory-viewport{max-height:none;height:auto;min-height:100dvh;width:100%;max-width:100%;border-width:2px;overflow:visible;padding-bottom:65px}body[data-world=factory] #top-dashboard{padding:14px 10px;gap:10px}body[data-world=factory] .title-display{font-size:18px;letter-spacing:2px}body[data-world=factory] .title-display small{display:none}body[data-world=factory] .btn-menu{padding:10px;font-size:11px}body[data-world=factory] #production-floor{flex-direction:column}body[data-world=factory] #processing-bay{width:100%!important;min-height:350px;height:350px;flex:none!important}body[data-world=factory] #control-panel{width:100%!important;flex:none!important;padding:12px!important}body[data-world=factory] .machinery-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}body[data-world=factory] .blueprint-overlay{overflow:auto}
 body[data-world=glue]{overflow:auto!important}body[data-world=glue] #builder-panel{height:650px}body[data-world=glue] #barea{top:40px;right:0;bottom:300px}body[data-world=glue] #sidebar{top:auto;bottom:0;left:0;right:0;width:100%;height:300px;display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px}body[data-world=glue] #header{height:40px}body[data-world=glue] #header .sub{display:none}body[data-world=glue] #sim-panel{height:55dvh;min-height:320px}body[data-world=glue] #b-hint{font-size:10px;gap:6px}body[data-world=glue] #sidebar button{min-height:38px}body[data-world=glue] input[type=range]{min-height:24px}body[data-world=glue] #gen-btn{bottom:65px}body[data-world=glue] #builder-canvas{touch-action:none}
 .walk-controls{bottom:calc(12px + env(safe-area-inset-bottom))}.walk-controls input{min-height:28px}.walk-controls button{min-height:42px}.glyph-panel input{min-height:25px}.office-hud{padding-bottom:calc(14px + env(safe-area-inset-bottom))}#office{min-height:100dvh}#achievement-notices{right:12px;bottom:calc(20px + env(safe-area-inset-bottom))}.recursive-controls button{min-height:42px}.artifact-name{letter-spacing:1px}#forest-hint{font-size:9px;max-width:95vw}
}
@media(max-height:500px) and (pointer:coarse){body.phone-desktop{--phone-bottom:52px}body.phone-desktop #desktop{grid-template-columns:repeat(5,1fr);padding-top:12px}body.phone-desktop .phone-bottom #phone-home{height:40px;width:40px;min-width:40px}body.phone-desktop #cat-screen{justify-content:flex-start;gap:10px}body.phone-desktop #cat-viewport{width:168px;height:120px}}
