/* Every modal owns its vertical scroll, including short landscape viewports.
   Old height-capped inner panels otherwise hide content and action buttons. */
:root:root dialog.dialog {
  --dialog-edge: clamp(8px, 2.5vmin, 16px);
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: fit-content !important;
  max-width: calc(100vw - var(--dialog-edge) - var(--dialog-edge)) !important;
  max-height: calc(100vh - var(--dialog-edge) - var(--dialog-edge)) !important;
  max-height: calc(100dvh - var(--dialog-edge) - var(--dialog-edge)) !important;
  overflow: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 16px;
}
:root:root dialog.dialog > form,
:root:root dialog.dialog .workshop-review,
:root:root dialog.dialog .dialog-body,
:root:root dialog.dialog .loyalty-dialog-body,
:root:root dialog.dialog .detail-grid,
:root:root dialog.dialog .dialog-scroll {
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
:root:root dialog.dialog .dialog-head,
:root:root dialog.dialog .dialog-actions {
  flex-shrink: 0;
  min-width: 0;
  flex-wrap: wrap;
}
:root:root dialog.dialog .dialog-actions {
  position: static !important;
}
:root:root dialog.dialog .dialog-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
:root:root dialog.dialog .dialog-close {
  flex-shrink: 0;
}
:root:root dialog.dialog .table-scroll {
  max-height: none !important;
  overflow-x: auto;
}
@media (max-width: 600px), (max-height: 500px) {
  :root:root dialog.dialog .dialog-actions {
    gap: 8px;
  }
  :root:root dialog.dialog .dialog-actions > button {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
