Enhanced spin squeezing and quantum entanglement near the critical point of the Jaynes–Cummings–Dicke model