/* Native dialogs own their scrolling. Keep the document behind them still. */
html:has(dialog:modal) { overflow:hidden; }
dialog[open] { overscroll-behavior:contain; }
html[data-keyboard-open] dialog[open] {
  inset-block-start:var(--keyboard-top) !important;
  inset-block-end:var(--keyboard-bottom) !important;
  max-height:calc(var(--keyboard-height) - 12px) !important;
  overflow:auto !important;
  scroll-padding-block:12px;
}
html[data-keyboard-open] :is(.pe-save,.pe-bottom,.cds-save,.sr-footer,.gym-foot,.gym-log) {
  position:static;
  width:100%;
  transform:none;
  padding-bottom:12px;
}
html[data-keyboard-open] #nav.member-tabs { visibility:hidden; }
html[data-keyboard-open]:not(:has(dialog:modal)) body::after {
  content:'';
  display:block;
  height:var(--keyboard-space, var(--keyboard-bottom));
}
html[data-keyboard-open] dialog textarea { max-height:max(100px, calc(var(--keyboard-height) - 64px)); }

@media (max-width:480px) {
  .pe-row > span:last-child, .pe-head > div, .pe-sheet-top > div { min-width:0; overflow-wrap:anywhere; }
  .pe-sheet-top { flex-wrap:wrap; }
  .pe-save { gap:8px; }
}
