/* ============================================================
   Rentari z-index scale — SINGLE SOURCE OF TRUTH
   ------------------------------------------------------------
   For years the app had NO shared stacking scale: every fixed
   widget invented an arbitrary z-index to win a local fight, so
   the chat launcher sat at ~2.1e9, toasts at 100002, the
   marketing nav at 99999 and celebrations at 90-97. Nothing was
   ordered relative to anything else, which is how the chat ended
   up punching through modal backdrops and confetti ended up
   raining *behind* the welcome scrim.

   This file fixes that by defining ONE ordered set of tokens.
   Any position:fixed / position:sticky overlay MUST take its
   z-index from a token here (with the same numeric fallback, so
   ordering survives on the rare page that doesn't load this file)
   instead of inventing a value.

   The numbers are chosen to line up with the conventions the app
   already uses the most, so existing widgets keep working:
     * marketing nav is designed at Tailwind z-[120] / z-[110]
     * in-app modal backdrops are Tailwind z-[150]
     * toasts already live at 100002
   Higher token value  ==  painted closer to the user.

   ------------------------------------------------------------
   LAYER ORDER (bottom -> top)                token        legacy
   ------------------------------------------------------------
   hidden / behind content                 --z-hide        (-1)
   normal flow                             --z-base         (0)
   lifted in-flow content (relative)       --z-raised      (10)
   sticky sub-bars, reading-progress,
     cookie banner                         --z-sticky      (60)  z-[60]
   nav mega-menus / dropdown flyouts       --z-nav-flyout (110)  z-[110] / was 100000!important
   top navigation bar (marketing + app)    --z-nav        (120)  z-[120] / was 99999!important
   AI chat launcher + window               --z-chat       (140)  was 2147483000
   modal backdrop + modal dialog           --z-modal-backdrop
                                           /--z-modal (150/151)  z-[150]
   Help / Concierge floating buttons       --z-fab       (1150)  1150
   slide-in drawers / side panels + scrims --z-drawer    (1200)  1199/1200
   first-run welcome scrim                 --z-welcome   (1250)  1250
   context menu / tooltip over a drawer    --z-popover   (1300)  1300
   large blocking modal over a drawer      --z-modal-hi  (1500)  1500
   app-wide confirm scrim (clears FABs)    --z-overlay   (9000)  9000
   free-tier upgrade / trial modals        --z-upgrade (100000)  100000/100001
   toasts / snackbars (above every dialog) --z-toast   (100002)  100002
   celebration takeover (confetti, coins,
     welcome fireworks) - pointer-events:none, so it can sit on
     top without ever trapping a click     --z-celebration (100050)  was 90-97
   system-critical always-on-top layer
     (admin impersonation bar, offline
     pill)                                 --z-max  (2147483647)  was 2147483600

   NOTES / DECISIONS
   -----------------
   * CHAT sits ABOVE the nav (so the nav can never dislodge it -
     the original reason it was pinned near INT_MAX) but BELOW
     modal backdrops, so any dialog dims and covers it.
   * CELEBRATIONS are treated as a full-screen TAKEOVER: they own
     the top of the *visual* band (just under the system pill) so
     a "Welcome aboard" burst paints over the welcome scrim and
     any open modal. They are always pointer-events:none, so being
     on top costs nothing - clicks fall straight through.
   * Some already-correct families (in-app modals z-[150], FABs,
     drawers, sl-confirm, free-tier, toasts) still carry raw
     values because they're Tailwind arbitrary classes or shared
     widgets that work today; their tokens above document where
     they belong so new code lands in the right band and they can
     migrate opportunistically.
   ============================================================ */

:root {
  --z-hide:            -1;
  --z-base:             0;
  --z-raised:          10;
  --z-sticky:          60;
  --z-nav-flyout:     110;
  --z-nav:            120;
  --z-chat:           140;
  --z-modal-backdrop: 150;
  --z-modal:          151;
  --z-fab:           1150;
  --z-drawer:        1200;
  --z-welcome:       1250;
  --z-popover:       1300;
  --z-modal-hi:      1500;
  --z-overlay:       9000;
  --z-upgrade:     100000;
  --z-toast:       100002;
  --z-celebration: 100050;
  --z-max:     2147483647;
}
