ToC FTW.

Was this what you had in mind? Contains some changes to CSS too. Let me know if that breaks anything. This doesn't work on mobile as of now.