/* Keep generic popups above DF overlays, but don't change positioning */
.e-popup,
.e-dropdown-popup,
.e-rte-dropdown-popup,
.e-dialog {
  z-index: 200000 !important;
  box-sizing: border-box;
  min-width: 220px;
}

/* Menus size to content & scroll if long */
.e-popup .e-menu,
.e-dropdown-popup .e-menu,
.e-rte-dropdown-popup .e-menu {
  width: max-content !important;
  max-width: 80vw;
  max-height: 60vh;
  overflow: auto;
}

.e-popup .e-menu-item,
.e-dropdown-popup .e-menu-item,
.e-rte-dropdown-popup .e-menu-item {
  white-space: nowrap;
  line-height: 1.6;
  padding: 6px 12px;
}

/* --- Control-specific fixes --- */

/* Rich Text Editor dropdowns & dialogs */
.e-popup.e-rte-dropdown-popup,
.e-dropdown-popup.e-rte-dropdown-popup,
.sfWebRichTextEditor .e-dialog {
  position: fixed !important;
}

/* DatePicker calendars */
.e-datepicker.e-popup,
.e-date-popup {
  position: fixed !important;
}


/* Re-enable italics in RTE content */
.sfWebRichTextEditor .e-rte-content em,
.sfWebRichTextEditor .e-rte-content i {
  font-style: italic !important;
}
