/* ============================================================
   Site Header — SMSACTIVE
   Self-contained component: include this file + header.html's
   markup + header.js wherever the header should appear.
   ============================================================ */

/* Toast anchored under the header's profile/balance widget — see
   service-panel.js's showHeaderToast(). Position (top/right) is set
   inline per-call since it tracks the actual widget's location. */
.sw-toast{
  position:fixed;
  background:#fdeceb;
  color:#b3261e;
  border:1px solid #f3c6c2;
  padding:9px 16px;
  border-radius:10px;
  font-size:13px;
  font-weight:600;
  box-shadow:0 8px 20px -8px rgba(0,0,0,.3);
  z-index:9999;
  opacity:0;
  transform:translateY(-6px);
  transition:opacity .2s ease, transform .2s ease;
  pointer-events:none;
  white-space:nowrap;
}
.sw-toast.is-visible{opacity:1;transform:translateY(0);}
.sw-toast--success{background:#e5f6ee;color:#0f7a45;border-color:#bfe8d4;}

.site-header{
  --header-pill-bg:#0d3322;
  --header-overlay-rgb:255,255,255;
  --header-border:rgba(var(--header-overlay-rgb),.10);
  --header-text:#ffffff;
  --header-text-soft:#bfe0cf;

  position:relative;
  z-index:1000;
  padding:10px 0 14px;
}

/* Hidden by default — not behind a class auth-header.js has to add — so
   this takes effect from the very first paint, guaranteed by this
   stylesheet loading in <head> before the body even starts parsing.
   Gating the hide behind a class that JS adds (the previous approach)
   still left a gap: that script tag sits near the bottom of the page,
   after several other synchronous <script src> tags each block parsing
   in turn, and the browser can paint the header in its default (guest)
   state during any of those pauses — before the class-adding script ever
   runs. Unconditional CSS has no such race. auth-header.js adds
   is-auth-ready once GET /api/auth/me settles which header actually
   belongs here (guest or logged-in either way); header.html (the
   standalone component-preview page, which never loads auth-header.js)
   sets it immediately inline instead. visibility (not display) keeps the
   header's height stable so nothing else on the page jumps when it
   reveals. */
.site-header__nav,
.site-header__actions{
  visibility:hidden;
}
.site-header.is-auth-ready .site-header__nav,
.site-header.is-auth-ready .site-header__actions{
  visibility:visible;
}

/* Logged-in layout: brand, nav (Histories / Statistic / For Clients /
   Mail) and actions all share one row, same as the guest header —
   nav sits inline between brand and the wallet/profile instead of
   wrapping to a row of its own. Below 860px the existing mobile rules
   (hamburger, accordion) still take over regardless. */
.site-header.is-logged-in .site-header__brand{order:1;}
.site-header.is-logged-in .site-header__nav{order:2;}
.site-header.is-logged-in .site-header__actions{order:3;margin-left:auto;}

.site-header__bar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:20px;
  row-gap:10px;
  background:var(--header-pill-bg);
  border:1px solid var(--header-border);
  border-radius:20px;
  padding:18px 22px;
  box-shadow:0 10px 26px -16px rgba(11,27,61,.5);
  max-width:1650px;
  margin-left:auto;
  margin-right:auto;
}

