Linear precedence in so-called free word order languages remains challenging for modern grammar formalisms. To address this issue, we describe a new framework for dependency grammar, with a modular decomposition of immediate dependency and linear precedence. Our approach distinguishes two orthogonal yet mutually constraining structures: a syntactic dependency tree (ID tree) and a topological dependency tree (LP tree). The ID tree is non-projective, and even non-ordered, and its edges are labeled by syntactic roles. The LP tree is projective, partially ordered, and its edges are labeled by topological fields. The shape of the LP tree is a flattening of the ID tree's obtained by allowing nodes to `climb up'. Our theory of ID/LP trees is formulated in terms of (a) lexicalized constraints and (b) principles governing e.g. climbing conditions. We illustrate it with a detailed account of word order phenomena in the verbal complex of German verb final sentences.