Flexbox lays out items along one main axis. justify-content distributes spare space on that axis; align-items controls the cross axis. Those jobs switch directions when you change the flex direction, so identify the axis before changing a property. You'll distribute toolbar actions, space tags, wrap fixed-size cards, and let a search field grow beside a stable button. Intrinsic sizes can still cause overflow. A flexible input often needs min-width zero so it can shrink within its row. Check the measured boxes and the narrow case. A row that looks correct only because the current labels happen to be short is unfinished.