gap is the property that finally removes margin arithmetic from layout, and this year it applies to grid containers only — a flex container ignores it entirely.
/* works */
.cards { display: grid; gap: 1rem; }
/* silently ignored in every current browser */
.toolbar { display: flex; gap: 1rem; }
/* so flex still needs this */
.toolbar > * + * { margin-left: 1rem; }
The * + * selector is the least bad workaround because it applies to every element except the first, so there is no trailing margin to strip. Flexbox gap does arrive eventually and is worth checking for rather than assuming — until then, a flex layout using gap looks correct in the stylesheet and renders with no spacing at all.