Safari arbitrarily resizes windows, not related to options in System Settings
I'm being driven mad by Safari arbitrarily resizing windows.
To be clear, this is NOT caused by options in System Settings->Desktop & Dock->Windows. All of them have been disabled.
Behavior #1 - If I drag a window that is full size and against the left and top edges of the display towards the middle, Safari will often shorten it by 30-40%.
Interesting Detail - if I drag the window back to top and left edges, resize to full length, then drag back towards the middle again, the shortening behavior does not occur.
Behavior #2 - I often go back to open windows to find they have been tiled to upper left and are tiny. As before, none of the System Settings options are enabled, and in this case no dragging occurred. Safari just decided to do it by itself.
It seems that other people have this problem too, but it gets drowned out by people recommending the Systems Settings choices. This is NOT that.
The behavior is occurring on an M4 MacBook Pro 16" that is often but not always connected to a desktop monitor. The behavior occurs on both displays and both when the MBP is connected to the monitor and when it is not.