I've abstracted out the expand-collapse styling for both the outline and container pages as suggested. I did not do the same for the checklists page for now, since that template uses different styling that makes the whole header area selectable.