/* Keep the toolbar DOM, hooks, roles and ASE settings intact. Never force it
   visible in browser tabs, and never affect wp-admin or Elementor's editor. */
html[data-nano-pwa-toolbar="hidden"]:not(:has(body.wp-admin, body.elementor-editor-active, body.elementor-edit-area-active)) #wpadminbar {
    display: none !important;
    /* Elementor measures hidden bars with jQuery.height(), which can still
       return WordPress's 32/46 px height even when its DOM rect is zero. */
    height: 0 !important;
    min-height: 0 !important;
}

/* Override WordPress's 32/46 px bump only where toolbar markup is present.
   :has() also covers a toolbar inserted later without polling or DOM rewrites. */
html[data-nano-pwa-toolbar="hidden"]:has(body.admin-bar, #wpadminbar):not(:has(body.wp-admin, body.elementor-editor-active, body.elementor-edit-area-active)) {
    margin-top: 0 !important;
    --wp-admin--admin-bar--height: 0px;
}
