Context. The radiative losses in the solar chromosphere vary from 4 kW m −2 in the quiet Sun, to 20 kW m −2 in active regions. The mechanisms that transport non-thermal energy to and deposit it in the chromosphere are still not understood. Aims. We aim to investigate the atmospheric structure and heating of the solar chromosphere in an emerging flux region. Methods. We use observations taken with the CHROMIS and CRISP instruments on the Swedish 1-m Solar Telescope in the Ca ii K, Ca ii 854.2 nm, Hα, and Fe i 630.1 nm and 630.2 nm lines. We analyse the various line profiles and in addition perform multi-line, multi-species, non-Local Thermodynamic Equilibrium (non-LTE) inversions to estimate the spatial and temporal variation of the chromospheric structure. Results. We investigate which spectral features of Ca ii K contribute to the frequency-integrated Ca ii K brightness, which we use as a tracer of chromospheric radiative losses. The majority of the radiative losses are not associated with localized high-Ca ii Kbrightness events, but instead with a more gentle, spatially extended, and persistent heating. The frequency-integrated Ca ii K brightness correlates strongly with the total linear polarization in the Ca ii 854.2 nm, while the Ca ii K profile shapes indicate that the bulk of the radiative losses occur in the lower chromosphere. Non-LTE inversions indicate a transition from heating concentrated around photospheric magnetic elements below log τ 500 = −3 to a more space-filling and time-persistent heating above log τ 500 = −4. The inferred gas temperature at log τ 500 = −3.8 correlates strongly with the total linear polarization in the Ca ii 854.2 nm line, suggesting that that the heating rate correlates with the strength of the horizontal magnetic field in the low chromosphere.