A search for flavor-changing neutral-current couplings between a top quark, an up or charm quark, and a Z boson is presented, using proton–proton collision data at √ s = 13 TeV collected by the ATLAS detector at the Large Hadron Collider. The analyzed data set corresponds to an integrated luminosity of 139 fb − 1 . The search targets both single-top-quark events produced as g q → t Z (with q = u , c ) and top-quark-pair events, with one top quark decaying through the t → Z q channel. The analysis considers events with three leptons (electrons or muons), a b -tagged jet, possible additional jets, and missing transverse momentum. The data are found to be consistent with the background-on...