/* Build 743: let iPad use its canvas without losing the calm, centered layout. */
@media (min-width: 721px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  html body .app-shell #memoryForm,
  html body main.app-shell #memoryForm#memoryForm,
  html body .app-shell #memoryForm.open,
  html body main.app-shell #memoryForm#memoryForm.open {
    --memory-form-content: 720px;
    --memory-form-focus: 480px;
    width: min(860px, calc(100vw - 40px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
    max-width: calc(100vw - 40px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
  }

  /* Two memories belong together in the iPad chapter view. Present them as a
     centered pair instead of leaving the second card clipped at the edge. */
  html body .app-shell .life-chapter-viewer-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    margin-right: 0 !important;
    padding: 2px 0 8px !important;
    gap: 14px !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  html body .app-shell .life-chapter-viewer-media {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    scroll-snap-align: none !important;
  }

  html body .app-shell .life-chapter-viewer-media-art,
  html body .app-shell .life-chapter-viewer-media-art > img {
    object-position: center center !important;
  }

  html body .app-shell .life-chapter-viewer-gallery-controls {
    display: none !important;
  }
}
