  Deuterium and lithium are light elements of high cosmological and
astrophysical importance. In this work we report the first detection of
deuterated molecules and a search for lithium hydride, 7LiH, at redshift z=0.89
in the spiral galaxy intercepting the line of sight to the quasar PKS1830-211.
We used ALMA to observe several submillimeter lines of ND, NH2D, and HDO, and
their related isotopomers NH2, NH3, and H2^18O, in absorption against the
southwest image of the quasar, allowing us to derive XD/XH abundance ratios.
The absorption spectra mainly consist of two distinct narrow velocity
components for which we find remarkable differences. One velocity component
shows XD/XH abundances that is about 10 times larger than the primordial
elemental D/H ratio, and no variability of the absorption profile during the
time span of our observations. [...] The second component has XD/XH abundances
that are 100 times larger than the primordial D/H ratio, a deepening of the
absorption by a factor of two within a few months, and a rich chemical
composition, with relative enhancements of N2H+, CH3OH, SO2, and complex
organic molecules. We therefore speculate that this component is associated
with the analog of a Galactic dark cloud, while the first component is likely
more diffuse. Our search for the 7LiH (1--0) line was unsuccessful and we
derive an upper limit 7LiH/H2 = 4 x 10^-13 (3sigma) in the z=0.89 absorber
toward PKS1830-211. Besides, with ALMA archival data, we could not confirm the
previous tentative detections of this line in the z=0.68 absorber toward
B0218+357; we derive an upper limit 7LiH/H2 = 5 x 10^-11 (3sigma), although
this is less constraining than our limit toward PKS1830-211. We conclude that,
as in the Milky Way, only a tiny fraction of lithium nuclei are possibly bound
in LiH in these absorbers at intermediate redshift.
