You can improve the layout by disabling spacing & round corners:
titlebar.bttpreset (22.8 KB)
In 5.264 I slightly changed the "Show Floating Menu" action so it activates the BTT process if "Activate Keyboard Focus When Showing" is checked - this should make sure that window level 0 windows are brought to front.
To close the floating menu via Java Script you could use
let result = await trigger_action({json: JSON.stringify({
BTTPredefinedActionType: 387,
BTTPredefinedActionName: 'Hide Floating Menu',
BTTAdditionalActionData: '{\"BTTMenuActionMenuID\":\"accounts\"}',
}), wait_for_reply: true});