  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 reanalyse 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 on the mass of LHS
1140 b (5.60$\pm$0.19 M$_{\oplus}$) and LHS 1140 c (1.91$\pm$0.06 M$_{\oplus}$)
with unprecedented precision of 3%. Transits from $Spitzer$, HST, and TESS are
jointly analysed for the first time, allowing us to refine the planetary radii
of b (1.730$\pm$0.025 R$_{\oplus}$) and c (1.272$\pm$0.026 R$_{\oplus}$).
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 $\sim$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 CO$_2$ concentration,
from Earth-like to a few bars.
