Answer
How do you handle safe areas in a PWA?
To avoid content being obscured by notches, camera cutouts or the home indicator on modern phones, set <meta name="viewport" content="viewport-fit=cover"> and then apply padding using the CSS environment variables env(safe-area-inset-top), -right, -bottom and -left, which report the exact inset needed on the current device in standalone or fullscreen mode.
The viewport-fit meta tag
Without viewport-fit=cover, Safari letterboxes the page around notches instead of letting content extend under them, so the safe-area variables would be unnecessary but your app also cannot use the full screen.
Applying the insets
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); on a fixed header/footer keeps content clear of hardware cutouts.
Fallback values
env() accepts a second fallback argument, e.g. env(safe-area-inset-bottom, 0px), for browsers or devices that report no inset.