There is a Reset Layout icon below the panel close button on the right top corner. Clicking the icon will reset query tool panels.
Alternatively, grab it by the title bar, and drag it to somewhere it looks like it would dock - any suitable areas will highlight themselves if you drag over them, indicating you can drop the panel there.
I somehow discovered how to make the output pane float -- but I cannot see how to get it to reattach to the bottom of the window where it originally was. Is there a setting that allows me to re-dock the output pane back to where it was ?