/* v5.7: one phone layout, explicit safe areas, contextual controls. */
[hidden]{display:none!important}
.v57-menu{display:none}.v57-rotate{display:none}
body.v57-phone{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--edge-left:max(12px,env(safe-area-inset-left,0px));--edge-right:max(12px,env(safe-area-inset-right,0px));}
.v57-phone #operations-button,.v57-phone .nw-launchers,.v57-phone .action-bar,.v57-phone .bottom-left,.v57-phone .resource-strip,.v57-phone .nw-compass,.v57-phone .nw-combat,.v57-phone .v2-version,.v57-phone .nw-tutorial,.v57-phone .zone-reveal{display:none!important}
.v57-phone #touch-controls{display:block!important;pointer-events:none}
.v57-phone #touch-controls button,.v57-phone #joystick{pointer-events:auto;touch-action:none}
.v57-phone .hud-top{left:var(--edge-left)!important;right:var(--edge-right)!important;top:calc(8px + var(--safe-top))!important;gap:8px!important}
.v57-phone .vitals-card{flex:0 0 auto!important;width:230px!important;min-width:0!important;padding:7px 9px!important;height:67px!important}
.v57-phone .avatar{width:34px!important;height:46px!important}
.v57-phone .survivor-label{font-size:11px!important}.v57-phone .health-row b{font-size:13px!important}
.v57-phone .mini-stats b{font-size:11px!important}.v57-phone .time-card{display:none!important}
.v57-phone #pause-button{position:fixed!important;right:var(--edge-right)!important;top:calc(8px + var(--safe-top))!important;width:44px!important;height:44px!important;background:#132b32f5}
.v57-phone .v57-menu{display:block;position:absolute;right:var(--edge-right);top:calc(60px + var(--safe-top));width:44px;height:44px;border:1px solid #acbfac;border-radius:10px;background:#19343bec;color:#ffdf9d;font:700 13px system-ui;pointer-events:auto;z-index:26}
.v57-phone .mission-card{left:var(--edge-left)!important;top:calc(82px + var(--safe-top))!important;width:210px!important;padding:8px 10px!important;height:auto!important;min-height:44px!important;pointer-events:auto}
.v57-phone .mission-card .mission-top,.v57-phone .mission-card p,.v57-phone .mission-track,.v57-phone .mission-bottom>span:last-child{display:none!important}
.v57-phone .mission-heading{margin:0!important}.v57-phone .mission-heading strong{font-size:13px!important}.v57-phone .mission-bottom{font-size:12px!important;margin-top:4px!important}
.v57-phone .mini-card{right:calc(var(--edge-right) + 52px)!important;top:calc(8px + var(--safe-top))!important;width:94px!important;height:84px!important;padding:4px!important}
.v57-phone .mini-card canvas{height:58px!important;width:84px!important}.v57-phone .mini-card div{font-size:10px!important;padding:2px!important}.v57-phone .mini-card b{display:none!important}
.v57-phone .fc-camera{left:50%!important;right:auto!important;top:auto!important;bottom:calc(8px + var(--safe-bottom))!important;transform:translateX(-50%);z-index:24}
.v57-phone .fc-camera button{height:44px!important;min-width:44px!important;font-size:17px!important}.v57-phone .fc-camera #fc-zoom-value{font-size:12px!important}.v57-phone .fc-camera #fc-holster{font-size:12px!important}
.v57-phone .weapon-rack{bottom:calc(61px + var(--safe-bottom))!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:auto!important;max-width:calc(100vw - 290px)!important;flex-wrap:wrap;justify-content:center;gap:4px!important;padding:4px!important}
.v57-phone .weapon{min-width:46px!important;width:49px!important;max-width:60px!important;height:46px!important;padding:3px!important}.v57-phone .weapon img{width:22px!important;height:22px!important}.v57-phone .weapon span{font-size:11px!important;white-space:nowrap}.v57-phone .weapon kbd{display:none!important}.v57-phone #reload-button{min-width:44px;height:46px;font-size:14px!important}.v57-phone #reload-button span{font-size:11px!important}
.v57-phone .joystick{left:calc(var(--edge-left) + 10px)!important;bottom:calc(22px + var(--safe-bottom))!important;width:112px!important;height:112px!important;opacity:.83}
.v57-phone .touch-combat{right:var(--edge-right)!important;left:auto!important;bottom:calc(18px + var(--safe-bottom))!important;width:158px!important;height:134px!important;transform:scale(var(--nw-control-scale,1));transform-origin:bottom right}
.v57-phone .touch-attack{width:78px!important;height:78px!important;right:0!important;bottom:0!important}.v57-phone .touch-attack b{font-size:13px!important}.v57-phone .touch-small{width:52px!important;height:52px!important;font-size:20px!important}.v57-phone .touch-small span{font-size:12px!important}.v57-phone .interact-touch{right:88px!important;bottom:0!important}.v57-phone .dodge-touch{right:3px!important;bottom:84px!important}
.v57-phone .quick-tools{right:calc(var(--edge-right) + 61px)!important;bottom:calc(103px + var(--safe-bottom))!important;top:auto!important;gap:5px!important}.v57-phone .quick-tools button{height:44px!important;width:44px!important}.v57-phone .quick-tools button>span{font-size:11px!important}
.v57-phone .interaction-chip{left:50%!important;top:auto!important;bottom:calc(124px + var(--safe-bottom))!important;transform:translateX(-50%)!important;font-size:13px!important;max-width:calc(100vw - 330px)!important;white-space:normal;text-align:center;padding:6px 9px!important;pointer-events:none}
.v57-phone .radio-dialogue{left:50%!important;top:calc(8px + var(--safe-top))!important;bottom:auto!important;width:min(330px,calc(100vw - 500px))!important;max-width:none!important;transform:translateX(-50%);padding:8px 38px 8px 10px!important;max-height:100px!important;overflow:auto;pointer-events:none;background:#10272fee}
.v57-phone .radio-dialogue img,.v57-phone .radio-dialogue .tiny{display:none!important}.v57-phone .radio-dialogue p{font-size:13px!important;line-height:1.5!important;margin:0!important}.v57-phone #radio-close{position:absolute;right:0;top:0;width:44px;height:44px;pointer-events:auto}
.v57-phone .bo-field-hud{left:var(--edge-left)!important;top:calc(82px + var(--safe-top))!important;width:208px!important;padding:8px 10px!important;min-height:44px!important}.v57-phone .bo-field-top,.v57-phone .bo-field-dots,.v57-phone .bo-field-hud small{display:none!important}.v57-phone .bo-field-hud strong{font-size:14px!important;margin:0 0 3px!important}.v57-phone .bo-field-hud>span{font-size:12px!important}
.v57-phone .state-alert{top:calc(143px + var(--safe-top))!important;left:var(--edge-left)!important;max-width:210px;font-size:12px!important}.v57-phone .toasts{top:36%!important;left:50%!important;right:auto!important;transform:translateX(-50%);max-width:260px!important;pointer-events:none}.v57-phone .toast{font-size:13px!important}
.v57-phone .build-strip{bottom:calc(163px + var(--safe-bottom))!important;font-size:13px!important;max-width:95vw}.v57-phone .build-strip .btn{min-height:44px}
.v57-phone .save-status{display:none!important}.v57-panel .v57-rotate{display:none!important}
.v57-phone.nw-left-handed .joystick{left:auto!important;right:calc(var(--edge-right) + 10px)!important}.v57-phone.nw-left-handed .touch-combat{right:auto!important;left:var(--edge-left)!important;transform-origin:bottom left}.v57-phone.nw-left-handed .quick-tools{right:auto!important;left:calc(var(--edge-left) + 61px)!important}
.v57-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.v57-tile{min-height:74px;text-align:left;padding:12px;border:1px solid #688b82;border-radius:10px;background:#25454c;color:#fff3d6;cursor:pointer}.v57-tile strong{display:block;font-size:17px}.v57-tile span{display:block;font-size:13px;color:#c5d6cc;margin-top:4px}.v57-hint{font-size:14px;line-height:1.7}.v57-dev{border:1px solid #496660;border-radius:8px;padding:12px;margin:14px 0}.v57-dev summary{cursor:pointer;font-size:14px;min-height:32px}
.v57-phone .modal-overlay{padding:max(8px,env(safe-area-inset-top)) var(--edge-right) max(8px,env(safe-area-inset-bottom)) var(--edge-left)!important}.v57-phone .modal-panel{max-height:100%!important;width:min(900px,100%)!important}.v57-phone .modal-header{padding:10px 16px!important}.v57-phone .modal-header h2{font-size:22px!important}.v57-phone .modal-content{padding:14px 16px!important}.v57-phone .modal-content p,.v57-phone .recipe-desc,.v57-phone .item-desc,.v57-phone .settings-row label{font-size:14px!important;line-height:1.6!important}.v57-phone .modal-content .btn,.v57-phone .tabs button,.v57-phone .modal-header button{min-height:44px!important;font-size:14px!important}.v57-phone .recipe-card{padding:12px!important}.v57-phone .recipe-art{width:42px!important;height:42px!important}.v57-phone .recipe-top h3{font-size:16px!important}.v57-phone .recipe-desc{min-height:0!important;margin:8px 0!important}.v57-phone .recipe-cost{font-size:12px!important}.v57-phone .bo-site-body p{min-height:0!important}.v57-phone .bo-site-art{display:none!important}.v57-phone .bo-site-card{display:block!important}.v57-phone .bo-site-body h3{font-size:20px!important}.v57-phone .bo-site-meta{font-size:11px!important}.v57-phone .bo-site-grid{gap:12px!important}.v57-phone .bo-supply{margin:10px 0!important}.v57-phone .bo-site-body{padding:14px!important}.v57-phone .bo-tabs{padding:8px 0!important}
@media(orientation:portrait) and (max-width:1024px){
 .v57-phone .vitals-card{width:210px!important}.v57-phone .mini-card{top:calc(80px + var(--safe-top))!important;right:var(--edge-right)!important;width:76px!important;height:73px!important}.v57-phone .mini-card canvas{width:66px!important;height:48px!important}
 .v57-phone .v57-menu{top:calc(8px + var(--safe-top))!important;right:calc(var(--edge-right) + 52px)!important}
 .v57-phone .mission-card,.v57-phone .bo-field-hud{width:calc(100vw - 115px)!important;max-width:260px}
 .v57-phone .radio-dialogue{top:calc(160px + var(--safe-top))!important;width:calc(100vw - 24px)!important;max-height:72px!important}
 .v57-phone .weapon-rack{max-width:calc(100vw - 24px)!important;bottom:calc(153px + var(--safe-bottom))!important}.v57-phone .fc-camera{bottom:calc(8px + var(--safe-bottom))!important}.v57-phone .joystick{bottom:calc(59px + var(--safe-bottom))!important;left:var(--edge-left)!important}.v57-phone .touch-combat{bottom:calc(59px + var(--safe-bottom))!important}
 .v57-phone .quick-tools{top:auto!important;bottom:calc(220px + var(--safe-bottom))!important;right:var(--edge-right)!important}
 .v57-phone .interaction-chip{bottom:calc(274px + var(--safe-bottom))!important;max-width:calc(100vw - 30px)!important;min-width:160px}
 .v57-phone .v57-rotate{display:block;position:absolute;top:calc(238px + var(--safe-top));left:50%;transform:translateX(-50%);font-size:11px;color:#d5e2d1;pointer-events:none;white-space:nowrap;text-shadow:0 1px 3px #000}
 .v57-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.v57-phone .state-alert{top:calc(134px + var(--safe-top))!important}.v57-phone .build-strip{bottom:calc(278px + var(--safe-bottom))!important}
}
@media(max-height:380px) and (orientation:landscape){.v57-phone .joystick{width:98px!important;height:98px!important}.v57-phone .quick-tools{bottom:calc(157px + var(--safe-bottom))!important;right:var(--edge-right)!important}.v57-phone .radio-dialogue{max-height:70px!important}.v57-phone .interaction-chip{bottom:calc(118px + var(--safe-bottom))!important}}
/* Numeric secondary vitals stay legible without overflowing narrow cards. */
.v57-phone .mini-stats{justify-content:space-between!important;gap:6px!important}
.v57-phone .mini-stats>div{min-width:0!important;gap:3px!important}
.v57-phone .mini-stats .meter{display:none!important}
.v57-phone .toasts{top:calc(8px + var(--safe-top))!important;max-width:min(330px,calc(100vw - 500px))!important;width:330px}
.v57-phone .toast:nth-last-child(n+3){display:none}
.v57-phone #hud:has(.toast) .radio-dialogue{visibility:hidden}
@media(orientation:portrait) and (max-width:1024px){.v57-phone .toasts{top:calc(160px + var(--safe-top))!important;max-width:calc(100vw - 24px)!important;width:calc(100vw - 24px)}}

/* Orientation advice belongs in menus, never over the character. */
.v57-phone .v57-rotate{display:none!important}
.v57-phone .v57-tile:disabled{opacity:.45;cursor:default}

/* v5.7.4: phone menus prioritise reading and vertical scrolling in both orientations. */
.v57-phone .modal-panel{display:flex!important;flex-direction:column!important;min-height:0;overflow:hidden!important}
.v57-phone .modal-header,.v57-phone .modal-footer{flex-shrink:0}
.v57-phone .modal-content{min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;font-size:17px!important;line-height:1.6!important}
.v57-phone .modal-content :is(.settings-grid,.recipe-grid,.inventory-grid,.help-grid,.journal-grid,.map-layout,.stat-grid,.v57-grid,.bo-site-grid,.c6-skins){grid-template-columns:minmax(0,1fr)!important}
.v57-phone .modal-content :is(p,label,small,.tiny,.recipe-desc,.item-desc,.recipe-cost,.bo-site-meta,.v57-hint,.v57-tile span){font-size:16px!important;line-height:1.6!important}
.v57-phone .modal-content :is(h3,.v57-tile strong){font-size:20px!important}
.v57-phone .modal-content :is(button,.btn,select,summary),.v57-phone .modal-header button{min-height:48px!important;min-width:48px!important;font-size:17px!important;touch-action:manipulation}
.v57-phone .modal-content input[type=range]{min-height:48px!important;width:100%;touch-action:pan-x}
.v57-phone .modal-content :is(.settings-row,.setting-row){min-height:64px!important;gap:16px!important}
.v57-phone .modal-content :is(.recipe-art,.item-icon){width:56px!important;height:56px!important;flex-shrink:0}
.v57-phone .modal-content .v57-tile{min-height:76px!important;padding:16px!important}
.v57-phone .modal-content .tabs{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
.v57-phone .modal-content .map-side{display:block!important}
.v57-phone :is(.survivor-label,.mini-stats b,.health-row b){font-size:14px!important}
.v57-phone :is(.mission-heading strong,.bo-field-hud strong,.interaction-chip,.toast,.radio-dialogue p){font-size:16px!important}
.v57-phone :is(.mission-bottom,.bo-field-hud>span,.weapon span,.touch-small span,.touch-attack b){font-size:14px!important}
.v57-phone .weapon img{width:30px!important;height:30px!important}
.v57-phone .weapon{height:56px!important;min-width:54px!important}
.v57-phone .quick-tools button,.v57-phone #pause-button,.v57-phone .v57-menu{min-width:48px!important;min-height:48px!important}
.v57-phone .modal-content input[type=checkbox]{width:56px!important;height:48px!important;min-width:56px!important;flex-shrink:0;cursor:pointer}
.v57-phone .modal-content .settings-row:has(input[type=range]),.v57-phone .modal-content .settings-row:has(select){flex-direction:column!important;align-items:stretch!important}
.v57-phone .modal-content .settings-row label{cursor:pointer}
.v57-phone .modal-footer{font-size:13px!important}
.v57-phone .modal-content input[type=checkbox]{border-radius:24px!important}
.v57-phone .modal-content input[type=checkbox]::before{width:24px!important;height:24px!important;top:11px!important;left:5px!important}
.v57-phone .modal-content input[type=checkbox]:checked::before{transform:translateX(20px)!important}
.v57-phone .modal-content input[type=range]{max-width:none!important;align-self:stretch!important}
/* Whole-menu audit: secondary systems share the same phone rules. */
.v575-confirm{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:16px;background:#061419eF;color:#f4edda}
.v575-confirm>div{width:min(540px,100%);max-height:100%;overflow:auto;padding:24px;background:#18343d;border:1px solid #859c91;border-radius:16px;font:18px/1.6 system-ui}
.v575-confirm button{display:block;width:100%;min-height:52px;font-size:17px;margin-top:14px}
.v575-back{margin-left:auto;margin-right:12px;flex-shrink:0}
.v575-guide{padding:12px;border:1px solid #6a877c;border-radius:8px;margin-bottom:12px}
.v575-guide summary{cursor:pointer;display:flex;align-items:center;min-height:48px;font-size:17px}
.v57-phone .modal-content :is(.nw-settings-grid,.nw-contract-grid,.nw-doctrine-grid,.nw-equipped,.nw-gear-grid,.nw-research-grid,.nw-result-grid,.bo-perk-grid,.bo-score-grid,.bo-logistics-grid,.station-card,.intro-hero){grid-template-columns:minmax(0,1fr)!important}
.v57-phone .modal-content :is(.notice,.station,.ingredient,.ingredients,.inventory-summary,.item-count,.section-label,.nw-wallet,.nw-statline,.nw-card-meta,.nw-slot-label,.map-legend,.bo-note,.bo-notice,.bo-site-meta,.bo-active-meta){font-size:16px!important;line-height:1.6!important}
.v57-phone .modal-content :is(.nw-panel-tabs,.bo-tabs,.nw-wallet,.nw-statline){display:flex!important;flex-wrap:wrap!important;gap:10px!important}
.v57-phone .modal-content .nw-panel-hero{padding:12px!important;margin-bottom:12px!important;min-height:0!important}
.v57-phone .modal-content .nw-panel-hero h3{margin:4px 0!important}
.v57-phone .modal-content .nw-panel-hero .eyebrow,.v57-phone .modal-content .nw-insignia{display:none!important}
.v57-phone .modal-content :is(.nw-gear-actions,.settings-buttons){display:flex!important;flex-direction:column!important;gap:10px!important}
.v57-phone .modal-content .station-card>img,.v57-phone .modal-content .intro-hero>img{max-height:120px!important;width:auto!important;margin:auto!important}
.v57-phone .modal-content :is(.nw-gear-card,.nw-tech-card,.nw-contract-card,.bo-dispatch-card){min-width:0!important}
.v57-phone .modal-header h2{min-width:0!important;flex:1;font-size:20px!important}
/* Cover controls must also remain readable on a landscape phone. */
.v57-phone #title-screen{overflow-y:auto!important;touch-action:pan-y}
.v57-phone .title-links{display:flex;flex-wrap:wrap;gap:8px}
.v57-phone .title-links :is(button,a){min-height:48px;display:inline-flex;align-items:center;font-size:16px!important}
.v57-phone .title-actions .btn.large{min-height:52px!important;font-size:18px!important}
/* Full loadout, not only the starting axe, must fit the phone weapon tray. */
.v57-phone .weapon-rack{display:flex!important;flex-wrap:nowrap!important;width:340px!important;gap:4px!important;align-items:center!important;overflow:visible!important}
.v57-phone .weapon{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;flex:1 1 56px!important;width:56px!important;min-width:46px!important;max-width:none!important;height:64px!important;padding:4px 2px!important}
.v57-phone .weapon img{width:28px!important;height:28px!important;flex-shrink:0}
.v57-phone .weapon span{font-size:12px!important;line-height:18px!important;max-width:100%;text-align:center}
.v57-phone #reload-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;flex:0 0 48px;min-width:48px!important;height:64px!important;padding:4px!important;font-size:14px!important}
.v57-phone #reload-button .v576-reload-meter{display:block!important;position:relative;width:38px;height:8px;background:linear-gradient(to right,#48636b 48%,#f2cb78 48% 70%,#48636b 70%);border-radius:3px}
.v576-reload-meter i{display:block;position:absolute;left:var(--reload-progress,0%);top:-2px;width:3px;height:12px;background:white}
.v57-phone #reload-button.v576-perfect{background:#345d36;color:#ffe9a5;border-color:#ffd586}
.v57-phone #reload-button:disabled{opacity:.55}
.v57-phone .state-alert{transform:none!important}
.v57-phone #reload-button .v576-reload-meter[hidden]{display:none!important}
.v57-phone .modal-content :is(.nw-wallet,.nw-statline,.bo-stock-grid) :is(span,b,small){font-size:16px!important;line-height:1.5!important}
@media(orientation:portrait) and (max-width:1024px){
 .v57-phone .weapon-rack{bottom:calc(210px + var(--safe-bottom))!important}
 .v57-phone .quick-tools{bottom:calc(288px + var(--safe-bottom))!important}
 .v57-phone .interaction-chip{bottom:calc(344px + var(--safe-bottom))!important}
 .v57-phone .build-strip{bottom:calc(380px + var(--safe-bottom))!important}
 .v57-phone .state-alert{top:calc(166px + var(--safe-top))!important}
}
/* Explicit visibility must win over the full-loadout flex layout. */
.v57-phone .weapon-rack .weapon[hidden]{display:none!important}

.v57-phone .weapon-rack{width:max-content!important}
.v57-phone .weapon{flex:0 0 56px!important}

/* Destination risk and progress must stay readable on phones. */
.v57-phone .poi-button{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:5px;min-height:80px;padding:12px!important;text-align:left;}
.v57-phone .poi-button span,.v57-phone .poi-button small{font-size:14px!important;line-height:1.4!important;color:#d3dcca!important;}

.nearby-target{display:block;width:100%;min-height:52px;margin:10px 0;text-align:left;white-space:normal;font-size:17px;}

/* Building is paused: reserve the bottom rail for placement, leaving ground clear. */
.v57-phone #hud:has(#build-strip:not([hidden])) .weapon-rack,
.v57-phone #hud:has(#build-strip:not([hidden])) .touch-controls,
.v57-phone #hud:has(#build-strip:not([hidden])) .quick-tools,
.v57-phone #hud:has(#build-strip:not([hidden])) .interaction-chip{display:none!important}
.v57-phone:has(#build-strip:not([hidden])) .fc-camera{display:none!important}
.v57-phone .build-strip{bottom:calc(12px + var(--safe-bottom))!important;font-size:16px!important;max-width:calc(100vw - 24px)!important}
.v57-phone .build-strip .btn{min-width:64px;min-height:48px!important;font-size:16px!important}
@media(orientation:portrait){.v57-phone .build-strip{width:calc(100vw - 24px);flex-wrap:wrap;justify-content:center}.v57-phone #build-label{flex-basis:100%;text-align:center}}
.v5714-vitals{font-size:17px;line-height:1.5;display:block;padding:12px;border:1px solid #68827a;border-radius:10px;margin-bottom:12px}.v5714-vitals strong{display:block;margin-top:7px}.v5714-vitals.v5714-low{border-color:#e9a18c;background:#472f2c;color:#ffddd1}
.nearby-target strong,.nearby-target span{display:block}.nearby-target span{font-size:16px;line-height:1.5;color:#c8d9d0;margin-top:3px}.nearby-target{text-align:left}
/* Free the lower central field of view; camera remains available in Tools. */
.v57-phone .fc-camera{display:none!important}
@media (orientation:landscape){.v57-phone .weapon-rack{bottom:calc(8px + var(--safe-bottom))!important}}
#phone-camera-scale{display:block;width:100%;min-height:48px;margin:12px 0}
#phone-camera-value{display:block;font-size:20px;margin-bottom:16px}
/* Keep the defense timer readable while short combat notices arrive. */
@media(orientation:landscape){
 .v57-phone #hud:has(#extraction-hud:not([hidden])) .toast:not(:last-child){display:none}
 .v57-phone #hud:has(#extraction-hud:not([hidden])) .toast{box-sizing:border-box;max-height:52px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 .v57-phone #hud:has(#extraction-hud:not([hidden])) .radio-dialogue{box-sizing:border-box;max-height:52px!important}
}

.o42-choices{display:grid;gap:12px}.o42-choice{display:flex;align-items:center;gap:12px;width:100%;min-height:80px;text-align:left;padding:8px 14px}.o42-choice img{width:64px;height:64px;object-fit:contain;flex:none}.o42-choice strong{font-size:17px;flex:1}.o42-selected{font-size:15px;flex:none}.o42-choice[aria-pressed="true"]{border-color:#efd596;background:#364943}

/* Keep action feedback visible above the paused game layer. */
#modal-footnote[data-feedback]{color:#d7efda;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
#modal-footnote[data-feedback="warning"]{color:#ffdf9d}

.b48-upgrade-card>.btn{display:block;width:100%;min-height:48px;margin-top:10px;padding:10px 14px;font-size:16px;line-height:1.5;white-space:normal;text-align:left}
.b48-upgrade-card>.btn:disabled{opacity:1;color:#b9c8c9;background:#23383e;border-color:#53696f;cursor:not-allowed}
#mobile-route{display:none;pointer-events:none}
.v57-phone #mobile-route:not([hidden]){display:block;position:absolute;top:58px;left:50%;transform:translateX(-50%);padding:7px 12px;border:1px solid #d8ba79;border-radius:7px;background:#132c30ee;color:#ffe2a5;font-size:16px;line-height:22px;white-space:nowrap;z-index:12}
@media(max-width:599px){.v57-phone #mobile-route:not([hidden]){top:84px;left:auto;right:112px;transform:none;font-size:14px;padding:5px 8px}}

.f51-crop{display:block;width:100%;min-height:48px;margin-top:12px;white-space:normal!important;font-size:16px!important;line-height:1.5!important;text-align:left}

.station-card.f51-planter{display:block}
.h58-warning{padding:16px;margin-bottom:16px;background:#442e29;border:1px solid #cc987b;border-radius:12px;color:#fff0df}.h58-warning h3{font-size:18px;margin:0 0 8px}.h58-warning p{font-size:16px;line-height:1.55;margin:8px 0}

/* Deep QA: one cover scroll area, with every control and footer in normal flow. */
#title-screen{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;padding:calc(20px + var(--safe-top)) max(20px,env(safe-area-inset-right)) calc(20px + var(--safe-bottom)) max(20px,env(safe-area-inset-left))}
#title-screen .title-top{position:relative;inset:auto;max-width:100%;flex-wrap:wrap;margin-bottom:26px}
#title-screen .title-copy{position:relative;left:auto;top:auto!important;transform:none!important;width:min(430px,100%);max-width:100%;max-height:none!important;overflow:visible!important;padding:0!important}
#title-screen .title-copy>*{max-width:100%;min-width:0}
#title-screen .title-actions{width:100%;flex-wrap:wrap}
#title-screen .title-actions .btn{flex:1 1 150px;max-width:100%;white-space:normal}
#title-screen .title-links{flex-wrap:wrap;overflow-wrap:anywhere}
#title-screen .title-footer{position:relative;inset:auto;margin-top:24px;min-height:0;gap:12px;flex-wrap:wrap;font-size:12px;line-height:1.5;padding:12px 0 0}
#title-screen .difficulty-control{max-width:100%;flex-wrap:wrap}
#title-screen .difficulty-control select{max-width:100%;min-height:48px;font-size:16px}
#title-screen .title-desc{color:#e0e8da}
/* Intro portrait sits at the beginning of the story, never halfway down a long grid. */
#modal .intro-hero{align-items:start;grid-template-columns:minmax(0,150px) minmax(0,1fr)}
#modal .intro-hero>img{align-self:start;object-position:center top;object-fit:contain;width:100%;height:auto;max-height:180px;margin:0}
#modal .intro-story{min-width:0}
#modal .intro-story p{color:#e0e8d8;font-size:16px;line-height:1.75}
#loading .loading-title span{color:#e8efd9;font-size:20px;letter-spacing:.5px}
#loading #load-message{color:#e8efd9;font-size:16px;line-height:1.6;text-align:center;max-width:90%;overflow-wrap:anywhere}
/* Desktop arrival notices occupy the top information strip, away from the player. */
body:not(.v57-phone) #zone-reveal{top:calc(112px + var(--safe-top));max-width:min(calc(100% - 24px),max(180px,calc(100% - 660px)));padding:6px 12px;background:#10262fee;border-radius:8px;pointer-events:none}
body:not(.v57-phone) #zone-reveal strong{font-size:20px;letter-spacing:1px;line-height:1.3;overflow-wrap:anywhere}
body:not(.v57-phone) #zone-reveal span{color:#edf1d9;font-size:12px;letter-spacing:1px}
@media(max-width:1024px){
 #title-screen .title-art{inset:0 0 auto auto;width:100%;height:min(42vw,290px);background-size:contain!important;background-repeat:no-repeat;background-position:right top!important;transform:none!important}
 #title-screen .title-copy{background:#132226e8;border-radius:12px;padding:16px!important}
 #title-screen .title-top{margin-bottom:18px}
 #title-screen .title-footer>span:last-child{display:block}
 #title-screen .cover-caption{display:none}
 #modal .intro-hero{grid-template-columns:minmax(0,1fr);gap:16px}
 #modal .intro-hero>img{max-height:120px;width:auto;max-width:100%;justify-self:center}
}
@media(max-height:550px) and (orientation:landscape){
 #title-screen{padding-top:calc(12px + var(--safe-top));padding-bottom:calc(16px + var(--safe-bottom))}
 #title-screen .title-copy{width:min(480px,100%)}
 #title-screen .title-art{width:52%;height:calc(100dvh - 24px);background-size:contain!important;background-position:center top!important}
 #title-screen .title-actions .btn.large{width:auto;height:auto;min-height:52px}
 #title-screen .title-footer{margin-top:16px}
}

/* QA verify: defer update prompt while a game dialog is open. */
body:has(#modal:not([hidden])) #nw-update-notice{display:none!important}
#nw-update-notice{box-sizing:border-box;max-height:calc(100dvh - 24px);overflow-y:auto}
#nw-update-notice button{min-height:48px;font-size:16px}
@media(max-width:1024px){
 #title-screen .title-art{position:relative!important;inset:auto!important;width:100%!important;height:180px!important;flex:none;background-position:center!important;order:0}
 #title-screen{display:flex;flex-direction:column;align-items:stretch}
 #title-screen .title-top{order:-1}
 #title-screen .title-copy{width:100%!important;box-sizing:border-box}
 #title-screen .title-footer{flex-shrink:0}
}
