  Many exotic charmoniumlike mesons have already been discovered
experimentally, of which the $Z_c$ mesons with isospin 1 are prominent
examples. We investigate $J^{PC}=1^{+\pm}$ states with flavor $\bar cc \bar qq$
($q=u,d$) in isospin 1 using lattice QCD. This is the first study of these
mesons employing more than one volume and involving frames with nonzero total
momentum. We utilize two $N_f=2+1$ CLS ensembles with $m_{\pi}\simeq 280\,$MeV.
As the simulations are performed with unphysical quark masses and at a single
lattice spacing of $a=0.086\,$fm, our results provide only qualitative
insights. Resulting eigenenergies are compatible or just slightly shifted down
with respect to noninteracting energies, where the most significant shifts
occur for certain $D\bar D^*$ states. Both channels $1^{+\pm}$ have a virtual
pole slightly below the threshold if $D\bar D^*$ is assumed to be decoupled
from other channels. In addition, we perform a coupled channel analysis of
$J/\psi \pi$ and $D\bar D^*$ scattering with $J^{PC}=1^{+-}$ within an
effective field theory framework. The $J/\psi \pi$ and $D\bar D^*$
invariant-mass distributions from BESIII and finite-volume energies from
several lattice QCD simulations, including this work, are fitted
simultaneously. All fits yield two poles relatively close to the $D\bar D^*$
threshold and reasonably reproduce the experimental $Z_c$ peaks. They also
reproduce lattice energies up to slightly above the $D\bar{D}^*$ threshold,
while reproduction at even higher energies is better for fits that put more
weight on the lattice data. Our findings suggest that the employed effective
field theory can reasonably reconcile the peaks in the experimental line shapes
and the lattice energies, although those lie close to noninteracting energies.
We also study $J/\psi \pi$ scattering in s-wave and place upper bounds on the
phase shift.