/* ---------- Brand ---------- */
.site-header__brand{
  display:flex;
  align-items:center;
  gap:1px;
  text-decoration:none;
  flex:0 0 auto;
  margin-right:4px;
}
.site-header__logo{
  height:56px;
  width:56px;
  display:block;
  flex:0 0 auto;
  filter:drop-shadow(0 3px 8px rgba(11,27,61,.22));
}
.site-header__wordmark{
  font-family:var(--font-heading);
  font-size:23px;
  font-weight:700;
  letter-spacing:.1px;
  white-space:nowrap;
}
.site-header__wordmark-sms{color:#ffffff;}
.site-header__wordmark-active{color:#1cb426;}

/* ---------- Primary nav ---------- */
.site-header__nav{
  display:flex;
  align-items:center;
  gap:4px;
  flex:1 1 auto;
}
/* Guest and logged-in alike: For Clients / For Partners (and, when
   logged in, the rest of the nav) sit left, right after the logo,
   instead of centering in the middle of the bar. justify-content is
   flex-start by default, so no override is needed here — this rule
   just documents that on purpose, since a later block used to center
   the guest nav and it's easy to reintroduce by accident. */
.site-header__nav{justify-content:flex-start;}
.site-header__link{
  display:inline-flex;
  align-items:center;
  padding:9px 14px;
  border-radius:999px;
  font-size:14px;
  font-weight:500;
  color:var(--header-text-soft);
  text-decoration:none;
  white-space:nowrap;
  transition:background .16s ease, color .16s ease;
}
.site-header__link:hover{
  background:rgba(var(--header-overlay-rgb),.12);
  color:var(--header-text);
}
.site-header__link-chevron{display:none;transition:transform .18s ease;}

/* ---------- Nav dropdown (desktop: hover; mobile: tap-to-expand) ---------- */
.site-header__nav-item{position:relative;}
.site-header__submenu{
  position:absolute;
  top:100%;
  left:0;
  margin-top:10px;
  min-width:210px;
  background:#ffffff;
  border-radius:16px;
  padding:8px;
  box-shadow:0 14px 30px -12px rgba(11,27,61,.4);
  opacity:0;
  visibility:hidden;
  transform:translateY(6px);
  transition:opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  z-index:1100;
}
.site-header__nav-item:hover .site-header__submenu,
.site-header__nav-item.is-hover-open .site-header__submenu,
.site-header__nav-item:focus-within .site-header__submenu{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  transition:opacity .16s ease, transform .16s ease, visibility 0s;
}
.site-header__submenu a{
  display:block;
  padding:10px 14px;
  border-radius:10px;
  color:#0f3d28;
  font-size:13.5px;
  font-weight:500;
  text-decoration:none;
  white-space:nowrap;
  transition:background .14s ease;
}
.site-header__submenu a:hover{
  background:linear-gradient(135deg, #145c3a, #0f3d28);
  color:#ffffff;
}
/* Injected by auth-header.js's applyHistoryBadges() next to "Phone
   history" / "Mail history" whenever that category has an order still
   waiting for its code. */
.site-header__history-dot{
  display:inline-block;
  width:7px;
  height:7px;
  margin-left:6px;
  border-radius:50%;
  background:#e6462f;
  vertical-align:middle;
}
/* A watched order's code actually arrived — swaps red for green so it
   reads as good news, not a lingering warning. */
.site-header__history-dot--arrived{background:#27ae60;}

/* ---------- Actions ---------- */
.site-header__actions{
  display:flex;
  align-items:center;
  gap:16px;
  flex:0 0 auto;
}
.site-header__btn{
  padding:10px 20px;
  border-radius:999px;
  font-weight:600;
  font-size:13px;
  letter-spacing:.2px;
  border:none;
  cursor:pointer;
  white-space:nowrap;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:background .16s ease;
}
.site-header__btn--ghost{
  background:#fc8715;
  color:#0f3d28;
}
.site-header__btn--ghost:hover{
  background:#e97a0c;
}
.site-header__btn--solid{
  background:#27935f;
  color:#0f3d28;
}
.site-header__btn--solid:hover{
  background:#1f7a52;
}

/* ---------- Logged-in state (balance + account) ---------- */
/* One seamless pill, split in two: a white info half (status dot +
   label + amount, all near-black text) and a dark charcoal "Top Up"
   half — the literal color spec the client asked for, not the header's
   green. Label/dot text swaps between "OUT OF FUNDS" and "BALANCE" in
   auth-header.js depending on the real balance, which also toggles
   .is-empty for the dot's attention pulse below. */
.site-header__wallet{
  display:flex;
  align-items:center;
  gap:10px;
  border-radius:14px;
  background:#ffffff;
  padding:7px 7px 7px 18px;
  flex:0 0 auto;
  box-shadow:0 8px 20px -10px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.5) inset;
}
.site-header__wallet-info{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  white-space:nowrap;
}
.site-header__wallet-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:9.5px;
  font-weight:700;
  letter-spacing:.6px;
  text-transform:uppercase;
  color:#161616;
  opacity:.8;
}
.site-header__wallet-dot{
  position:relative;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#009564;
  flex-shrink:0;
}
/* Quiet attention cue on the dot when the balance is empty — a soft
   expanding ring rather than a color change, so it stays within the
   requested black/white palette instead of introducing a warning red. */
.site-header__wallet.is-empty .site-header__wallet-dot::after{
  content:'';
  position:absolute;
  inset:-3px;
  border-radius:50%;
  border:1px solid rgba(0,149,100,.5);
  animation:walletDotPulse 1.8s ease-out infinite;
}
@keyframes walletDotPulse{
  0%{transform:scale(.6);opacity:.9;}
  100%{transform:scale(2.1);opacity:0;}
}
.site-header__wallet-amount{
  font-size:17px;
  font-weight:800;
  letter-spacing:.1px;
  line-height:1.15;
  color:#0a0a0a;
  font-variant-numeric:tabular-nums;
}
/* A self-contained black chip floating inside the white pill (its own
   rounded rectangle), rather than a black half spanning full-bleed to
   the pill's edge — "rectangle inside the rectangle" per the client. */
.site-header__wallet-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 16px;
  border-radius:9px;
  background:#009564;
  color:#ffffff;
  font-weight:700;
  font-size:13px;
  letter-spacing:.2px;
  white-space:nowrap;
  text-decoration:none;
  transition:background .18s ease;
}
.site-header__wallet-btn:hover{background:#007a52;}
.site-header__wallet-btn:active{background:#000000;}
/* Bare white "+" — no circle behind it — sized up so it still reads as
   a deliberate icon rather than a stray glyph. Scales up slightly on
   hover for a bit of life (a 90° rotation would've been invisible on a
   symmetric plus glyph). */
.site-header__wallet-btn-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#ffffff;
  flex-shrink:0;
  transform:translateY(2px);
  transition:transform .25s cubic-bezier(.34,1.56,.64,1);
}
.site-header__wallet-btn:hover .site-header__wallet-btn-icon{
  transform:translateY(2px) scale(1.15);
}
.site-header__wallet-btn-icon svg{width:16px;height:16px;flex-shrink:0;}
@media (prefers-reduced-motion: reduce){
  .site-header__wallet.is-empty .site-header__wallet-dot::after{animation:none;}
  .site-header__wallet-btn:hover .site-header__wallet-btn-icon{transform:none;}
}
.site-header__profile{
  width:38px;
  height:38px;
  border-radius:50%;
  background:#ffffff;
  border:none;
  box-shadow:0 2px 6px -2px rgba(0,0,0,.3);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#1f7a52;
  flex:0 0 auto;
}
.site-header__profile svg{width:19px;height:19px;}

/* ---------- Profile dropdown (Transfer money / Profile / Logout) ---------- */
.site-header__profile-wrap{position:relative;flex:0 0 auto;}
.site-header__profile-menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:190px;
  background:#ffffff;
  border-radius:20px;
  padding:8px;
  box-shadow:0 14px 30px -12px rgba(11,27,61,.4);
  opacity:0;
  visibility:hidden;
  transform:translateY(6px);
  transition:opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  z-index:1100;
}
.site-header__profile-wrap.is-open .site-header__profile-menu{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  transition:opacity .16s ease, transform .16s ease, visibility 0s;
}
.site-header__profile-email{
  padding:8px 14px 10px;
  margin-bottom:4px;
  border-bottom:1px solid rgba(11,27,61,.12);
  color:#0f3d28;
  opacity:.65;
  font-size:12px;
  font-weight:400;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.site-header__profile-menu-link{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  padding:12px 14px;
  border:none;
  border-radius:12px;
  background:none;
  color:#0f3d28;
  font-family:inherit;
  font-size:14px;
  font-weight:500;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
  transition:background .14s ease;
}
.site-header__profile-menu-link:hover{
  background:linear-gradient(135deg, #145c3a, #0f3d28);
  color:#ffffff;
}
.site-header__profile-menu-icon{width:18px;height:18px;flex-shrink:0;}

/* ---------- Mobile toggle ---------- */
.site-header__toggle{
  display:none;
  width:38px;
  height:38px;
  border-radius:50%;
  border:none;
  background:transparent;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:var(--header-text);
  flex:0 0 auto;
}
.site-header__toggle:hover{background:rgba(var(--header-overlay-rgb),.12);}
.site-header__toggle svg{width:20px;height:20px;}
.site-header__toggle .icon-close{display:none;}
.site-header.is-open .site-header__toggle .icon-menu{display:none;}
.site-header.is-open .site-header__toggle .icon-close{display:block;}

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .site-header{padding:4px 4px 12px;}
  .site-header__bar{
    flex-wrap:wrap;
    justify-content:space-between;
    row-gap:10px;
    column-gap:8px;
    padding:12px clamp(8px, 3vw, 12px) 12px clamp(10px, 3.5vw, 14px);
  }
  /* One compact row for both guest and logged-in states: ☰ → logo +
     "SMSACTIVE" → the right-hand group (Log In/Sign Up for guest,
     wallet for logged-in), then a hard line-break (the ::after breaker
     below) before the collapsed nav/drawer trigger area. */
  .site-header__bar{column-gap:7px;}
  /* Row 1 wraps onto its own flex line above the collapsed nav/drawer
     line below it (see the ::after breaker) — with two lines present,
     the browser can stretch line 1 to more than its content height and
     then align-items:center centers within THAT stretched line, not
     the row visually. align-self:center on each item pins it to the
     middle of its own box regardless, so this can't drift again even
     if the line-height math changes. */
  .site-header__toggle{display:inline-flex;order:1;width:34px;height:34px;align-self:center;}
  .site-header__brand{order:2;margin-right:0;gap:4px;min-width:0;align-self:center;}
  .site-header__logo{height:34px;width:34px;flex-shrink:0;}
  .site-header__wordmark{display:inline;font-size:clamp(12px, 3.2vw, 15px);}
  /* .site-header.is-logged-in .site-header__brand{order:1;} up near the
     top of this file (desktop layout: brand/nav/actions sharing one
     row) is a 3-class selector, which out-specifies the plain 1-class
     .site-header__brand{order:2;} just above — so on mobile it was
     still winning and put the logo before ☰ instead of after it.
     Matching its specificity here, this late in the file, is what
     actually wins the tile for this breakpoint. */
  .site-header.is-logged-in .site-header__toggle{order:1;}
  .site-header.is-logged-in .site-header__brand{order:2;}

  .site-header__actions{
    order:4;
    display:flex;
    align-items:center;
    align-self:center;
    gap:8px;
    margin-left:auto;
    flex:0 1 auto;
    min-width:0;
  }
  .site-header__actions .site-header__btn{
    flex:0 0 auto;
    padding:9px 14px;
    font-size:12.5px;
    white-space:nowrap;
  }
  .site-header__wallet{flex:0 1 auto;min-width:0;}
  .site-header__wallet-info{flex:0 1 auto;min-width:0;}
  .site-header__wallet-btn{flex:0 0 auto;}
  .site-header__profile-wrap{margin-left:8px;flex-shrink:0;}
  .site-header__profile{width:36px;height:36px;border-radius:50%;}
  .site-header__profile svg{width:18px;height:18px;}

  /* Forces the line break between row 1 (☰/brand/actions) and the
     collapsed nav/drawer trigger area underneath, regardless of
     leftover space on row 1 — same technique .site-header__nav already
     uses below via flex-basis:100%. */
  .site-header__bar::after{content:"";order:5;flex-basis:100%;height:0;}

  /* Logged-in only: the wallet needs tighter type to fit next to the ☰
     and brand on the same row, the old profile avatar is dropped from
     this row (coming back in a dedicated spot later — desktop still
     shows it), and ☰ opens the .mnav-* drawer instead of this inline
     accordion, so the accordion itself is hidden. */
  .site-header.is-logged-in .site-header__wallet{
    padding:5px 5px 5px 11px;
    gap:6px;
  }
  .site-header.is-logged-in .site-header__wallet-label{font-size:8.5px;}
  .site-header.is-logged-in .site-header__wallet-amount{font-size:14px;}
  .site-header.is-logged-in .site-header__wallet-btn{padding:7px 11px;gap:5px;font-size:12px;}
  .site-header.is-logged-in .site-header__wallet-btn-icon svg{width:13px;height:13px;}
  .site-header.is-logged-in .site-header__profile-wrap{display:none;}

  .site-header__nav{
    /* Both guest and logged-in now open the .mnav-* drawer instead of
       this inline accordion — its content is fully duplicated into the
       drawer (guest's own For Clients/For Partners/Mail, logged-in's
       Histories/etc.), so this stays hidden rather than also showing
       underneath the drawer. */
    display:none;
    order:6;
    flex:1 1 100%;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    max-height:0;
    overflow:hidden;
    opacity:0;
    padding:0 4px;
    border-radius:16px;
    background:rgba(0,0,0,.16);
    transition:max-height .22s ease, opacity .18s ease, padding .22s ease, margin .22s ease;
  }
  .site-header__nav-item{
    border-bottom:1px solid rgba(var(--header-overlay-rgb),.14);
  }
  .site-header__nav-item:last-child{border-bottom:none;}
  .site-header__link{
    justify-content:space-between;
    padding:14px 10px;
    border-radius:0;
  }
  .site-header__link-chevron{
    display:inline-flex;
    width:14px;
    height:14px;
    flex:0 0 auto;
    opacity:.7;
    padding:12px;
    margin:-12px;
    box-sizing:content-box;
  }
  .site-header__nav-item.is-expanded .site-header__link-chevron{
    transform:rotate(180deg);
  }

  /* mobile submenu: tap-to-expand accordion instead of hover flyout */
  .site-header__submenu{
    position:static;
    margin-top:0;
    min-width:0;
    background:transparent;
    border-radius:0;
    padding:0 10px 0 22px;
    box-shadow:none;
    transform:none;
    max-height:0;
    overflow:hidden;
    opacity:0;
    visibility:visible;
    transition:max-height .2s ease, opacity .2s ease, padding .2s ease;
  }
  .site-header__nav-item:hover .site-header__submenu,
  .site-header__nav-item:focus-within .site-header__submenu{
    opacity:0;
    visibility:visible;
    transform:none;
  }
  .site-header__nav-item.is-expanded .site-header__submenu{
    max-height:220px;
    opacity:1;
    padding-bottom:8px;
  }
  .site-header__submenu a{
    padding:10px 6px;
    border-radius:8px;
    color:var(--header-text-soft);
    font-size:13.5px;
  }
  .site-header__submenu a:hover{background:rgba(var(--header-overlay-rgb),.08);}

  /* .site-header__nav is display:none up above (both states use the
     .mnav-* drawer instead), so it never actually expands — nothing
     left here to flatten corners for. Toggling ☰ opens the drawer,
     which covers only ~84vw from the left; the header bar's own right
     end (wallet pill / Log In+Sign Up) would otherwise peek out past
     the drawer's edge as a stray strip, so it's simplest to just hide
     the real header bar entirely while the drawer's open — it already
     has its own logo+SMSACTIVE up top. */
  .site-header.is-open .site-header__bar{visibility:hidden;}
}

/* Most phones (390-414px: iPhone standard, Pixel, Galaxy) are just
   short of the room the ≤860px row needs to keep everything on one
   line at "professional" size — ☰ / logo / profile stay full-size
   here (they're the tap targets), only the wallet's own type shrinks
   a bit further so the row still fits without wrapping. */
@media (max-width: 420px){
  .site-header.is-logged-in .site-header__bar{column-gap:5px;}
  .site-header.is-logged-in .site-header__wordmark{font-size:11.5px;}
  .site-header.is-logged-in .site-header__wallet{padding:4px 4px 4px 9px;gap:4px;}
  .site-header.is-logged-in .site-header__wallet-label{font-size:7.5px;}
  .site-header.is-logged-in .site-header__wallet-amount{font-size:12.5px;}
  .site-header.is-logged-in .site-header__wallet-btn{padding:6px 9px;gap:4px;font-size:11px;}
  .site-header.is-logged-in .site-header__wallet-btn-icon svg{width:11px;height:11px;}
}

@media (max-width: 360px){
  /* Too narrow for logo + "SMSACTIVE" + wallet + profile to all stay
     comfortably legible on one row — the wordmark is the one piece
     that can drop without losing function (the logo alone still
     identifies the brand), same call the ≤860px tier makes for nav
     labels via the hamburger. */
  .site-header__wordmark{display:none;}
  .site-header__logo{height:30px;width:30px;}
  .site-header__toggle{width:30px;height:30px;}
  .site-header__profile{width:30px;height:30px;}
  .site-header__wallet{padding:4px 4px 4px 10px;gap:5px;}
  .site-header__wallet-label{font-size:8px;}
  .site-header__wallet-amount{font-size:13px;}
  .site-header__wallet-btn{padding:6px 10px;font-size:11.5px;}

  /* The ≤860px logged-in rules above are scoped with .is-logged-in,
     which out-specifies the plain selectors just above — repeat with
     the same scoping so this tier's shrink actually wins for that
     state instead of losing the specificity fight. */
  .site-header.is-logged-in .site-header__wordmark{display:none;}
  .site-header.is-logged-in .site-header__logo{height:30px;width:30px;}
  .site-header.is-logged-in .site-header__toggle{width:30px;height:30px;}
  .site-header.is-logged-in .site-header__profile{width:30px;height:30px;}
  .site-header.is-logged-in .site-header__wallet{padding:4px 4px 4px 10px;gap:5px;}
  .site-header.is-logged-in .site-header__wallet-label{font-size:8px;}
  .site-header.is-logged-in .site-header__wallet-amount{font-size:13px;}
  .site-header.is-logged-in .site-header__wallet-btn{padding:6px 10px;font-size:11.5px;}
}

/* ============================================================
   Mobile off-canvas drawer — opened by the same ☰ toggle (see
   header.js), only reachable on mobile since the toggle itself is
   display:none above 860px. Logged-in only: populated by
   auth-header.js from #loggedInDrawerTemplate. Self-contained "mnav-"
   prefix so nothing here collides with .site-header__* rules above.
   ============================================================ */
.mnav-backdrop{
  position:fixed;
  inset:0;
  background:rgba(4,12,8,.6);
  opacity:0;
  visibility:hidden;
  transition:opacity .25s ease, visibility 0s linear .25s;
  z-index:1400;
}
.mnav-backdrop.is-open{
  opacity:1;
  visibility:visible;
  transition:opacity .25s ease, visibility 0s;
}
.mnav-panel{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:min(84vw, 336px);
  background:linear-gradient(180deg, #0f3222 0%, #0a2116 100%);
  box-shadow:16px 0 40px -14px rgba(0,0,0,.55);
  z-index:1500;
  overflow-y:auto;
  padding:18px 16px 24px;
  transform:translateX(-100%);
  transition:transform .3s cubic-bezier(.22,.9,.32,1);
  scrollbar-width:none; /* Firefox */
  -ms-overflow-style:none; /* old Edge/IE */
}
/* Chrome/Edge/Safari: the panel still scrolls fine with the mouse
   wheel/touch/keyboard, this only hides the visible up/down-arrow
   scrollbar track so it doesn't look like a stray control. */
.mnav-panel::-webkit-scrollbar{display:none;}
.mnav-panel.is-open{transform:translateX(0);}
/* Focused programmatically on open purely to move keyboard/screen-reader
   focus into the dialog — it's a container, not a control, so no visible
   ring is needed (its own children keep normal focus styles). */
.mnav-panel:focus{outline:none;}

/* Set on <body> while the drawer is open (header.js) so the page behind
   it can't be scrolled with it still visible. */
body.mnav-scroll-lock{overflow:hidden;}

.mnav-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px;}
.mnav-brand{display:flex;align-items:center;gap:5px;text-decoration:none;min-width:0;}
.mnav-logo{height:32px;width:32px;flex-shrink:0;display:block;}
.mnav-wordmark{font-family:var(--font-heading);font-size:16px;font-weight:700;white-space:nowrap;}
.mnav-wordmark-sms{color:#ffffff;}
.mnav-wordmark-active{color:#1cb426;}
.mnav-close{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,.08);
  color:#ffffff;
  cursor:pointer;
  flex-shrink:0;
  transition:background .16s ease;
}
.mnav-close:hover{background:rgba(255,255,255,.16);}
.mnav-close svg{width:16px;height:16px;}

.mnav-balance{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:12px 14px;
  margin-bottom:16px;
}
.mnav-balance-info{display:flex;flex-direction:column;gap:3px;min-width:0;}
.mnav-balance-label{
  font-size:10px;
  font-weight:700;
  letter-spacing:.6px;
  text-transform:uppercase;
  color:#8fd8b2;
  opacity:.85;
}
.mnav-balance-amount{font-size:19px;font-weight:800;color:#ffffff;font-variant-numeric:tabular-nums;}
.mnav-balance-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 14px;
  border-radius:10px;
  background:#27935f;
  color:#ffffff;
  font-weight:700;
  font-size:13px;
  white-space:nowrap;
  text-decoration:none;
  flex-shrink:0;
  transition:background .16s ease;
}
.mnav-balance-btn:hover{background:#1f7a52;}
.mnav-balance-btn svg{width:14px;height:14px;flex-shrink:0;}

/* Guest drawer only: Log In / Sign Up sit where the balance card sits
   for the logged-in drawer — same position, same "first thing you see"
   role, just the pair of auth actions instead of a balance readout. */
.mnav-auth-row{display:flex;gap:10px;margin-bottom:16px;}
.mnav-auth-btn{
  flex:1 1 0;
  padding:11px 14px;
  border-radius:10px;
  border:none;
  font-family:inherit;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  text-decoration:none;
  text-align:center;
  transition:background .16s ease;
}
.mnav-auth-btn--ghost{background:#fc8715;color:#0f3d28;}
.mnav-auth-btn--ghost:hover{background:#e97a0c;}
.mnav-auth-btn--solid{background:#27935f;color:#ffffff;}
.mnav-auth-btn--solid:hover{background:#1f7a52;}

.mnav-list{display:flex;flex-direction:column;}
.mnav-item{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:12px 10px;
  border:none;
  border-radius:12px;
  background:none;
  color:#ffffff;
  font-family:inherit;
  font-size:14.5px;
  font-weight:600;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
  transition:background .14s ease;
}
.mnav-item:hover{background:rgba(255,255,255,.06);}
.mnav-item.is-active{background:rgba(39,147,95,.22);color:#6fe3a8;}
.mnav-item-icon{width:19px;height:19px;flex-shrink:0;color:#bfe0cf;}
.mnav-item.is-active .mnav-item-icon{color:#6fe3a8;}
.mnav-item--plain:hover .mnav-item-icon{color:#ffffff;}
.mnav-item span{flex:1 1 auto;min-width:0;}
.mnav-item-chevron{width:15px;height:15px;flex-shrink:0;opacity:.55;transition:transform .18s ease;}
.mnav-group.is-expanded .mnav-item-chevron{transform:rotate(90deg);}

.mnav-sublist{
  display:flex;
  flex-direction:column;
  max-height:0;
  overflow:hidden;
  padding-left:41px;
  transition:max-height .22s ease;
}
.mnav-group.is-expanded .mnav-sublist{max-height:200px;}
.mnav-sublist a{
  padding:10px 10px;
  color:#bfe0cf;
  font-size:13.5px;
  font-weight:500;
  text-decoration:none;
  border-radius:8px;
  transition:background .14s ease, color .14s ease;
}
.mnav-sublist a:hover{background:rgba(255,255,255,.06);color:#ffffff;}

.mnav-divider{height:1px;background:rgba(255,255,255,.1);margin:10px 6px;}

.mnav-logout{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:12px 10px;
  border:none;
  border-radius:12px;
  background:none;
  color:#ff8080;
  font-family:inherit;
  font-size:14.5px;
  font-weight:600;
  text-align:left;
  cursor:pointer;
  transition:background .14s ease;
}
.mnav-logout:hover{background:rgba(255,90,90,.12);}
.mnav-logout svg{width:19px;height:19px;flex-shrink:0;}

@media (prefers-reduced-motion: reduce){
  .mnav-panel,.mnav-backdrop,.mnav-item-chevron,.mnav-sublist{transition:none;}
}
