fix hiding/showing element to use CSS instance rule, if possible