Saltmarsh resilience controlled by patch size and plant density of habitat-forming species that trap shells.