Adjust some styling rules for proper tooltip display

Fixes issue #5540