/* Shared popup shell. Widths, form grids, visibility and actions remain per dialog. */
html body [data-xr-modal]:not(#xr-modal-legacy) {
  --xm-panel:#fff;--xm-bar:#dceaf3;--xm-field:#fbfdfe;--xm-ink:#1e3a50;--xm-muted:#496373;--xm-line:#cedde4;
  padding:0!important;box-sizing:border-box!important;max-width:calc(100vw - 28px)!important;max-height:calc(100dvh - 32px)!important;
  border:1px solid var(--xm-line)!important;border-radius:12px!important;
  background:var(--xm-panel)!important;color:var(--xm-ink)!important;
  box-shadow:0 20px 60px #14202c33!important;font:400 11px/1.45 Inter,system-ui,sans-serif!important;
  overflow:auto!important;
}
html[data-theme="dark"] body [data-xr-modal]:not(#xr-modal-legacy) {
  --xm-panel:#3c4147;--xm-bar:#525e69;--xm-field:#4a5159;--xm-ink:#f5f6f7;--xm-muted:#d9dfe4;--xm-line:#76818a;
}
html body [data-xr-modal]:not(#xr-modal-legacy)::backdrop {background:#14202c80}
html body [data-xr-modal]:not(#xr-modal-legacy) .xr-modal-head {
  box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:12px!important;min-height:44px!important;padding:8px 14px!important;margin:0!important;
  border:0!important;border-bottom:1px solid var(--xm-line)!important;border-radius:11px 11px 0 0!important;
  background:var(--xm-bar)!important;color:var(--xm-ink)!important;flex-shrink:0!important;
}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(h2.xr-modal-head,.xr-modal-head h2,.xr-modal-head b) {
  font:600 14px/1.4 Inter,system-ui,sans-serif!important;color:var(--xm-ink)!important;margin:0!important;
}
html body [data-xr-modal]:not(#xr-modal-legacy) .xr-modal-head :is(p,small) {font-size:11px!important;color:var(--xm-muted)!important;margin:3px 0 0!important}
html body [data-xr-modal]:not(#xr-modal-legacy) .xr-modal-head > div {min-width:0;overflow-wrap:anywhere}
html body [data-xr-modal]:not(#xr-modal-legacy) .xr-modal-foot {
  gap:8px!important;padding:10px 14px!important;border-top:1px solid var(--xm-line)!important;
  background:var(--xm-panel)!important;color:var(--xm-muted)!important;flex-wrap:wrap!important;
}
html body [data-xr-modal]:not(#xr-modal-legacy) label {font-size:11px!important;color:var(--xm-ink)!important}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea) {
  box-sizing:border-box!important;min-width:0;max-width:100%;border-radius:6px!important;
  background-color:var(--xm-field)!important;color:var(--xm-ink)!important;border-color:var(--xm-line)!important;font:500 11px/1.4 Inter,system-ui,sans-serif!important;
}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),select:not([multiple])) {min-height:34px!important}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(.xr-modal-foot button,.xr-qc-action-buttons button) {
  min-height:32px!important;padding:6px 12px!important;border-radius:17px!important;
  border:1px solid var(--xm-line)!important;background:var(--xm-bar)!important;color:var(--xm-ink)!important;
  box-shadow:none!important;font:600 11px/1.4 Inter,system-ui,sans-serif!important;
}
html body [data-xr-modal]:not(#xr-modal-legacy) button.xr-modal-close {
  display:grid!important;place-items:center!important;flex:0 0 28px!important;
  width:28px!important;min-width:28px!important;max-width:28px!important;height:28px!important;min-height:28px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:6px!important;
  background:transparent!important;color:#3178b9!important;box-shadow:none!important;font:700 16px/1 Arial,sans-serif!important;cursor:pointer;
}
html body [data-xr-modal]:not(#xr-modal-legacy) button.xr-modal-close:hover {background:var(--xm-field)!important}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(button,input,select,textarea):focus-visible {outline:2px solid #3178b9!important;outline-offset:2px!important}
html body [data-xr-modal]:not(#xr-modal-legacy) button:disabled {opacity:.5!important;cursor:wait!important}
/* Portbase originally had an inset, unframed title. Give it the same full-width bar. */
html body :is(.xr-pb-dialog,.xr-route-pn-dialog,.xr-pb-detail-card)[data-xr-modal] {padding:0!important}
html body :is(.xr-pb-dialog,.xr-route-pn-dialog,.xr-pb-detail-card)[data-xr-modal] .xr-modal-head {padding-right:52px!important}
html body :is(.xr-pb-dialog,.xr-route-pn-dialog,.xr-pb-detail-card)[data-xr-modal] > .xr-modal-close {position:absolute!important;top:8px!important;right:12px!important;z-index:3}
html body :is(.xr-pb-dialog,.xr-route-pn-dialog)[data-xr-modal] > :is(form,p) {padding:12px 14px!important;margin:0!important}
html body .xr-pb-detail-card[data-xr-modal] > :is(.xr-pb-detail-states,.xr-pb-detail-grid) {margin:14px!important}
html body .xr-pb-detail-card[data-xr-modal] .xr-pb-detail-head > i {display:none!important}
html body .xr-pb-detail-card[data-xr-modal] :is(.xr-pb-detail-states>div,.xr-pb-detail-grid>div) {background:var(--xm-field)!important;border-color:var(--xm-line)!important}
@media(pointer:coarse) {html body [data-xr-modal]:not(#xr-modal-legacy) .xr-modal-foot button {min-height:44px!important}}

@media(pointer:coarse) {html body [data-xr-modal]:not(#xr-modal-legacy) :is(input,select,textarea) {font-size:16px!important}}
html body :is(.xr-qc-backdrop,.xr-location-modal,.xr-assign-modal,.xr-charter-modal,.xr-pb-modal,.xr-route-pn-modal,.xr-pb-detail-modal,.xr-hcn-route-modal) {background:#14202c80!important;backdrop-filter:blur(3px)}
html body [data-xr-modal]:not(#xr-modal-legacy) :is(.xw-body,.xr-surcharge-options,.xr-doc-modal-body) {padding:14px!important}


/* Column chooser shares the popup shell; checkbox labels stay on one row. */
html body #xrColumnPicker[data-xr-modal] .xr-column-picker-grid{padding:12px 14px!important;margin:0!important;gap:4px 10px!important;max-height:min(330px,calc(100dvh - 230px))!important;overflow:auto!important;scrollbar-width:thin;scrollbar-color:var(--xm-line) var(--xm-panel)}
html body #xrColumnPicker[data-xr-modal] .xr-column-picker-grid label{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;padding:7px 3px!important;margin:0!important;min-width:0!important;cursor:pointer;line-height:1.4!important;color:var(--xm-ink)!important;border-radius:4px}
html body #xrColumnPicker[data-xr-modal] .xr-column-picker-grid label:hover{background:var(--xm-bar)!important}
html body #xrColumnPicker[data-xr-modal] input[type=checkbox]{appearance:auto!important;display:inline-block!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;max-width:14px!important;flex:0 0 14px!important;margin:0!important;padding:0!important;accent-color:#3178b9!important}
html body #xrColumnPicker[data-xr-modal] .xr-modal-foot{margin:0!important}
@media(pointer:coarse){html body #xrColumnPicker[data-xr-modal] .xr-column-picker-grid label{min-height:44px!important;box-sizing:border-box}}
