Inversion diameter and treewidth (Discrete Mathematics & Theoretical Computer Science, 2026)