/* All interaction panels are independent of the approved map geometry. */
#sessionNotice{position:fixed;left:50%;top:max(44px,env(safe-area-inset-top));transform:translateX(-50%);width:min(480px,calc(100% - 16px));z-index:60;padding:12px;background:#46382ef7;border:1px solid #c4a575;box-shadow:0 4px 16px #17131a66;font:14px/1.5 system-ui,sans-serif;pointer-events:auto;touch-action:manipulation}
#sessionNotice button{min-height:44px;width:100%;margin:8px 0 0;padding:10px 14px;background:#efd09a;color:#2b2426;pointer-events:auto}
#sessionNotice button:disabled{opacity:.7;cursor:progress}
#atmosphereReadout{margin-left:9px;color:#d6d7c6;font-size:12px;white-space:nowrap}
.compact-only{display:none!important}
#morePanel{display:flex;flex-direction:column;gap:6px}
#morePanel #character{align-self:flex-start}
#controls{display:flex;align-items:stretch;gap:5px}
#controls #action{flex:1.7;min-width:0;grid-column:auto}
#controls #staminaReadout{flex:0 0 64px;display:flex;align-content:center;justify-content:center;gap:2px;font-size:11px}
#controls #staminaReadout>span:first-child{font-size:10px}
#controls #staminaReadout progress{width:52px;height:7px}
#controls #staminaValue{font-size:11px}
#controls #bag,#controls #wardrobe{flex:.7}
#services,#services *{pointer-events:none}
.service-marker{position:absolute;transform:translate(-50%,-100%);max-width:85%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#242a2de6;color:#f4e5c8;padding:3px 6px;border:0;box-shadow:none;border-radius:2px;font:500 12px/1.3 system-ui,sans-serif;min-height:0;pointer-events:none}
.service-marker::after{content:none}
.service-marker.bin{color:#dbe9d1}
.service-door{position:absolute;transform:translate(-50%,-100%);padding:2px 5px;border:1px solid #c8aa7d;background:#302c2df0;color:#f8e3ba;font:600 12px/1.3 system-ui,sans-serif;white-space:nowrap;pointer-events:none;box-shadow:1px 1px #17151a88}
.service-door::before{content:'▪';color:#edc782;margin-right:3px}
.service-door[data-near=true]{color:#fff0ca;border-color:#ffe1a1;background:#3f5148}
@media(max-width:600px),(max-height:520px){
 html,body{height:100%;overflow:hidden;overscroll-behavior:none}
 main{height:var(--game-viewport-height,100svh);min-height:0;overflow:hidden}
 header{flex:0 0 32px;min-height:32px;padding:6px max(10px,env(safe-area-inset-left));gap:10px;border-bottom-width:1px}
 header strong{font-size:16px;letter-spacing:-1px}
 header strong span{font-size:9px}
 header b{font-size:10px;letter-spacing:.5px}
 header small{display:none}
 .stage{flex:1;min-height:0;display:grid;place-items:center;background:#302c30}
 .map-area{inset:0}
 .location{top:6px;left:max(6px,env(safe-area-inset-left));max-width:calc(100% - 12px);padding:4px 6px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #atmosphereReadout{font-size:11px;margin-left:6px}
 #hud{flex:0 0 auto;height:calc(62px + env(safe-area-inset-bottom));padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));border-top:1px solid #796751;background:#29252a;z-index:6}
 .console{display:block;margin:0;max-width:none;height:100%;border:0;box-shadow:none;background:none}
 .console>.commands{display:contents}
 #controls{display:grid;grid-template-columns:44px minmax(74px,1fr) 44px 44px 44px 48px;gap:4px;width:100%;height:48px;position:static;transform:none}
 #controls button,#controls #action{margin:0;padding:3px 2px;min-height:44px;min-width:0;font-size:14px;line-height:1.2;white-space:normal;overflow-wrap:normal}
 #controls #action{grid-column:auto;max-height:48px;overflow:hidden;word-break:normal;font-size:14px;background:#e8c58b}
 #controls #staminaReadout{padding:0;gap:1px;flex-wrap:nowrap;flex-direction:column;justify-content:center;font-size:10px;line-height:1.15}
 #controls #staminaReadout>span:first-child{font-size:10px}
 #controls #staminaReadout progress{width:35px;height:5px;margin:2px 0}
 #controls #staminaValue{font-size:11px;letter-spacing:-.6px;white-space:nowrap}
 .compact-only{display:block!important}
 #controls #chatToggle[data-unread=true]::after{content:' •';color:#ffd17f}
 #chatPanel{display:none;position:fixed;left:max(6px,env(safe-area-inset-left));right:max(6px,env(safe-area-inset-right));bottom:calc(68px + env(safe-area-inset-bottom));height:136px;max-height:calc(var(--visible-viewport-height,100svh) - 42px);z-index:8;padding:6px 8px;border:1px solid #9b8669;background:#302b30f5;box-shadow:0 -3px 14px #17131a55;pointer-events:auto;gap:4px}
 #chatPanel[data-history=true]{height:min(320px,calc(var(--visible-viewport-height,100svh)*.65))}
 main[data-keyboard=true][data-chat-open=true]{height:var(--game-visible-height,100svh)}
 main[data-chat-open=true] #hud{height:var(--chat-dock-height,136px);padding:0;border:0;background:none}
 main[data-chat-open=true] #controls,main[data-chat-open=true] #recent{display:none}
 main[data-chat-open=true] #chatPanel{bottom:var(--keyboard-inset,0px);left:0;right:0;height:var(--chat-dock-height,136px)}
 main[data-keyboard=true][data-short-chat=true] #chatPanel:not([data-history=true]){grid-template-rows:24px 1fr}
 main[data-keyboard=true][data-short-chat=true] #chatPanel:not([data-history=true]) #feed{display:none}
 main[data-chat-open=true] #chatPanel[data-history=true]{height:min(320px,calc(var(--visible-viewport-height,100svh)*.65))}
 main[data-keyboard=true][data-chat-open=true] .location{font-size:11px;opacity:.7}
 #chatPanel[data-open=true]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
 #chatPanel .console-heading{flex-wrap:nowrap}
 #chatPanel #feed{height:auto;max-height:none;min-height:0;font-size:14px;line-height:1.35;padding:2px 6px}
 #chatPanel:not([data-history=true]) #feed{overflow:hidden}
 #chatPanel .chat-latest{min-width:0;min-height:30px;padding:1px 5px;font-size:14px;white-space:nowrap}
 #chatPanel:not([data-history=true]) #feed>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #chatPanel #chat{min-height:42px}
 #chatPanel #chat input{font-size:16px;padding:8px}
 #chatPanel #chat button{min-width:56px}
 #chatClose,#chatHistory,#moreClose{padding:4px 9px;min-height:32px;font-size:14px}
 #chatPanel #near{margin-left:auto;font-size:11px}
 #morePanel{display:none;position:fixed;right:max(7px,env(safe-area-inset-right));bottom:calc(69px + env(safe-area-inset-bottom));width:min(300px,calc(100% - 14px));max-height:calc(var(--game-viewport-height,100svh)*.55);overflow:auto;z-index:7;padding:13px;background:#302b30fa;border:1px solid #9b8669;box-shadow:0 -3px 14px #17131a55;gap:9px}
 #morePanel[data-open=true]{display:flex}
 #morePanel #character{align-self:stretch;min-height:44px}
 #morePanel .map-routes{margin-top:2px}
 #morePanel #routes button{min-height:44px}
 #recoveryHint{font-size:12px;line-height:1.5}
 #recent{position:fixed;bottom:calc(72px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:90%;height:auto;max-height:3.7em;margin:0;padding:5px 8px;background:#24232cda;border-radius:3px;font-size:11px;line-height:1.4;pointer-events:none;z-index:6}
 #recent:empty{display:none}
 #sessionNotice{top:max(40px,env(safe-area-inset-top));bottom:auto;font-size:14px}
 #sessionNotice button{min-height:44px}
 #popupLayer{position:fixed;z-index:9;inset:0 0 calc(62px + env(safe-area-inset-bottom));padding:max(8px,env(safe-area-inset-top)) 8px 8px}
 #entry{position:absolute;inset:0;padding:8px;align-items:center}
 #join{width:min(100%,350px)}
 .player-tag{font-size:11px;padding:2px 3px}
 .speech{font-size:13px;max-width:min(210px,80cqw)}
}
