Why does my chart overflow on phones?
The chart has a fixed width of 640px, wider than the card on a phone. Size it from its container instead:
css
.card { container-type: inline-size; }.chart { width: 100cqi; }Now it fills the card at every size.
Does that work in every browser?
Yes. Container queries have worked in every major browser since 2023, so you can use them without a fallback.