  Let $Y$ be an abelian variety over a subfield $k \subset \mathbb{C}$ that is
of finite type over $\mathbb{Q}$. We prove that if the Mumford-Tate conjecture
for $Y$ is true, then also some refined integral and adelic conjectures due to
Serre are true for $Y$. In particular, if a certain Hodge-maximality condition
is satisfied, we obtain an adelic open image theorem for the Galois
representation on the (full) Tate module of $Y$. Our second main result is an
(unconditional) adelic open image theorem for K3 surfaces. The proofs of these
results rely on the study of a natural representation of the fundamental group
of a Shimura variety.
