/* Keep dialog controls outside the only scrolling content region. */
#modal{padding:0;overflow:hidden;max-height:85vh;max-height:min(85dvh,calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overscroll-behavior:contain}
#modal[open]{display:flex;flex-direction:column}
.modal-toolbar{flex:0 0 auto;display:flex;justify-content:flex-end;align-items:center;min-height:57px;padding:6px 12px;background:var(--paper);border-bottom:1px solid #d8cfdf}
#modal .modal-toolbar>.close{position:static;inset:auto;flex-shrink:0;width:44px;height:44px;min-width:44px;min-height:44px;line-height:1;font-size:27px;margin:0}
#modal-body{min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;padding:20px 30px 28px;scrollbar-gutter:stable;scroll-padding:14px;overflow-wrap:break-word;-webkit-overflow-scrolling:touch}
#modal-body .level-picker,#modal-body .record-list,#modal-body .sim-history{max-height:none;overflow:visible}
@media(max-width:600px){#modal-body{padding:15px 20px 24px}.modal-toolbar{padding-left:10px;padding-right:10px}#modal h2{margin-top:5px;margin-right:0}}
