  We construct a closed system of equations describing the quark--anti-quark
potential at any coupling in planar N=4 supersymmetric Yang-Mills theory. It is
based on the Quantum Spectral Curve method supplemented with a novel type of
asymptotics. We present a high precision numerical solution reproducing the
classical and one-loop string predictions very accurately. We also analytically
compute the first 7 nontrivial orders of the weak coupling expansion.
  Moreover, we study analytically the generalized quark--anti-quark potential
in the limit of large imaginary twist to all orders in perturbation theory. We
demonstrate how the QSC reduces in this case to a one-dimensional Schrodinger
equation. In the process we establish a link between the Q-functions and the
solution of the Bethe-Salpeter equation.
