Fix margins jumping when toggling cards

Close #1412