Egalitarianism under population change: age structure does matter