Confinement and ballooning stability at the beta limit