adjusted legend structure; added styling for mobile for legend