/* Give the illustration a clear stage; retain readable 44px touch targets. */
@media(max-width:700px) and (orientation:portrait){
 .town-world-viewport{top:56px;bottom:76px}
}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
 .town-app :is(.hq-world,.town-world,.shop-world,.room-home-modern-world.player-page){height:100dvh;min-height:0}
 /* Destination controls form a side rail, freeing the bottom of the scene. */
 .town-app :is(.town-world-dock,.hq-world-dock,.hq-world-careers,.room-home-dock,.shop-world-dock,.class-world-dock){left:auto;right:max(8px,env(safe-area-inset-right,0px));top:62px;bottom:max(8px,env(safe-area-inset-bottom,0px));width:68px;max-width:none;transform:none;display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(44px,1fr);padding:3px;gap:2px;overflow-y:auto;overscroll-behavior:contain}
 .town-app :is(.town-world-dock,.hq-world-dock,.hq-world-careers,.room-home-dock,.shop-world-dock,.class-world-dock) button{min-height:44px;min-width:0;padding:3px 1px;gap:2px;font-size:10px;line-height:1.2}
 .town-app :is(.town-world-dock,.hq-world-dock,.hq-world-careers,.room-home-dock,.shop-world-dock,.class-world-dock) .location-logo{width:21px;height:21px}
 .town-app .hq-world-hud,.town-app .town-world-hud,.town-app .shop-world-hud{top:max(8px,env(safe-area-inset-top,0px));left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px))}
 .town-app .hq-world-heading,.town-app .town-world-heading{flex:0 1 auto}
 .town-app .hq-world-heading h2,.town-app .town-world-heading h2{max-width:220px;width:auto;font-size:14px;padding:8px 10px}
 .hq-world-viewport{inset:56px 84px 58px 62px}
 .town-world-viewport{inset:56px 84px 8px 0}
 /* Camera tools use the opposite edge; the main action remains prominent. */
 .town-app .hq-world .hq-world-quick-camera{top:62px;bottom:auto;left:max(8px,env(safe-area-inset-left,0px));right:auto;transform:none;display:flex;flex-direction:column;width:48px;max-width:48px;gap:1px;padding:2px}
 .town-app .hq-world .hq-world-quick-camera button{width:44px;min-height:44px;padding:3px;font-size:10px}
 .hq-world-quick-camera output{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .town-app .hq-world.hq-world-hall .hq-world-caption{left:calc((100% - 84px)/2);bottom:max(8px,env(safe-area-inset-bottom,0px))}
 .town-app .hq-world .hq-workspace-next{left:calc((100% - 84px)/2);bottom:max(8px,env(safe-area-inset-bottom,0px));width:min(360px,calc(100% - 180px));min-height:44px;padding:5px 10px}
 .town-app .hq-world .hq-workspace-next>.location-logo{width:24px;height:24px}
 .town-app .hq-world .hq-world-tools{top:62px;right:90px;bottom:auto}
 .town-app .hq-world .hq-world-mentor{top:62px;left:66px}
 .hq-world-tools-panel,.hq-world-mentor-panel{max-height:calc(100dvh - 122px)}
 .town-app .town-world-camera{top:auto;bottom:8px;left:8px;right:auto;transform:none;padding:3px}
 .town-app .town-world-camera button{min-height:44px;min-width:44px}
 /* Home artwork can use the floor previously occupied by the bottom dock. */
 .town-app .room-home-hud{top:8px;left:8px;right:8px}
 .town-app .room-home-modern-world .room-home-identity{position:static;max-width:260px;padding:4px 8px}
 .town-app .room-home-identity .room-home-career{min-height:0;font-size:10px}
 .town-app .room-home-modern-world .room-home-stage .home-room-modern :is(.player-room-avatar,.player-room-example){bottom:8%}
 /* Landscape shop: keep scenery on the left and a scrollable catalogue on the right. */
 .town-app .shop-world-brand{min-height:44px;padding:5px 9px}
 .town-app .shop-world-brand h2{font-size:15px}
 .town-app .shop-world-welcome,.town-app .shop-world-room .shop-world-welcome{top:62px;left:12px;width:calc(36% - 20px)}
 .shop-world-welcome>span,.shop-world-welcome>p{display:none}
 .town-app .shop-world-welcome>h3{font-size:22px;margin:0}
 .town-app .shop-world-stations,.town-app .shop-world-room .shop-world-stations{top:105px;left:12px;right:auto;width:calc(36% - 20px);grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 .town-app .shop-world-stations>button{min-height:58px;padding:4px 2px;gap:2px}
 .town-app .shop-world-stations strong{font-size:10px}
 .shop-world-stations small,.shop-world-stations>button>span:last-child{display:none}
 .town-app .shop-world .shop-world-counter,.town-app .shop-world-expanded .shop-world-counter{top:62px;left:38%;right:84px;bottom:8px;width:auto;min-height:0}
 .shop-world-counter-top{padding:7px 10px}.shop-world-counter-top h3{font-size:16px}.shop-world-kicker{display:none}
 .town-app .shop-world .shop-categories,.town-app .shop-world .shop-career-filter{padding:0 8px 5px;flex-wrap:nowrap;overflow-x:auto}
 .town-app .shop-world .shop-categories>button,.town-app .shop-world .shop-career-filter>button{min-height:44px;flex-shrink:0;padding:5px 8px}
 .shop-world-catalogue-scroll{min-height:0;padding:3px 8px 12px}
 .town-app .shop-world-room .shop-world-personal{left:12px;bottom:12px;top:auto;width:calc(36% - 20px);max-height:100px;overflow-y:auto}
 /* Lessons stay scrollable, with topics beside the content instead of above it. */
 .town-app .class-world.class-studio{padding:62px 84px 8px 8px}
 .town-app .class-world .class-workspace{grid-template-columns:140px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:8px}
 .town-app .class-world .class-sidebar{overflow-y:auto;padding:5px}
 .town-app .class-world .class-sidebar nav{display:flex;flex-direction:column;overflow:visible}
 .town-app .class-world .class-sidebar nav button{min-width:0;min-height:44px;width:100%;padding:6px;flex-shrink:0}
 .town-app .class-world .class-sidebar nav small{display:none}
 .town-app .class-world .class-lesson-space{min-height:0;padding:12px;overflow-y:auto}
 .town-app .class-world .class-career{min-height:44px}
 .town-app .class-world .class-studio-heading{top:8px;right:8px}
 .town-app .class-world-nav{top:8px;left:8px}
}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
 .town-app .hq-world.hq-workspace-clear .hq-world-dock{grid-template-columns:minmax(0,1fr)}
 .town-app .hq-world-careers strong{font-size:9px;overflow-wrap:normal;word-break:normal}
 .hq-world-viewport{bottom:8px}
 .town-app .hq-world.hq-world-hall .hq-world-caption{left:66px;transform:none}
 .town-app .hq-world .hq-workspace-next{left:66px;transform:none;width:min(260px,calc(100% - 180px))}
}
@media(max-width:800px) and (max-height:500px) and (orientation:landscape){
 .town-app .shop-world .emporium-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
 .town-app .hq-world-tools>summary{width:44px;padding:8px}
 .town-app .hq-world-tools>summary>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .town-app .class-world .class-sidebar{overflow-x:hidden}
 .town-app .class-world .class-practice-progress{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0;text-align:center}
 .town-app .class-world .class-practice-progress .class-proportion{width:44px;height:44px;flex-shrink:0}
 .town-app .class-world .class-practice-progress strong{font-size:18px}
 .town-app .class-world .class-practice-progress small{font-size:10px}
 .town-app .class-world .class-sidebar nav button>i{display:none}
 .town-app .class-world .class-sidebar nav button>span{min-width:0;font-size:11px;white-space:normal}
 .town-app .class-world .class-skill-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:6px;padding-bottom:6px}
 .town-app .class-world .class-skill-tabs button{flex:0 0 auto;min-height:44px}
}
@media(max-width:700px) and (orientation:portrait){
 .town-app .shop-world{height:100dvh;min-height:0}
 .town-app .shop-world-welcome,.town-app .shop-world-room .shop-world-welcome{top:76px;left:12px;width:calc(100% - 24px)}
 .town-app .shop-world-welcome>span,.town-app .shop-world-welcome>p{display:none}
 .town-app .shop-world-welcome>h3{font-size:22px;margin:0}
 .town-app .shop-world-stations,.town-app .shop-world-room .shop-world-stations{top:114px;left:12px;right:12px;width:auto;display:flex;overflow-x:auto;gap:6px;padding-bottom:5px;scrollbar-width:thin}
 .town-app .shop-world-stations>button{flex:0 0 72px;min-height:64px;padding:5px 3px}
 .town-app .shop-world .shop-world-counter{top:200px;bottom:82px}
 .town-app .shop-world-expanded .shop-world-counter{top:68px}
}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
 .hq-world-viewport{left:calc(62px + env(safe-area-inset-left,0px));right:calc(84px + env(safe-area-inset-right,0px))}
 .town-world-viewport{left:env(safe-area-inset-left,0px);right:calc(84px + env(safe-area-inset-right,0px))}
 .town-app .hq-world.hq-world-hall .hq-world-caption,.town-app .hq-world .hq-workspace-next{left:calc(66px + env(safe-area-inset-left,0px))}
 .town-app .hq-world .hq-world-tools{right:calc(90px + env(safe-area-inset-right,0px))}
 .town-app .hq-world .hq-world-mentor{left:calc(66px + env(safe-area-inset-left,0px))}
 .town-app .shop-world .shop-world-counter,.town-app .shop-world-expanded .shop-world-counter{right:calc(84px + env(safe-area-inset-right,0px))}
 .town-app .class-world.class-studio{padding-right:calc(84px + env(safe-area-inset-right,0px))}
}
