You are absolutely correct. CSS sadly doesn’t have the possibility to do this. Making the ToC floating like that (which uses position: fixed), uses the entire viewport for its positioning and can’t be parented to the modal/popup or relative to another element.
So without Javascript this will be impossible.
I’ve just updated the CSS in the original post to prevent the transformation from being applied to the popups/modals for now, until another solution will become available.
Let me know if i missed some usecase that i’m not familiar with (yet) ![]()