-/* Absolute positioning to avoid table overlap with floating elements */
-.mw-changeslist-legend.mw-enhanced {
- background-color: #fff;
- position: absolute;
- right: 0;
- margin-top: -0.5em;
+/* Prevent pushing down the content if legend is collapsed */
+.mw-changeslist-legend.mw-collapsed ~ ul:first-of-type > li:first-child,
+.mw-changeslist-legend.mw-collapsed + h4 + div > table.mw-changeslist-line:first-child {
+ clear: right;