The two-planet transiting system LHS 1140 has been extensively observed since its discovery in 2017, notably with Spitzer, HST, TESS, and ESPRESSO, placing strong constraints on the parameters of the M4.5 host star and its small temperate exoplanets, LHS 1140 b and c. Here, we reanalyze the ESPRESSO observations of LHS 1140 with the novel line-by-line framework designed to fully exploit the radial velocity content of a stellar spectrum while being resilient to outlier measurements. The improved radial velocities, combined with updated stellar parameters, consolidate our knowledge of the mass of LHS 1140 b (5.60 ± 0.19 M
⊕) and LHS 1140 c (1.91 ± 0.06 M
⊕) with an unprecedented precision of 3%. Transits from Spitzer, HST, and TESS are jointly analyzed for the first time, allowing us to refine the planetary radii of b (1.730 ± 0.025 R
⊕) and c (1.272 ± 0.026 R
⊕). Stellar abundance measurements of refractory elements (Fe, Mg, and Si) obtained with NIRPS are used to constrain the internal structure of LHS 1140 b. This planet is unlikely to be a rocky super-Earth, as previously reported, but rather a mini-Neptune with a ∼0.1% H/He envelope by mass or a water world with a water-mass fraction between 9% and 19%, depending on the atmospheric composition and relative abundance of Fe and Mg. While the mini-Neptune case would not be habitable, a water-abundant LHS 1140 b potentially has habitable surface conditions according to 3D global climate models, suggesting liquid water at the substellar point for atmospheres with relatively low CO2 concentration, from Earth-like to a few bars.