  We use FIRE-2 simulations to examine 3-D variations of gas-phase elemental
abundances of [O/H], [Fe/H], and [N/H] in 11 Milky Way (MW) and M31-mass
galaxies across their formation histories at $z \leq 1.5$ ($t_{\rm lookback}
\leq 9.4$ Gyr), motivated by characterizing the initial conditions of stars for
chemical tagging. Gas within $1$ kpc of the disk midplane is vertically
homogeneous to $\lesssim 0.008$ dex at all $z \leq 1.5$. We find negative
radial gradients (metallicity decreases with galactocentric radius) at all
times, which steepen over time from $\approx -0.01$ dex kpc$^{-1}$ at $z = 1$
($t_{\rm lookback} = 7.8$ Gyr) to $\approx -0.03$ dex kpc$^{-1}$ at $z = 0$,
and which broadly agree with observations of the MW, M31, and nearby
MW/M31-mass galaxies. Azimuthal variations at fixed radius are typically $0.14$
dex at $z = 1$, reducing to $0.05$ dex at $z = 0$. Thus, over time radial
gradients become steeper while azimuthal variations become weaker (more
homogeneous). As a result, azimuthal variations were larger than radial
variations at $z \gtrsim 0.8$ ($t_{\rm lookback} \gtrsim 6.9$ Gyr).
Furthermore, elemental abundances are measurably homogeneous (to $\lesssim
0.05$ dex) across a radial range of $\Delta R \approx 3.5$ kpc at $z \gtrsim 1$
and $\Delta R \approx 1.7$ kpc at $z = 0$. We also measure full distributions
of elemental abundances, finding typically negatively skewed normal
distributions at $z \gtrsim 1$ that evolve to typically Gaussian distributions
by $z = 0$. Our results on gas abundances inform the initial conditions for
stars, including the spatial and temporal scales for applying chemical tagging
to understand stellar birth in the MW.
