I'm not sure about the line-on-top issue, but if the main breaker handle operates vertically, then the upside down mounting would violate 240.81.