We present a new compactness theory of Ricci flows. This theory states that any sequence of Ricci flows that is pointed in an appropriate sense, subsequentially converges to a synthetic flow. Under a natural non-collapsing condition, this limiting flow is smooth on the complement of a singular set of parabolic codimension at least 4. We furthermore obtain a stratification of the singular set with optimal dimensional bounds depending on the symmetries of the tangent flows. Our methods also imply the corresponding quantitative stratification result and the expected $L^p$-curvature bounds.
As an application we obtain a description of the singularity formation at the first singular time and a long-time characterization of immortal flows, which generalizes the thick-thin decomposition in dimension 3. We also obtain a backwards pseudolocality theorem and discuss several other applications.