  A previously derived relativistic energy density functional for nuclei, based
on low-energy in-medium chiral dynamics, is generalized to implement
constraints from chiral SU(3) effective field theory and applied to $\Lambda$
hypernuclei. Density-dependent central and spin-orbit mean fields are
calculated for a $\Lambda$ hyperon using the SU(3) extension of in-medium
chiral perturbation theory to two-loop order. Long range $\Lambda N$
interactions arise from kaon-exchange and from two-pion-exchange with a
$\Sigma$ hyperon in the intermediate state. Short-distance dynamics is encoded
in contact interactions. They include scalar and vector mean fields reflecting
in-medium changes of quark condensates, constrained by QCD sum rules. The
$\Lambda$ single particle orbitals are computed for a series of hypernuclei
from $^{13}_{\Lambda}$C to $^{208}_{\Lambda}$Pb. The role of a surface
(derivative) term is studied. Its strength is found to be compatible with a
corresponding estimate from in-medium chiral perturbation theory. Very good
agreement with hypernuclear spectroscopic data is achieved. The smallness of
the $\Lambda$-nuclear spin-orbit interaction finds a natural explanation in
terms of an almost complete cancellation between short-range scalar/vector
contributions and longer range terms generated by two-pion exchange.
