/**
 * nSmarTrac — UI core enforcement layer
 *
 * Load on EVERY modern page via rest/shared/assets_core_styles.php
 * immediately after shadcn-bootstrap.css and BEFORE page-specific CSS.
 *
 * Rules:
 * 1. Page CSS (views/rest/{page}/css/*.css) must NOT style
 *    global overlays or unscoped `body i.fas` — scope icons to page chrome only.
 * 2. Floating UI uses tokens below; component CSS owns its own colors inside
 *    these namespaces (.nsm-pwa-update, .nsm-toast, …).
 * 3. Page CSS must not override overlay position/z-index — extend tokens here.
 */

/* ─── Overlay layer tokens ─── */
:root {
  --nsm-overlay-top: max(1rem, env(safe-area-inset-top, 0px));
  --nsm-overlay-inset-x: 1rem;
  --nsm-overlay-max-width: 32rem;
  --nsm-z-overlay: 30001;
}

/* ─── Global overlay isolation ───
   Body-level overlays are direct children of <body class="lp-body|auth-body|dash-body">.
   Page icon rules like `.lp-body i.fas { color: primary }` have equal/higher specificity
   than component rules and load later — this block wins for shared overlay namespaces. */

.lp-body .nsm-pwa-update i.fas,
.auth-body .nsm-pwa-update i.fas,
.dash-body .nsm-pwa-update i.fas,
.nsm-pwa-update i.fas,
.lp-body .nsm-toast i.fas,
.auth-body .nsm-toast i.fas,
.dash-body .nsm-toast i.fas,
.nsm-toast i.fas,
.lp-body .nsm-toast-container i.fas,
.auth-body .nsm-toast-container i.fas,
.dash-body .nsm-toast-container i.fas,
.nsm-toast-container i.fas {
  color: inherit;
}

.nsm-pwa-update__icon,
.nsm-pwa-update__dismiss i.fas {
  color: #fff;
}

.nsm-toast {
  color: #fff;
}

.nsm-toast__icon,
.nsm-toast__close i.fas {
  color: inherit;
  opacity: 0.95;
}
