/**
 * Admin theme tokens are scoped under `.actuate-admin` (styles/theme.css),
 * and dark mode / accent / density are applied as classes-attributes on that
 * same root element. Radix portals default to `document.body`, which sits
 * OUTSIDE that scope — portaled overlays would render with no theme tokens
 * at all (transparent cards, colorless buttons) and ignore dark mode.
 *
 * Every Radix `*.Portal` in the admin must pass this as its `container`.
 * Returns `undefined` during SSR (portals only materialize client-side).
 */
export function adminPortalContainer(): HTMLElement | undefined {
  if (typeof document === 'undefined') return undefined
  return document.querySelector<HTMLElement>('.actuate-admin') ?? undefined
}
