/* Mobile composition; all image and normalized hotspot geometry stays intact. */
:root{--touch:44px;--space:12px;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--mobile-sheet:62dvh;--ui-toast:5}
.mobile-shell{grid-template-rows:54px 38px 0 minmax(0,1fr) 64px}
.mobile-shell .compact-hud{display:flex;justify-content:center;padding:2px 12px;gap:16px}
.mobile-shell .hud-token{min-width:90px}.mobile-shell .hud-token strong{font-size:18px}
.context-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#24281f;border-bottom:1px solid #66583e;padding:0 16px;min-width:0;z-index:var(--ui-context)}
.screen-context{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:14px Georgia}.screen-context [data-world-phase]{color:var(--ui-muted);font-size:12px}
.context-tool{background:transparent;border:0;min-height:36px;font:12px Georgia;padding:4px 8px;flex:none}
.mobile-shell .bottom-nav{grid-template-columns:repeat(5,1fr)}
.mobile-shell .feedback-slot{position:relative;z-index:var(--ui-toast);pointer-events:none}
/* The old bottom offset must not constrain this top-anchored message's height. */
.mobile-shell .feedback-slot #toast{position:absolute;top:8px;bottom:auto;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);height:auto;white-space:normal;overflow-wrap:anywhere;line-height:1.4;box-shadow:0 3px 0 #141b14;border:1px solid var(--ui-border);padding:10px 14px}
.mobile-shell .scene-heading{display:none}.mobile-shell .game-workspace{position:relative}
.mobile-shell .overview-map .scene-controls,.mobile-shell .district-view .scene-controls{display:none}
/* Navigation out of a map must survive hidden scene controls and access gates. */
.map-navigation{display:flex;flex:none;flex-wrap:wrap;gap:4px;padding:3px 8px;background:#24281f;border-bottom:1px solid #66583e}
.map-navigation>button{min-height:44px;flex:1 1 auto;background:transparent;border:1px solid #66583e;padding:4px 8px;font:13px Georgia;color:#ffeac1}
.map-navigation>button.primary{background:#4b4028}.transit-recovery{flex:1 1 100%;padding:4px}.transit-recovery>button{min-height:44px}
.context-cost{font:14px Georgia;color:var(--ui-active);margin:8px 0}.context-description{font:14px/1.4 Georgia}
.quest-entry{border:0!important;border-bottom:1px solid #655b40!important;padding:0!important;background:transparent!important}
.quest-entry>summary{padding:14px 8px;min-height:44px;cursor:pointer}.quest-entry>summary h2{display:inline;font:18px Georgia;margin:0}.quest-entry>summary small{display:block;color:var(--ui-muted);font:12px Georgia;margin:6px 0}.quest-entry>div{padding:8px 12px 16px}
.mobile-shell .quest-folio>header>p,.mobile-shell .menu-title>.eyebrow,.mobile-shell .page-title .eyebrow,.mobile-shell .page-title .edition{display:none}
.mobile-shell .menu-title,.mobile-shell .page-title{padding:6px 0}.mobile-shell .menu-title h1,.mobile-shell .page-title h2,.mobile-shell .quest-folio>header h1{font:24px Georgia;margin:0 0 12px}
.mobile-shell .quest-folio>footer{display:flex;flex-wrap:wrap}.mobile-shell .panel{box-shadow:none;border-width:0 0 1px;background:transparent}
.mobile-shell .quest-tracker{border:0;padding:0 8px}.mobile-shell .quest-tracker summary{min-height:40px;line-height:1.3}.mobile-shell .quest-tracker summary small{display:none}.mobile-shell .quest-tracker summary strong{font:13px Georgia}.mobile-shell .quest-tracker .standard-icon{width:24px;height:24px}
.mobile-shell .scene-hotspot{min-width:44px;min-height:44px}
.mobile-shell .scene-viewport{overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-width:thin}
.mobile-shell .scene-canvas{width:calc(max(640px,min(100cqw,150cqh)) * var(--scene-scale,1))}.mobile-shell .overview-map .scene-canvas{width:calc(max(640px,min(100cqw,156.25cqh)) * var(--scene-scale,1))}.mobile-shell .district-view .scene-canvas{width:calc(max(640px,min(100cqw,160cqh)) * var(--scene-scale,1))}
.mobile-shell .district-sign strong{font-size:14px}.mobile-shell .district-sign small{display:none}.mobile-shell .district-sign[aria-pressed=true] small{display:block}.mobile-shell .district-sign .district-summary{font-size:10px}.mobile-shell .district-sign{min-height:44px;padding:4px 7px}
.trade-tabs{display:flex;gap:0;margin:0 0 12px}.trade-tabs button{flex:1;min-height:44px}.trade-tabs [aria-current]{background:#51452d;color:#ffe1a1}
.trade-item-list{display:grid;grid-template-columns:1fr 1fr;gap:12px}.trade-item-list article{border-bottom:1px solid #776548;padding:8px 0}.trade-item-list h3{font:18px Georgia}.trade-item-list p{font:14px/1.5 Georgia}.trade-item-list .trade-sprite{width:72px;height:72px}
.trade-options{padding-top:12px}.trade-options>summary{min-height:44px}
@media(max-width:1000px){
 .mobile-shell{height:100dvh;min-height:0;grid-template-rows:calc(48px + var(--safe-top)) 40px 0 minmax(0,1fr) calc(60px + var(--safe-bottom));padding:0}
 .mobile-shell .compact-hud{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:var(--safe-top) 6px 0;gap:0;box-shadow:none}
 .mobile-shell .hud-token{min-width:0;min-height:44px;padding:3px 4px;text-align:center;white-space:nowrap}.mobile-shell .hud-token strong{font:17px Georgia}.mobile-shell .hud-token small{font:9px Arial;letter-spacing:.5px}.mobile-shell .hud-token em{font-size:11px}
 .context-strip{padding:0 8px}.context-tool{min-height:40px}.screen-context{font-size:13px}
 .mobile-shell .bottom-nav{display:grid;padding:0 2px var(--safe-bottom);min-height:0;gap:0}.mobile-shell .bottom-nav button{min-height:54px;max-width:none;padding:3px 1px;font:10px Arial;border:0}.mobile-shell .bottom-nav .standard-icon{width:28px;height:28px}.mobile-shell .bottom-nav .action-label{display:flex;flex-direction:column;gap:2px}
 .mobile-shell .game-workspace,.mobile-shell .game-workspace:has(#modal[open]){display:block;position:relative;min-height:0;overflow:hidden}
 .mobile-shell .game-workspace #main{height:100%;max-height:none;overflow:auto;padding:0;display:flex;flex-direction:column}.mobile-shell .game-workspace #main:not(:has(>.world-view)){padding:12px}
 .mobile-shell .world-view{flex:1;min-height:0;height:auto;display:flex;flex-direction:column}.mobile-shell .scene-workspace,.mobile-shell .scene-workspace.has-context{display:block;flex:1;min-height:0;position:relative}
 .mobile-shell .scene-viewport{height:100%;width:100%;position:relative}.mobile-shell .scene-canvas{width:calc(max(100cqw,150cqh) * var(--scene-scale,1));margin:0;min-width:100%;height:auto;aspect-ratio:3/2}.mobile-shell .overview-map .scene-canvas{width:calc(max(100cqw,156.25cqh) * var(--scene-scale,1));aspect-ratio:25/16}.mobile-shell .district-view .scene-canvas{width:calc(max(100cqw,160cqh) * var(--scene-scale,1));aspect-ratio:8/5}
 .mobile-shell .place-context{position:absolute;inset:auto 0 0;z-index:var(--ui-context);max-height:var(--mobile-sheet);border:0;border-top:2px solid var(--ui-border);padding:10px 16px 12px;display:block;overflow:auto;background:var(--ui-panel);box-shadow:0 -8px 20px #080d0870}
 .place-context .context-title{padding:0 0 4px;border:0}.place-context .context-title .eyebrow{display:none}.place-context .context-title h2{font:20px Georgia;margin:0}.place-context .context-close{width:44px;height:44px}.place-context .context-description{margin:4px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.place-context>details>summary{min-height:44px}.place-context>button.primary,.place-context .context-primary>button{width:100%;min-height:44px}
 .mobile-shell .dialog-dock:has(#modal[open]){display:block;position:absolute;inset:auto 0 0;max-height:100%;height:var(--mobile-sheet);border:0;border-top:2px solid var(--ui-border);box-shadow:0 -10px 24px #080d0880}.mobile-shell .dialog-dock:has(#modal:is([data-mobile=full],[data-mobile=special])[open]){inset:0;height:100%;border-top:0}
 .mobile-shell #modal[open]{display:block;position:relative;inset:auto;margin:0;width:100%;max-width:none;min-width:0;height:100%;max-height:100%;overflow:auto;border:0;padding:0;box-shadow:none;overscroll-behavior:contain}
 .mobile-shell #modal .window-titlebar{position:sticky;top:0;z-index:var(--ui-context);background:var(--ui-panel);padding:8px 12px;border-bottom:1px solid #786645}.mobile-shell #modal .window-titlebar h2{font:20px Georgia}.mobile-shell #modal .window-kind{display:none}.mobile-shell #modal .close{min-width:44px;min-height:44px}
 .mobile-shell #modal .window-content{overflow:visible;padding:12px;font:15px/1.5 Georgia;max-height:none}.mobile-shell #modal .modal-actions{overflow:visible;display:flex;flex-direction:column;max-height:none;padding:0 12px 12px;gap:4px;border:0}.mobile-shell #modal .modal-actions button{min-height:44px;font:15px Georgia;width:100%;padding:9px;text-align:left}
 .mobile-shell #modal .owner-dialog{grid-template-columns:64px minmax(0,1fr);gap:10px}.mobile-shell #modal .owner-dialog img{max-width:64px;max-height:96px}.mobile-shell #modal blockquote{font-size:15px}
 .mobile-shell .scene-controls{max-height:none;min-height:60px;padding:4px 8px;overflow:visible;display:block;border-top:1px solid #786645;box-shadow:none}.mobile-shell .scene-controls>button,.mobile-shell .scene-controls>.scene-footnote{display:none}
 .mobile-shell .adventure-actions{display:flex;flex-wrap:nowrap;gap:4px}.mobile-shell .adventure-actions>button{min-height:52px;flex:1 1 0;min-width:0;font:12px Georgia;padding:4px}.mobile-shell .adventure-actions>button:nth-child(n+4):not([data-do=visual-context-more]){display:none}.mobile-shell .adventure-actions>button .standard-icon{display:none}
 .mobile-shell .inventory-workbench,.mobile-shell .dossier,.mobile-shell .classic-folio{border:0;padding:0;background:transparent}.mobile-shell .dossier-people:has(button:only-child){display:none}.mobile-shell .dossier-identity{grid-template-columns:76px minmax(0,1fr);gap:12px;padding:0 0 12px}.mobile-shell .dossier-identity h1{font:21px Georgia}.mobile-shell .dossier-identity .eyebrow{display:none}.mobile-shell .dossier-identity p{margin:4px 0}.mobile-shell .dossier-identity aside{min-height:100px}
 .mobile-shell .dossier-tabs,.mobile-shell .folio-tabs,.mobile-shell .inventory-people,.mobile-shell .dossier-people{display:flex;overflow-x:auto;flex-wrap:nowrap;gap:0;min-height:44px;padding:0 0 8px}.mobile-shell .dossier-tabs button,.mobile-shell .folio-tabs button{white-space:nowrap;flex:1 0 auto;min-height:44px;padding:6px 10px;font-size:13px}
 .mobile-shell .dossier h2{font-size:19px}.mobile-shell .dossier .panel{padding:12px 0}.mobile-shell .inventory-columns{display:block}.mobile-shell .inventory-columns>section{display:none}.mobile-shell .inventory-workbench[data-section=person] .inventory-person,.mobile-shell .inventory-workbench[data-section=equipment] .inventory-equipment,.mobile-shell .inventory-workbench[data-section=items] .inventory-items{display:block;border:0;padding:10px 0}.mobile-shell .inventory-sections{display:flex}.mobile-shell .inventory-sections button{flex:1;min-height:44px}.mobile-shell .inventory-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.mobile-shell .inventory-slot{padding:6px;min-width:0}
 .mobile-shell .world-notices{max-height:110px;overflow:auto;flex:none}.mobile-shell[data-category=menu] .world-notices{display:none}.mobile-shell .archive-link{min-height:52px;background:transparent;border:0;border-bottom:1px solid #665b40;padding:10px 4px}.mobile-shell .archive-link small{display:none}
 .mobile-shell .combat-grid{grid-template-columns:1fr}.mobile-shell .combat-controls{position:sticky;bottom:0;background:var(--ui-panel);padding:6px;z-index:var(--ui-context)}
}
@media(max-width:380px){.mobile-shell .hud-token strong{font-size:15px}.screen-context [data-world-phase]{font-size:11px}.trade-item-list{grid-template-columns:1fr}.mobile-shell .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-height:520px) and (orientation:landscape){.mobile-shell{grid-template-rows:44px 32px 0 minmax(0,1fr) calc(44px + var(--safe-bottom))}.mobile-shell .bottom-nav button{min-height:44px}.mobile-shell .bottom-nav .action-label{flex-direction:row}.mobile-shell .context-tool{min-height:32px}.mobile-shell .dialog-dock:has(#modal[open]){inset:0 0 0 auto;width:52%;height:100%;border-top:0;border-left:2px solid var(--ui-border)}.mobile-shell .dialog-dock:has(#modal:is([data-mobile=full],[data-mobile=special])[open]){width:100%}.mobile-shell .place-context{inset:0 0 0 auto;width:45%;max-height:100%;border-top:0;border-left:1px solid var(--ui-border)}.mobile-shell .scene-controls{min-height:44px}.mobile-shell .adventure-actions>button{min-height:44px}}
@media(prefers-reduced-motion:reduce){.mobile-shell *{scroll-behavior:auto!important;transition:none!important}}
/* One scene scroll surface; gestures change the same scale as the map tools. */
.mobile-shell .scene-viewport{touch-action:none}.mobile-shell .district-view .scene-canvas{overflow:visible}
.tool-options{display:grid;gap:6px;padding:8px 0}.tool-options button{min-height:44px;text-align:left}
#modal details>summary{padding:10px 0;min-height:44px;cursor:pointer}.trade-options>button{display:block;width:100%;margin:6px 0}
.mobile-shell .combat-control-title{display:none}.combat-more>summary,.combat-record>summary,.combat-roster>summary{min-height:44px;padding:12px 4px;cursor:pointer}
@media(max-width:1000px){
 .mobile-shell .inventory-entry{padding:6px;border:0;border-bottom:1px solid #776548}.mobile-shell .inventory-entry small{display:none}.mobile-shell .inventory-entry .inventory-art{height:64px}.mobile-shell .inventory-tray{padding:0;border:0;box-shadow:none;background:transparent}
 .mobile-shell .quest-pages{display:block;padding:12px 0}.mobile-shell .world-notices{position:static;max-height:none;overflow:visible}.mobile-shell .world-notices .notice{font-size:12px}
 .mobile-shell .combat-layout{display:flex;flex-direction:column;gap:6px;flex:1;min-height:0}.mobile-shell .combat-layout>aside{display:contents}.mobile-shell .combat-field{min-height:0;flex:1;overflow:auto}.mobile-shell .combat-controls{flex:none;position:relative;order:3;padding:4px 8px;border-top:1px solid #786645;display:grid;grid-template-columns:1fr 1fr;gap:4px}.mobile-shell .combat-quick-actions{margin:0;gap:4px}.mobile-shell .combat-controls>.field{grid-row:1;grid-column:1 / -1;display:flex;align-items:center;gap:8px;margin:0}.mobile-shell .combat-controls>.field label{margin:0;font-size:13px}.mobile-shell .combat-controls>.field select{flex:1;padding:4px}.mobile-shell .combat-more{grid-column:1 / -1}.mobile-shell .combat-more:not([open]){grid-row:2;grid-column:2}.mobile-shell .combat-controls>.primary{grid-column:1 / -1;min-height:44px}.mobile-shell .combat-target{margin:0;font-size:12px;grid-column:1 / -1}.mobile-shell .combat-roster{order:2;padding:0;margin:0;flex:none}.mobile-shell .combat-layout .combat-stage{margin:0}.mobile-shell [data-screen=combat]>.page-title{display:none}
 .mobile-shell .combat-more[open]{max-height:200px;overflow:auto}.mobile-shell .combat-controls button{font-size:13px;padding:6px}
}
@media(max-height:520px) and (orientation:landscape){.mobile-shell .combat-layout{display:grid;grid-template-columns:minmax(0,1fr) 240px}.mobile-shell .combat-layout>aside{display:block;overflow:auto}.mobile-shell .combat-controls{display:block}.mobile-shell .combat-controls>*{margin:4px 0}}
.mobile-shell .menu-group{border-bottom:1px solid #786645;padding:8px 0}.mobile-shell .menu-group>summary{min-height:52px;padding:16px 4px;font:18px Georgia;cursor:pointer}.mobile-shell .menu-group h2{font:19px Georgia}
.mobile-shell .hud-token strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;display:block}
@media(max-width:1000px){.mobile-shell{grid-template-rows:calc(48px + var(--safe-top)) 44px 0 minmax(0,1fr) calc(60px + var(--safe-bottom))}.context-tool{min-height:44px}.mobile-shell .combat-field{display:flex;flex-direction:column}.mobile-shell .combat-stage{flex:1;min-height:250px;max-height:450px}.mobile-shell .combat-stage .combat-board{position:absolute;inset:0;grid-template-rows:repeat(5,minmax(44px,1fr));aspect-ratio:auto}.mobile-shell .combat-stage .cell{aspect-ratio:auto;overflow:hidden}.mobile-shell .combat-record{flex:none}.mobile-shell .weapon-card{padding:8px;border:0;border-bottom:1px solid #786645}.mobile-shell .weapon-card>img{height:96px;object-fit:contain}.mobile-shell #modal .cards:has(.weapon-card){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.mobile-shell .weapon-card h3{font-size:17px}.mobile-shell .weapon-card p{font:13px/1.4 Georgia}}
@media(max-height:520px) and (orientation:landscape){.mobile-shell{grid-template-rows:44px 44px 0 minmax(0,1fr) calc(44px + var(--safe-bottom))}.mobile-shell .combat-stage{min-height:230px}.mobile-shell .combat-stage .combat-board{position:relative;min-height:220px}.context-tool{min-height:44px}}
:root{--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
.mobile-shell{padding-left:var(--safe-left);padding-right:var(--safe-right)}
@media(prefers-reduced-motion:no-preference){.mobile-shell .place-context{animation:mobile-sheet-in .12s ease-out}}@keyframes mobile-sheet-in{from{transform:translateY(12px);opacity:.5}to{transform:translateY(0);opacity:1}}
.mobile-shell .combat-stage .objective-marker{font-size:16px}.mobile-shell .combat-stage .unit-photo{object-fit:contain}
/* The game owns its scrolling; hidden scene/sprite bounds must not extend the page. */
html:has(.mobile-shell),body:has(.mobile-shell){height:100%;overflow:hidden}
/* Inventory art is deliberately uncropped on all viewport sizes. */
.vehicle-gallery{width:100%;max-width:680px;margin:auto;min-width:0;text-align:center;overflow:visible}
.vehicle-gallery nav{display:flex;align-items:center;justify-content:space-between;gap:12px}
.vehicle-gallery nav button{min-width:48px;min-height:44px}
.vehicle-full-art{width:100%;height:clamp(140px,28vh,300px);display:flex;align-items:center;justify-content:center;background:#11120f;border:1px solid #655037}
.vehicle-full-art img,.vehicle-full-art picture{width:100%!important;height:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;image-rendering:pixelated}
.vehicle-specs{line-height:1.4;margin:8px 0}
.vehicle-primary{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}
.vehicle-gallery details{text-align:left;margin:8px 0}
.vehicle-gallery details button{width:100%;min-height:44px;margin-block:4px}
@media(max-width:600px){.vehicle-gallery{max-width:100%}.vehicle-gallery h3{margin:6px 0}.vehicle-full-art{height:clamp(135px,24vh,230px)}.vehicle-gallery .hint{font-size:12px}}
.place-context:has(.context-info-button),.mobile-shell .place-context:has(.context-info-button){overflow:visible}
.place-context:has(.context-info-button) .context-primary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.place-context:has(.context-info-button) .context-primary>button{min-width:0;min-height:44px;width:100%;padding:6px;font-size:14px}
@media(max-height:520px) and (orientation:landscape){
 .mobile-shell .place-context:has(.context-info-button){padding:8px 12px}
 .place-context:has(.context-info-button) .context-description{display:none}
 .place-context:has(.context-info-button) .context-cost{margin:4px 0;font-size:13px}
 .place-context:has(.context-info-button) .context-primary{margin:6px 0}
 .place-context:has(.context-info-button) .context-title h2{font-size:18px}
}
