  The Crab Nebula is a unique laboratory for studying the acceleration of
electrons and positrons through their non-thermal radiation. Observations of
very-high-energy $\gamma$ rays from the Crab Nebula have provided important
constraints for modelling its broadband emission. We present the first fully
self-consistent analysis of the Crab Nebula's $\gamma$-ray emission between 1
GeV and $\sim$100 TeV, that is, over five orders of magnitude in energy. Using
the open-source software package Gammapy, we combined 11.4 yr of data from the
Fermi Large Area Telescope and 80 h of High Energy Stereoscopic System
(H.E.S.S.) data at the event level and provide a measurement of the spatial
extension of the nebula and its energy spectrum. We find evidence for a
shrinking of the nebula with increasing $\gamma$-ray energy. Furthermore, we
fitted several phenomenological models to the measured data, finding that none
of them can fully describe the spatial extension and the spectral energy
distribution at the same time. Especially the extension measured at TeV
energies appears too large when compared to the X-ray emission. Our
measurements probe the structure of the magnetic field between the pulsar wind
termination shock and the dust torus, and we conclude that the magnetic field
strength decreases with increasing distance from the pulsar. We complement our
study with a careful assessment of systematic uncertainties.
