/* One fullscreen contract for static, generated and native public dialogs.
   Touch devices stay fullscreen in landscape; desktop dialog sizes are unchanged. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .modal,
  .cookie-preferences {
    position: fixed;
    inset: var(--modal-viewport-top, 0px) 0 auto;
    width: 100%;
    max-width: none;
    height: 100%;
    height: var(--modal-viewport-height, 100dvh);
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
    overscroll-behavior: contain;
  }

  .modal {
    align-items: stretch;
    overflow: hidden;
  }

  .modal > .modal-content {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
  }

  .modal > .modal-content,
  .cookie-preferences {
    padding: calc(72px + env(safe-area-inset-top, 0px))
      max(24px, env(safe-area-inset-right, 0px))
      max(24px, env(safe-area-inset-bottom, 0px))
      max(24px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-close--floating {
    top: max(16px, env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
  }

  .contact-modal-main,
  .contact-modal-success,
  .subpage-modal-main,
  .contact-form {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .image-viewer__image {
    max-width: 100%;
    max-height: calc(var(--modal-viewport-height, 100dvh) - 160px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
