A bottom bar fixed to the screen ends up under the home indicator on phones without a home button. CSS can ask the browser how much room that indicator takes.
<meta name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover">
.bottom-bar {
position: fixed;
inset: auto 0 0 0;
padding: 1rem;
padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
env() reads values that the browser provides. The four safe-area-inset-* values describe how far content must stay from each edge to avoid rounded corners, a notch or the home bar. With max() the bar gets at least 1rem of padding, and more when the device needs it.
The viewport tag matters. Only with viewport-fit=cover does the page extend into the unsafe areas, and only then are the insets more than zero. Without it, the browser keeps the page inside the safe area on its own and leaves the edges empty.
env() also takes a fallback, like env(safe-area-inset-bottom, 1rem), which is used when the variable does not exist at all. Support goes back years: Chrome 69, Firefox 65 and Safari 11.1. I’d test this in a phone simulator or on a real phone, since desktop browsers return zero.
Further reading: MDN: env()