If your content is too tall, then your width didn’t take into account the scroll bar existance (or non existance.
Perhaps avoid using PX widths and use %ages instead.
Did you check the size of body to see if it matches what you expected.
I get 318px x 500px internal on a max height panel.
But the width would be slightly less on windows with scroll bars