Mass-loss rate and local thermodynamic state of the KELT-9 b thermosphere from the hydrogen Balmer series