/* Handsets in portrait only. Tablets, desktops and phone landscape keep their own layouts. */
body.phone.handset-portrait:not(.tablet):not(.landscape) #game{--phone-footer:calc(186px + env(safe-area-inset-bottom));background:#ece1bd}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud{top:max(6px,env(safe-area-inset-top));left:max(6px,env(safe-area-inset-left));right:max(6px,env(safe-area-inset-right));height:134px;padding:6px 8px;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) 44px;grid-template-rows:49px 37px 24px;grid-template-areas:"identity money controls" "clock clock controls" "agenda agenda agenda";gap:3px 7px;border-radius:12px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #identity{height:49px;gap:4px;padding:0;min-width:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #portrait{width:30px;height:45px;flex-basis:30px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #firm{font-size:14px;line-height:17px;letter-spacing:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #reputation{font-size:10px;line-height:12px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .level-row{gap:4px;margin-top:2px;height:11px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #xpText{display:none}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .money{height:49px;padding:0;grid-template-columns:minmax(0,1fr);grid-template-rows:23px 12px 12px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #cash{grid-column:1;font-size:clamp(17px,5.1vw,22px);line-height:23px;letter-spacing:-.45px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #income,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #depotValue{grid-column:1;font-size:10px;line-height:12px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .clock{height:37px;padding:0;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:25px 11px;gap:1px 8px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #week{width:min(196px,54vw);height:25px;align-self:start;padding:2px 3px;border-radius:6px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #week span{height:19px;font-size:10px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #week .active::after{bottom:1px;width:2px;height:2px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #clock{font-size:20px;line-height:25px;letter-spacing:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #day{font-size:9px;line-height:11px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #hudControls{height:86px;justify-content:flex-start;padding-top:1px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #fullscreen{display:none!important}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #pauseButton{width:44px;height:44px;min-width:44px;min-height:44px;max-width:44px;flex-basis:44px;font-size:25px;line-height:40px;margin:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #firmAgenda{height:24px;gap:5px;grid-template-columns:minmax(0,1fr) auto}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #agendaTasks{height:24px;gap:4px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .agenda-label{display:none}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .agenda-chip{min-height:24px;height:24px;max-width:145px;font-size:10px;line-height:13px;padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;margin:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #firmAgenda #status{height:24px;max-width:70px;min-width:58px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .hud-energy{font-size:9px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud .hud-energy .energy-track{width:34px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #mapViewport{inset:var(--hud-bottom) 0 var(--phone-footer);height:auto;background:#b4be91;border-top:2px solid #b19a63;border-bottom:2px solid #b19a63}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #mapTools{display:grid;grid-template-columns:repeat(2,44px);gap:6px;right:max(8px,env(safe-area-inset-right));top:calc(var(--hud-bottom) + 8px)}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #mapTools button{width:44px;height:44px;min-height:44px;min-width:44px;padding:0;font-size:23px;border-radius:9px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #floors{top:calc(var(--hud-bottom) + 8px);left:8px;right:112px;width:auto;max-width:calc(100% - 120px);gap:5px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:none;padding-bottom:3px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #floors .floor-caption{display:none}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #floors button{flex:0 0 auto;min-height:44px;padding:6px 10px;font-size:11px;line-height:15px;white-space:nowrap}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #objective{left:10px;right:10px;bottom:calc(143px + env(safe-area-inset-bottom));width:auto;height:35px;min-height:35px;max-height:35px;padding:6px 29px 6px 10px;border-radius:8px;box-shadow:0 2px #c9b17c}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #objective>strong{font-size:12px;line-height:19px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #objective::after{top:6px;right:10px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #mainAction,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #mainAction.workday-end{left:10px;right:10px;bottom:calc(79px + env(safe-area-inset-bottom));width:calc(100% - 20px);max-width:none;min-width:0;transform:none;height:54px;min-height:54px;padding:8px 12px;border-radius:15px;font-size:20px;line-height:28px;white-space:nowrap}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dock{left:max(7px,env(safe-area-inset-left));right:max(7px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));width:auto;transform:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dock button{height:59px;min-height:44px;min-width:0;padding:5px 2px;gap:3px;font-size:10px;line-height:13px;border-radius:10px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dock i,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dock .game-icon{width:22px;height:22px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #toast{top:calc(var(--hud-bottom) + 8px);left:8px;right:112px;max-width:none;transform:none;width:auto;padding:9px 10px;font-size:12px;line-height:17px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panel,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panel.centered,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panel.wide,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panel[data-kind=team]{top:calc(var(--hud-bottom) + 7px);left:7px;right:7px;bottom:calc(77px + env(safe-area-inset-bottom));width:auto;max-width:none;transform:none;border-radius:12px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panel .panel-head{height:58px;padding:8px 10px;gap:8px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelTitle{font-size:19px;line-height:23px;max-width:calc(100% - 8px);overflow-wrap:anywhere}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #closePanel{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;flex:none}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody{height:calc(100% - 58px);padding:10px;font-size:14px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:center}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .row>div{min-width:0}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody button{min-height:44px;font-size:14px;line-height:20px;white-space:normal;overflow-wrap:anywhere}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody input,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody select,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dialogBody input{font-size:16px;min-height:44px;max-width:100%}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .team-grid,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .more-grid,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .handbook-grid,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .cast-grid,body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .assistant-options{grid-template-columns:1fr}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dialogBody:has(.story-scene){max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px)}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game .story-scene{grid-template-columns:clamp(76px,23vw,112px) minmax(0,1fr);gap:9px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game .story-scene .speaker-actor{height:clamp(145px,29vh,220px)}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game .story-scene .story-speech{font-size:14px;line-height:1.5;padding:12px;min-height:150px}
body.phone.handset-portrait:not(.tablet):not(.landscape) #game .story-scene .dialog-actions button{min-height:44px;font-size:13px}
@media(max-width:350px){body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud{gap:3px 5px;padding:6px}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #firm{font-size:12px}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #cash{font-size:16px}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #week{width:51vw}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #hud #week span{font-size:9px}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .row{grid-template-columns:1fr}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #panelBody .row>.buy{width:100%}body.phone.handset-portrait:not(.tablet):not(.landscape) #game #dock button{font-size:9px}}
