/* Keep Capture Memory fully visible on iPad portrait and landscape. */
@media (min-width: 761px) and (max-width: 1366px) {
  html body main.app-shell .memory-editor,
  html body main.app-shell .memory-editor.open,
  html body .app-shell .memory-editor,
  html body .app-shell .memory-editor.open {
    position: fixed !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: calc(96px + env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    box-sizing: border-box !important;
    width: min(680px, calc(100vw - 48px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 48px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
    height: auto !important;
    max-height: calc(100dvh - 114px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-50%) !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  html body.keyboard-open main.app-shell .memory-editor.open,
  html body.keyboard-open .app-shell .memory-editor.open {
    top: max(8px, env(safe-area-inset-top)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    max-height: calc(var(--mymappi-visible-height, 100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body main.app-shell .memory-editor.open,
  html body .app-shell .memory-editor.open {
    transition: none !important;
  }
}
