/* Controls belong to the editor layer, never inside the public semantic DOM. */
.us-dxpr-source-controls { position: fixed; inset: 0; width: 0; height: 0; z-index: 10020; pointer-events: none; }
.us-dxpr-source-controls > .controls { pointer-events: auto; position: fixed; }
.us-dxpr-source-controls > .controls:not(.controls--show) { visibility: hidden; }
.us-dxpr-source-controls > .controls.controls--show { visibility: visible; }
.dxpr-editor .us-dxpr-page .az-us-image { cursor: pointer; }

/* The site's body-child rule contains an ID inside :not() and otherwise
   overrides these editor layers. Keep controls above the page, below modals. */
html.dxpr-builder-edit-mode body > .us-dxpr-source-controls {
  position: fixed !important;
  inset: 0;
  z-index: 10020 !important;
}
html.dxpr-builder-edit-mode body > .az-controls-dropdown-menu.dxpr-builder-ui {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 10030 !important;
}
/* Native Preview switches the container's dxpr-editor class. External
   controls must follow that same state despite being outside the container. */
body:not(:has(.az-container.dxpr-editor)) > .us-dxpr-source-controls,
body:not(:has(.az-container.dxpr-editor)) > .az-controls-dropdown-menu.dxpr-builder-ui {
  display: none !important;
}

/* Match the native dependency guard for the external controls as well. */
body:has(.az-container[inert]) > .us-dxpr-source-controls { display: none !important; }
