/* A dedicated sticky exit row stays inside the activity's scroll viewport. */
#modal{overflow:auto;overscroll-behavior:contain;scroll-padding-top:72px;max-height:90vh;max-height:90svh}
#modal .activity-dialog-controls{position:sticky;top:0;z-index:100;display:flex;justify-content:flex-end;align-items:center;min-height:64px;padding:8px 14px;background:#fff;border-bottom:1px solid #e3e9f1;box-sizing:border-box;isolation:isolate}
#modal #closeModal{position:static;display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;padding:0;line-height:1;border:1px solid #d0dceb;background:#edf2f9;color:#18335b;touch-action:manipulation;cursor:pointer}
#modal #closeModal:hover{background:#dce8f7}
#modal #closeModal:focus-visible{outline:3px solid #367de3;outline-offset:2px}
#modal .modal-inner{padding-top:20px}
html:has(#modal[open]),body:has(#modal[open]){overflow:hidden}
body.standalone-game #modal{max-height:calc(100svh - 24px)}
@media(max-width:650px){
 #modal,body.standalone-game #modal{width:calc(100% - 16px);max-height:calc(100vh - 32px);max-height:calc(100svh - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)));margin:auto;border-radius:20px}
 #modal .activity-dialog-controls{padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right))}
 #modal .modal-inner{padding-top:16px}
}
