/* One vertical scrolling surface per dialog; wide tables only need sideways scrolling. */
html.dialog-open{overflow:hidden;scrollbar-gutter:auto}
dialog{box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:18px}
#modal.fleet-viewer,#modal.fleet-editor{max-height:calc(100dvh - 24px);overflow:auto}
#modal #fleetTable,#modal #fleetEdit{height:auto;max-height:none;overflow-x:auto;overflow-y:auto;overscroll-behavior-x:contain;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
#modal .admin-table,#libraryDialog .library-entry-list{overscroll-behavior-y:auto}
#libraryDialog .library-entry-list{max-height:none;overflow:visible}
.fleet-choice .choice-panel{overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
#modal>.close,#libraryDialog>.close{position:sticky;top:0;z-index:8;float:right;min-width:44px;min-height:44px;background:var(--site-surface);color:var(--site-fg);border:1px solid var(--site-line)}
.editor-shell #sectionDialog .time-editor{max-height:none;overscroll-behavior-y:auto}
.editor-shell.public-view .canvas{height:auto;max-height:none;overflow-x:auto;overflow-y:auto;overscroll-behavior-y:auto}
@media(max-width:900px){
 .editor-shell .sidebar,.editor-shell .sidebar .panel,.editor-shell .sidebar .templates{max-height:none;overflow:visible}
 .editor-shell .canvas{overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:700px){
 dialog,#modal.fleet-modal,.ops-dialog,.editor-shell #sectionDialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);margin:auto;border-radius:10px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .ops-dialog{padding:0}.ops-dialog-body{padding-bottom:max(20px,env(safe-area-inset-bottom))}
 #modal .filters{gap:12px}.fleet-scroll-hint{line-height:1.6}
 dialog input,dialog select,dialog textarea{font-size:16px!important}
}
@media print{html.dialog-open{overflow:visible}body{position:static!important;top:auto!important;left:auto!important;width:auto!important;overflow:visible!important}dialog.printing-target{max-height:none;overflow:visible}}
