  We prove the equivalence between a relative bottleneck property and being
quasi-isometric to a tree-graded space. As a consequence, we deduce that the
quasi-trees of spaces defined axiomatically by Bestvina-Bromberg-Fujiwara are
quasi-isometric to tree-graded spaces. Using this we prove that mapping class
groups quasi-isometrically embed into a finite product of simplicial trees. In
particular, these groups have finite Assouad-Nagata dimension, direct
embeddings exhibiting $\ell^p$ compression exponent $1$ for all $p\geq 1$ and
they quasi-isometrically embed into $\ell^1(\mathbb N)$. We deduce similar
consequences for relatively hyperbolic groups whose parabolic subgroups satisfy
such conditions.
  In obtaining these results we also demonstrate that curve complexes of
compact surfaces and coned-off graphs of relatively hyperbolic groups admit
quasi-isometric embeddings into finite products of trees.
