/* One central mode on every display: room and dialog are never parallel surfaces. */
.mobile-shell .game-workspace:has(#modal[open]){display:block;position:relative}
.mobile-shell .game-workspace:has(#modal[open])>#main{visibility:hidden}
.mobile-shell .dialog-dock:has(#modal[open]),.mobile-shell .dialog-dock:has(#modal:is([data-mobile=full],[data-mobile=special])[open]){position:absolute;inset:0;width:100%;height:100%;max-height:100%;border:0;box-shadow:none;background:var(--ui-panel);display:block;z-index:30}
.mobile-shell #modal[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:100%;max-width:none;min-width:0;height:100%;max-height:none;margin:0;padding:0;position:relative;inset:auto;overflow:hidden;border:0;box-shadow:none;background:#20251f}
.mobile-shell #modal .window-titlebar{position:static;padding:5px 14px;min-height:44px;background:#262b23}
.mobile-shell #modal .window-titlebar h2{font:19px Georgia;line-height:1.15;margin:0}.mobile-shell #modal .window-kind{display:none}
.mobile-shell #modal .window-content{min-height:0;max-height:none;overflow:auto;padding:10px 16px;width:100%;max-width:800px;justify-self:center;font:15px/1.4 Georgia}
.mobile-shell #modal .modal-actions{display:flex;flex-direction:column;gap:5px;overflow:visible;padding:8px 16px;max-height:none;width:100%;max-width:720px;justify-self:center;background:#262b23;border-top:1px solid #736446}
.mobile-shell #modal .modal-actions button{min-height:44px;padding:8px 12px;font:15px Georgia;text-align:left;width:100%;margin:0}
.mobile-shell #modal button[hidden],.mobile-shell #modal [hidden]{display:none!important}
.dialog-pages{display:flex;gap:8px;align-items:center}.dialog-pages span{font-size:12px;white-space:nowrap}.mobile-shell #modal .dialog-pages button{font-size:13px;text-align:center}
.mobile-shell #modal .owner-dialog{display:flex;flex-direction:column;align-items:center;gap:8px;max-width:600px;margin:0 auto}
.mobile-shell #modal .owner-dialog .dialogue-portrait,.mobile-shell #modal .owner-dialog img{width:96px;height:104px;max-width:96px;max-height:104px;object-fit:contain;image-rendering:pixelated}
.mobile-shell #modal blockquote{font:17px/1.4 Georgia;margin:4px 0 10px}.mobile-shell #modal p{margin:6px 0 10px}
.mobile-shell #modal :is(.story-scene,.encounter-scene){height:clamp(80px,20dvh,180px);max-height:180px;object-fit:contain;width:100%}
.mobile-shell #modal .street-conversation{display:grid;grid-template-columns:clamp(48px,14vw,88px) minmax(0,1fr);align-items:start;gap:12px}.mobile-shell #modal .street-conversation .street-person-art{max-height:120px}
.mobile-shell #modal .modal-actions .standard-icon{width:24px;height:24px}
.spatial-rail{flex:none;height:46px;border-bottom:1px solid #756044;background:#21271f;display:flex;align-items:center;padding-left:8px}
.spatial-rail button{display:flex;align-items:center;gap:10px;min-width:48px;min-height:44px;border:0;background:transparent;font:13px Georgia}.spatial-rail .standard-icon{width:28px;height:28px}
.debt-contact{position:absolute;z-index:4;image-rendering:pixelated;object-fit:contain;pointer-events:none;filter:drop-shadow(2px 3px 0 #10140c80)}
.venue-closed{position:absolute;bottom:6%;left:10%;right:10%;padding:12px;background:#211a13ed;color:#f4d9a3;border:2px solid #8a7350;text-align:center}
@media(max-height:540px) and (orientation:landscape){
 .mobile-shell:has(#modal[open]){grid-template-rows:0 0 0 minmax(0,1fr) 0}
 .mobile-shell:has(#modal[open])>:is(.compact-hud,.context-strip,.bottom-nav){visibility:hidden;overflow:hidden;min-height:0;padding:0}
 .mobile-shell .dialog-dock:has(#modal[open]){position:absolute;inset:0;height:100%;max-height:100%;z-index:100}
 .mobile-shell #modal .window-titlebar{padding-top:calc(5px + var(--safe-top))}
 .mobile-shell #modal .modal-actions{padding-bottom:calc(8px + var(--safe-bottom))}
 .mobile-shell #modal .owner-dialog{flex-direction:row}.mobile-shell #modal .owner-dialog .dialogue-portrait{height:70px;width:64px}
 .mobile-shell #modal .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px}.dialog-pages{grid-column:1 / -1}
 .mobile-shell #modal :is(.story-scene,.encounter-scene){height:64px}.mobile-shell #modal .window-content{padding:6px 16px}
}
@media(min-width:1001px){.mobile-shell #modal .window-content{padding-top:24px}.mobile-shell #modal .owner-dialog .dialogue-portrait{width:144px;height:164px;max-width:144px;max-height:164px}}
