Diets high in sodium and low in potassium were associated with poorer mental health, even when accounting for factors like family wealth and BMI.