  Context. Supermassive black holes in the centres of radio-loud active
galactic nuclei (AGN) can produce collimated relativistic outflows (jets).
Magnetic fields are thought to play a key role in the formation and collimation
of these jets, but the details are much debated. Aims. We study the innermost
jet morphology and magnetic field strength in the AGN 3C 345 with an
unprecedented resolution using images obtained within the framework of the key
science programme on AGN polarisation of the Space VLBI mission RadioAstron.
Methods. We observed the flat spectrum radio quasar 3C 345 at 1.6 GHz on 2016
March 30 with RadioAstron and 18 ground-based radio telescopes in full
polarisation mode. Results. Our images, in both total intensity and linear
polarisation, reveal a complex jet structure at 300 $\mu$as angular resolution,
corresponding to a projected linear scale of about 2 pc or a few thousand
gravitational radii. We identify the synchrotron self-absorbed core at the jet
base and find the brightest feature in the jet 1.5 mas downstream of the core.
Several polarised components appear in the Space VLBI images that cannot be
seen from ground array-only images. Except for the core, the electric vector
position angles follow the local jet direction, suggesting a magnetic field
perpendicular to the jet. This indicates the presence of plane perpendicular
shocks in these regions. Additionally, we infer a minimum brightness
temperature at the largest $(u,v)$-distances of $1.1\times 10^{12}$ K in the
source frame, which is above the inverse Compton limit and an order of
magnitude larger than the equipartition value. This indicates locally efficient
injection or re-acceleration of particles in the jet to counter the inverse
Compton cooling or the geometry of the jet creates significant changes in the
Doppler factor, which has to be $>11$ to explain the high brightness
temperatures.
