:root{
  --bg:#f6f8fb; --ink:#0f172a; --muted:#5b677a; --line:#e5e7eb;
  --brandFrom:#025fbc; --brandTo:#06a2dd; --card:#ffffff; --ring:#e9eef6;
  --shadow:0 10px 28px rgba(2,95,188,.10);
  --shadow-strong:0 14px 40px rgba(15,23,42,.18), 0 6px 18px rgba(2,95,188,.12);
  --radius:16px; --radius-lg:22px;
  --wrap-max: 1200px;
}

/* Base */
html,body{height:100%}
body{
  margin:0;color:var(--ink);
  font-family:Poppins,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}

/* Container utilities */
.wrap { max-width: 1350px; margin: 0 auto; padding-inline: 24px; } /* keep default */

.wrap--flush-left  { padding-left: 0; }
.wrap--flush-right { padding-right: 0; }
.wrap--no-pad      { padding: 0; }

/* Mobile guard so text never hugs the edge */
@media (max-width: 640px){
  .wrap--flush-left  { padding-left: 16px; }
  .wrap--flush-right { padding-right: 16px; }
}

.section{padding:44px 0}
.kicker{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:700}
h1,h2{margin:0}
h2{font-size:28px;letter-spacing:-.01em}
.muted{color:var(--muted)}
.see{color:#025fbc;font-weight:600;white-space:nowrap}
.row-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin-bottom:16px}

/* Buttons / chips shared */
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:600;cursor:pointer}
.btn.primary{background:#0f172a;border-color:#0f172a;color:#fff}
.btn.cta{background:linear-gradient(135deg,var(--brandFrom),var(--brandTo));border-color:transparent;color:#fff;font-weight:600}
.chip{display:inline-flex;align-items:center;gap:8px;background:#f3f6fb;border:1px solid #e6ebf4;padding:6px 10px;border-radius:999px;font-size:12.5px}

/* ======= HEADER (legacy 2-row, kept for other pages) ======= */
.site-header{
  position: fixed; /* was sticky */
  top: 0; left: 0; right: 0; width: 100%;
  z-index: 60;
  transform: translateY(0);
  will-change: transform;
  transition: transform .28s ease, box-shadow .2s ease;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid #eef2f6;
}

.site-header.is-hidden{transform:translateY(-100%)}
.site-header.has-shadow{box-shadow:0 10px 24px rgba(2,95,188,.08)}
.site-header .row-1{display:flex;align-items:center;gap:16px;padding:10px 0}
.site-header .row-2{display:flex;align-items:center;gap:16px;padding:10px 0;border-top:1px solid #eef2f6}

.brand{display:flex;align-items:center;gap:10px}
.logo{height:36px;width:36px;border-radius:12px;background:linear-gradient(135deg,var(--brandFrom),var(--brandTo));color:#fff;display:grid;place-items:center;font-weight:800}
.brand b{font-size:18px}
.spacer{flex:1}

.flag{width:16px;height:16px;border-radius:3px;overflow:hidden;box-shadow:0 0 0 1px rgba(0,0,0,.06) inset}
.flag.ca{background:linear-gradient(90deg,#e21d39 0 33%,#fff 33% 66%,#e21d39 66% 100%)}

.loc-chip{display:inline-flex;align-items:center;gap:8px;background:#f3f6fb;border:1px solid #e6ebf4;padding:6px 10px;border-radius:999px}
.loc-thumb{width:18px;height:18px;border-radius:999px;overflow:hidden;flex:0 0 auto;border:1px solid #dbe7f6}
.loc-thumb img{width:100%;height:100%;object-fit:cover}

.nav{display:flex;align-items:center;gap:10px}
.nav a{padding:8px 10px;border-radius:10px;font-weight:500}
.nav a:hover{background:#f5f7fb}

.more{position:relative}
.more:hover .more-menu{opacity:1;visibility:visible;transform:translateY(0)}
.more-menu{
  position:absolute;top:calc(100% + 8px);left:0;min-width:220px;
  background:#fff;border:1px solid #e9eef6;border-radius:12px;box-shadow:0 18px 48px rgba(2,95,188,.18);
  padding:8px;opacity:0;visibility:hidden;transform:translateY(6px);transition:.18s ease
}
.more-menu a{display:block;padding:8px 10px;border-radius:10px;font-weight:600;color:#0f172a}
.more-menu a:hover{background:#f5f7fb}

/* ======= FOOTER ======= */
.site-footer{background:#0f172a;color:#c7d0e0;padding:36px 0;margin-top:20px}
.site-footer .grid{display:grid;gap:18px;grid-template-columns:2fr 1fr 1fr 1fr}
@media (max-width:980px){.site-footer .grid{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.site-footer .grid{grid-template-columns:1fr}}
.f-brand{display:flex;align-items:center;gap:10px;color:#fff}
.f-logo{height:34px;width:34px;border-radius:10px;background:linear-gradient(135deg,var(--brandFrom),var(--brandTo));display:grid;place-items:center;font-weight:800}
.f-title{font-weight:800;letter-spacing:.2px}
.f-sub{margin:8px 0 0;color:#9fb0cc;font-size:14px;max-width:42ch}
.f-col h4{margin:0 0 10px;color:#fff;font-size:14px;letter-spacing:.12em;text-transform:uppercase}
.f-col a{display:block;color:#c7d0e0;margin:6px 0;font-weight:600}
.store-row.footer{margin-top:8px}
.store-btn{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:12px;background:#0f172a;color:#fff;border:1px solid #0f172a;font-weight:700}
.f-btm{border-top:1px solid #233248;margin-top:24px;padding-top:16px;color:#9fb0cc;font-size:13px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}

@media (max-width: 560px){
  #site-footer .footer-pad{ padding-top: 36px; padding-bottom: 36px; }
  #site-footer .grid{ gap: 22px; }
  #site-footer .footer-bar{ flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* Utility */
#popular.section{padding-top:72px} /* extra space from header */

/* Modern underline for nav links (hover + active) */
.site-header .nav a{
  position: relative;
  padding-bottom: 10px; /* room for underline */
}

.site-header .nav a::after{
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--brandFrom), var(--brandTo));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
  opacity: .95;
}
.site-header .nav a:hover::after,
.site-header .nav a.is-active::after{ transform: scaleX(1); }

/* Optional: subtle color nudge on hover */
.site-header .nav a:hover{ color: #0f172a; }

/* Guard: keep Everjoy header login button styling */
#site-header.ej-nav .ej-main .ej-rail > a.ej-login{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  height:42px !important;
  padding:0 14px !important;
  border-radius:12px !important;
  background:#0f172a !important;
  color:#fff !important;
  border:1px solid #0f172a !important;
  font-weight:800 !important;
  text-decoration:none !important;
}
#site-header.ej-nav .ej-main .ej-rail > a.ej-login:hover{ filter:brightness(1.04) !important; }

/* =======================
   Footer (Everjoy)
   ======================= */
/* Dark neutral footer (reduces “blue on blue” feeling) */
#site-footer{
  background: linear-gradient(180deg, #131313 0%, #181818 100%);
  border-top: 1px solid rgba(255,255,255,.10);
  color: #dbe4f0;
}

  /* ===== Footer — mobile simplify (2-column) ==================== */
  @media (max-width:560px){
    /* Layout: 2 columns; brand & badges span full width */
    #site-footer .wrap{ padding-inline:16px; }
    #site-footer .footer-pad{ padding-top:28px; padding-bottom:28px; }

    #site-footer .grid{
      grid-template-columns: 1fr 1fr !important; /* override earlier 1-col rule */
      gap:16px;
    }
    #site-footer .grid > :nth-child(1){ grid-column: 1 / -1; } /* Brand full width */
    #site-footer .grid > :nth-child(2){ grid-column: auto; }   /* Explore */
    #site-footer .grid > :nth-child(3){ grid-column: auto; }   /* Company */
    #site-footer .grid > :nth-child(4){ grid-column: 1 / -1; } /* Mobile app row */

    /* Compact type + spacing */
    #site-footer h4{ font-size:12px; margin:0 0 6px; }
    #site-footer ul{ gap:6px; }
    #site-footer a{ font-size:13px; }
    #site-footer .brand-copy{ font-size:13px; margin-top:8px; }

    /* Smaller badges row */
    #site-footer .brand-cta{ gap:8px; margin-top:10px; }
    #site-footer .app-badges{ gap:8px; }
    #site-footer .app-badge svg{ height:30px; width:auto; }    /* shrink SVGs */

    /* Bottom bar: tighter and safe with tabbar */
    #site-footer .footer-bar{ padding:14px 16px; gap:10px; }
  }


/* container + grid */
#site-footer .wrap{ max-width:1350px; margin:0 auto; padding:0 24px; }
#site-footer .footer-pad{ padding-top:48px; padding-bottom:48px; } /* smaller overall */
#site-footer .grid{
  display:grid; gap:28px;                    /* tighter spacing */
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width:960px){ #site-footer .grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width:560px){ #site-footer .grid{ grid-template-columns: 1fr; } #site-footer{ padding-bottom: 80px;}}

/* brand block */
#site-footer .brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
#site-footer .logo{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:12px; background:#fff; color:#1d4ed8;
  font-weight:800; box-shadow:0 8px 16px rgba(0,0,0,.15);
}
#site-footer .name{ color:#fff; font-weight:600; font-size:16px; line-height:1; }
#site-footer .tag{ color:#cbd5e1; font-size:12px; margin-top:2px; }
#site-footer .brand-copy{ margin-top:14px; max-width:36ch; }

#site-footer .muted{ color:#cbd5e1; }
#site-footer .small{ font-size:.95rem; }
#site-footer .tiny{ font-size:.8rem; }

/* app badges + pill */
#site-footer .brand-cta{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
#site-footer .pill{
  display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.25); color:#fff; font-size:12px;
}
#site-footer .pill-dot{ width:8px; height:8px; border-radius:999px; background:#10b981; display:inline-block; }
#site-footer .app-badges{ display:flex; gap:12px; flex-wrap:wrap; }
#site-footer .app-badge{ display:inline-block; line-height:0; border-radius:10px; overflow:hidden; }

/* columns */
#site-footer h4{ color:#fff; font-weight:600; margin:0 0 10px; font-size:15px; }
#site-footer ul{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
#site-footer a{ color:rgba(255,255,255,.86); text-decoration:none; }
#site-footer a:hover{ color:#ffffff; }

#site-footer .pill{
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  color:#fff;
}
#site-footer .app-badge{
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}


/* newsletter form */
#site-footer .nl{ display:flex; gap:8px; }
#site-footer .nl-input{
  height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(148,163,184,.35);
  color:#0f172a; outline: none; padding: 0 .9rem; flex:1 1 auto;
}
#site-footer .nl-input:focus{
  border-color:#6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
#site-footer .nl-btn{
  height: 46px; border-radius: 12px;
  background:#fff; color:#153463; font-weight:600; padding: 0 1rem; border:0; cursor:pointer;
}
#site-footer .nl-btn:hover{ background:#f3f4f6 }

/* bottom bar */
#site-footer .bar{ border-top:1px solid rgba(255,255,255,.10) }

#site-footer .footer-legal{ display:flex; align-items:center; gap:.9rem; flex-wrap:wrap; }
#site-footer .footer-legal a{ color:#cbd5e1; font-size:.95rem; }
#site-footer .footer-legal a:hover{ color:#fff; }
#site-footer .footer-legal .dot{ width:4px; height:4px; border-radius:999px; background:rgba(255,255,255,.35); display:inline-block; }
#site-footer .footer-legal .sep{ width:1px; height:18px; background:rgba(255,255,255,.15); display:inline-block; margin:0 .25rem; }
#site-footer .footer-legal .social{ display:inline-flex; line-height:0; color:#cbd5e1; }
#site-footer .footer-legal .social:hover{ color:#fff; }

@media (max-width:640px){
  #site-footer .footer-bar{ flex-direction:column; align-items:flex-start; }
}

/* bottom bar — match page container */
#site-footer .footer-bar{
  max-width:1350px; margin:0 auto; padding:20px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}

.auth-guest .user-only{display:none!important}
.auth-user  .guest-only{display:none!important}

/* --- Legacy avatar styles (site-header namespace) kept for compatibility --- */
.site-header .account { position: relative; }
.site-header .avatar-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:9999px;
  border:1px solid rgba(15,23,42,.12); background:#fff; cursor:pointer; overflow:hidden;
  transition: box-shadow .15s ease;
}
.site-header .avatar-btn:hover { box-shadow: 0 2px 8px rgba(15,23,42,.10); }
.site-header .avatar-btn img { width:100%; height:100%; object-fit:cover; display:none; }
.site-header .avatar-btn #avatarFallback{ display:inline-flex; width:100%; height:100%; align-items:center; justify-content:center; }
.site-header .account-menu{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:160px; background:#fff; border:1px solid rgba(15,23,42,.12);
  border-radius:12px; box-shadow:0 12px 28px rgba(15,23,42,.12);
  padding:6px; display:none;
}
.site-header .account.open .account-menu{ display:block; }
.site-header .account-menu button,.site-header .account-menu a{
  width:100%; text-align:left; background:transparent; border:0;
  padding:8px 10px; border-radius:8px; font-size:14px; color:#0f172a; cursor:pointer;
}
.site-header .account-menu button:hover,.site-header .account-menu a:hover{ background:#f1f5f9; }

/* =========================================================
   NEW: Single-row Navbar (ej-nav) — scoped & non-conflicting
   ========================================================= */

.ej-nav{
  position:fixed; top:0; left:0; right:0; z-index:60;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid #eef2f6;
}
.ej-nav__bar{
  display:flex; align-items:center; gap:14px;
  height:64px;
}

/* Brand */
.ej-nav__brand{display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none}
.ej-logo{
  height:36px; width:36px; border-radius:12px;
  display:grid; place-items:center; font-weight:800; color:#fff;
  background:linear-gradient(135deg,var(--brandFrom),var(--brandTo));
  box-shadow: var(--shadow);
}
.ej-nav__brand b{font-size:18px}

/* Primary nav */
.ej-nav__primary{ display:flex; align-items:center; gap:14px; margin-left:12px; }
.ej-nav__primary a{ padding:8px 10px; border-radius:10px; font-weight:500; }
.ej-nav__primary a:hover{ background:#f5f7fb; }

/* Actions rail */
.ej-nav__rail{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.ej-start{ white-space:nowrap; }

/* Icon button */
.ej-iconbtn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:999px;
  background:#fff; border:1px solid var(--line);
  color:#0f172a; cursor:pointer;
}
.ej-iconbtn:hover{ box-shadow: 0 2px 8px rgba(2,95,188,.12); }

/* Avatar (gradient full circle, FB-style fallback) */
.ej-avatar-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:999px;
  background: linear-gradient(135deg, var(--brandFrom), var(--brandTo));
  border:0; overflow:hidden; cursor:pointer; box-shadow: 0 2px 8px rgba(2,95,188,.12);
}
.ej-avatar-btn img{ display:none; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.ej-avatar-btn #avatarFallback{ display:inline-flex; align-items:center; justify-content:center; width:100%; height:100%; }
.ej-avatar-btn #avatarFallback .fb-silhouette{ width:65%; height:65%; fill:#fff; }

/* Dropdown */
.ej-account{ position:relative; }
.ej-account__menu{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:160px; background:#fff; border:1px solid rgba(15,23,42,.12);
  border-radius:12px; box-shadow:0 12px 28px rgba(15,23,42,.12);
  padding:6px; display:none; z-index:70;
}
.ej-account.open .ej-account__menu{ display:block; }
.ej-account__menu button, .ej-account__menu a{
  width:100%; text-align:left; background:transparent; border:0;
  padding:8px 10px; border-radius:8px; font-size:14px; color:#0f172a; cursor:pointer;
}
.ej-account__menu button:hover, .ej-account__menu a:hover{ background:#f1f5f9; }

/* Floating search panel */
.ej-nav__search{ position:relative; }
.ej-nav__search[hidden]{ display:none; }
.ej-nav__search-form{
  position:absolute; right:0; top:-8px;
  display:flex; gap:8px; align-items:center;
  background:#fff; border:1px solid #e9eef6; border-radius:12px;
  padding:8px; box-shadow: 0 18px 48px rgba(2,95,188,.18);
}
.ej-nav__search-form input{
  border:0; outline:0; background:transparent; font:inherit; color:var(--ink);
  min-width:220px;
}

/* Mobile */
.ej-burger{
  display:none; margin-left:6px;
  width:36px; height:36px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:pointer;
  align-items:center; justify-content:center; gap:3px; flex-direction:column;
}
.ej-burger span{ display:block; width:18px; height:2px; background:#0f172a; border-radius:999px; }

/* Mobile slide panel */
.ej-mobile{
  display:block;
  background:#fff; border-top:1px solid #eef2f6;
  box-shadow:0 10px 24px rgba(2,95,188,.08);
}
.ej-mobile[hidden]{ display:none; }
.ej-mobile__nav{ display:grid; gap:6px; padding:12px 24px; }
.ej-mobile__nav a{ padding:10px 12px; border-radius:10px; font-weight:600; }
.ej-mobile__nav a:hover{ background:#f5f7fb; }
.ej-mobile__actions{ padding:12px 24px 18px; display:flex; flex-wrap:wrap; gap:10px; }

/* Responsive */
@media (max-width: 1040px){
  .ej-nav__primary{ display:none; }
  .ej-burger{ display:inline-flex; }
  .ej-nav__search-form{ right:54px; }
}

/* Pin & shadow states for ej-nav */
.ej-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; }
.ej-nav.has-shadow { box-shadow: 0 10px 24px rgba(2,95,188,.08); }
.ej-nav.is-hidden  { transform: translateY(-100%); transition: transform .28s ease, box-shadow .2s ease; }

/* Rail spacer pushes CTA to far right */
.ej-rail__spacer { flex: 1 1 auto; }

/* Ensure search panel floats above content and is clickable */
.ej-nav__search { position: relative; z-index: 70; }
.ej-nav__search-form { position: absolute; right: 0; top: -8px; }

/* Header spacer: JS will set the height precisely; keep a safe fallback */
.header-spacer { height: 72px; }

/* === Avatar gradient + fallback + dropdown (keep two-row header) === */
.site-header .avatar-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:9999px; border:0;
  background: linear-gradient(135deg, var(--brandFrom), var(--brandTo));
  overflow:hidden; cursor:pointer; box-shadow:0 2px 8px rgba(2,95,188,.12);
}
.site-header .avatar-btn img{
  display:none; width:100%; height:100%; object-fit:cover; border-radius:inherit;
}
.site-header #avatarFallback{
  display:inline-flex; align-items:center; justify-content:center;
  width:100%; height:100%;
}
.site-header #avatarFallback .fb-silhouette{
  width:65%; height:65%; fill:#fff;
}
.site-header .account{ position:relative; }
.site-header .account-menu{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:160px; background:#fff; border:1px solid rgba(15,23,42,.12);
  border-radius:12px; box-shadow:0 12px 28px rgba(15,23,42,.12);
  padding:6px; display:none;
}
.site-header .account.open .account-menu{ display:block; }
.site-header .account-menu button,
.site-header .account-menu a{
  width:100%; text-align:left; background:transparent; border:0;
  padding:8px 10px; border-radius:8px; font-size:14px; color:#0f172a; cursor:pointer;
}
.site-header .account-menu button:hover,
.site-header .account-menu a:hover{ background:#f1f5f9; }

/* ==== FIX: make fixed header topmost & clickable ==== */
.site-header{
  z-index: 1000;          /* higher than any hero bits */
  pointer-events: auto;   /* ensure it receives clicks */
}

/* The spacer should never intercept clicks */
.header-spacer{
  pointer-events: none;
}

/* Row 2 and controls sit above nav underlines/pseudos */
.site-header .row-2{
  position: relative;
  z-index: 2;
}

/* Ensure the search is always clickable (above any nav ::after lines) */
.site-header .search{
  position: relative;
  z-index: 3;
}

/* Keep account dropdown above everything */
.site-header .account-menu{
  z-index: 2000;
}

/* Make sure the CTA can’t shrink away or wrap oddly */
.site-header .btn.cta{
  display: inline-flex;
  flex: 0 0 auto;
}

/* Ensure nav underlines never steal clicks */
.site-header .nav a::after { pointer-events: none; }

/* Guarantee the search is clickable above everything else in row-2 */
.site-header .row-2 { position: relative; z-index: 1; }
.site-header .search { position: relative; z-index: 2; pointer-events: auto; }
.site-header .search * { pointer-events: auto; }

/* Keep the CTA present and non-collapsing */
.site-header .btn.cta { flex: 0 0 auto; }

/* Search icon via CSS (no inline <svg> to confuse the parser) */
.search .search-ico{
  flex:0 0 18px; width:18px; height:18px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  /* magnifying glass */
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='currentColor' stroke-width='1.6'/><path d='M21 21l-4-4' stroke='currentColor' stroke-width='1.6' stroke-linecap='round'/></svg>");
}

/* Auth modal (global) */
#authPrompt::backdrop{ background: rgba(15,23,42,.45); }
#authPrompt{
  border:0; padding:0; width:min(420px,92vw); border-radius:16px;
  box-shadow: var(--shadow); background:transparent;
}
.auth-modal{ background:#fff; border-radius:16px; padding:16px; }
.auth-modal .hd{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.auth-modal .hd h3{ margin:0; font-size:18px; letter-spacing:-.01em; }
.auth-modal .bd{ margin-top:8px; color:var(--muted); }
.auth-modal .ft{ margin-top:14px; display:grid; gap:8px; }
.auth-modal .btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:44px; border-radius:12px; border:1px solid var(--ring);
  background:#fff; font-weight:600; text-decoration:none;
}
.auth-modal .btn.primary{
  background: linear-gradient(90deg, var(--brandFrom,#025fbc), var(--brandTo,#06a2dd));
  color:#fff; border:0;
}
.auth-modal .x{ background:none; border:0; cursor:pointer; padding:6px; border-radius:8px; }
.auth-modal .x svg{ width:18px; height:18px; }

/* Toasts (global) */
#toastHost{
  position:fixed; right:16px; bottom:16px; z-index:9999;
  display:grid; gap:10px; width:min(92vw, 360px);
  pointer-events:none;
}
.toast{
  pointer-events:auto;
  display:grid; grid-template-columns: 4px 1fr auto; gap:10px; align-items:start;
  background:#fff; border:1px solid var(--ring); border-radius:14px; box-shadow: var(--shadow);
  padding:12px;
}
.toast .bar{ border-radius:10px; background:linear-gradient(180deg, var(--brandFrom,#025fbc), var(--brandTo,#06a2dd)); }
.toast .title{ font-weight:600; margin-bottom:2px; }
.toast .msg{ color:var(--muted); line-height:1.3; }
.toast .close, .toast .action{
  background:none; border:0; cursor:pointer; padding:6px 8px; border-radius:8px; font-weight:600;
}
.toast .close{ font-size:16px; line-height:1; }
.toast.t-success{ border-color:#10b98133; }
.toast.t-error{ border-color:#ef444433; }
.toast.t-info{ border-color:#3b82f633; }

@media (prefers-reduced-motion: no-preference){
  #toastHost .toast{ opacity:0; transform:translateY(8px); transition:opacity .2s ease, transform .2s ease; }
  #toastHost .toast.show{ opacity:1; transform:translateY(0); }
  #toastHost .toast.hide{ opacity:0; transform:translateY(8px); }
}
@media (max-width:600px){
  #toastHost{ right:50%; transform:translateX(50%); bottom:12px; }
}

/* SR-only live region for announcements */
#toastSR{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

/* Forgot-password modal (share look with auth modal) */
#forgotPrompt::backdrop { background: rgba(15,23,42,.45); }
#forgotPrompt{
  border:0; padding:0; width:min(420px,92vw); border-radius:16px;
  box-shadow: var(--shadow); background:transparent;
}

/* --- A11y helpers --- */
.sr-only {
  position:absolute !important; width:1px; height:1px; margin:-1px;
  padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* Keyboard-only focus rings:
   We only show outlines after the user presses Tab at least once (root gets .kbd).
   Before that (mouse/touch or first paint), no outlines = no blue line flash. */
.kbd :focus-visible {
  outline: 2px solid #1e90ff;
  outline-offset: 2px;
  border-radius: 6px;
}
:not(.kbd) :focus-visible {
  outline: none !important;
}


/* Skip link */
.skip-link {
  position:absolute; left:8px; top:-40px; z-index:9999;
  background:#0b5fff; color:#fff; padding:8px 12px; border-radius:10px;
  text-decoration:none; box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.skip-link:focus { top:8px; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.field-error{
  color:#b91c1c;               /* red-600 */
  font-size:.875rem;
  margin:.25rem 0 0;
}
[aria-invalid="true"]{
  outline:2px solid #b91c1c;
  outline-offset:2px;
}

/* === Toast (global) === */
#ej-toast-stack{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  display: grid;
  gap: 8px;
}
.ej-toast{
  background: #0f172a; /* navy */
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.ej-toast.show{
  opacity: 1;
  transform: translateY(0);
}

/* ==== Everjoy Header: pin + search clickability (clean reset) ==== */

/* Keep header pinned and above content (works with your pin JS) */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 3000;
  background: #fff;
  transition: transform .22s ease, box-shadow .18s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.has-shadow { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* Stack rows predictably so row-2 (search) is on top */
.site-header .row-1,
.site-header .row-2 { position: relative; }

/* Spacer below a fixed header; JS overwrites --header-h exactly */
.header-spacer{
  height: var(--header-h, 92px);
  position: sticky;
  top: 0;
  z-index: 0; /* stays behind the header */
  background: linear-gradient(135deg, var(--brandFrom,#025fbc) 0%, var(--brandTo,#06a2dd) 100%);
  pointer-events: none; /* header gets the clicks */
}


/* Search sizing + clickability */
.site-header .row-2 .site-search{
  position: relative;
  z-index: 10;                 /* float above neighbors */
  width: clamp(280px, 34vw, 520px);
  pointer-events: auto;
}
.site-header .row-2 .site-search .filter-search{ position: relative; }
.site-header .row-2 .site-search .filter-search input{
  width: 100% !important;      /* override any legacy input rules */
  padding: 10px 12px 10px 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: #f8fafc;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.site-header .row-2 .site-search .filter-search input:focus{
  border-color: #025fbc;
  box-shadow: 0 0 0 3px rgba(2,95,188,0.12);
}
.site-header .row-2 .site-search .filter-search svg{ left: 12px; }

/* A11y: subtle focus ring for keyboard users (no blue outline) */
.heart-btn { outline: none; }
.heart-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(2,95,188,.18); }


/* --- Account dropdown must sit over CTA --- */
.site-header .row-2 { overflow: visible; }           /* allow menus to overflow */
.site-header .account { position: relative; z-index: 5001; }
.site-header .account-menu { position: absolute; z-index: 9000; }


/* --- Auth-required modal --- */
#authOverlay{
  position: fixed; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(15,23,42,.45); z-index: 5000;
}
#authOverlay.show{ display: flex; }
#authModal{
  background:#fff; border:1px solid #e6e9ef; border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.20);
  width:min(92vw,420px); padding:20px; font-family:'Poppins',sans-serif;
}
#authModal h3{ margin:0 0 8px; font-size:18px; color:#0f172a; }
#authModal p{ margin:0 0 16px; font-size:14px; color:#334155; }
#authModal .actions{ display:flex; gap:10px; justify-content:flex-end; }
#authModal .btn-primary, #authModal .btn-ghost{
  padding:9px 12px; border-radius:10px; font-size:13.5px;
}
#authModal .btn-primary{ background:#0f172a; border:1px solid #0f172a; color:#fff; }
#authModal .btn-ghost{ background:#fff; border:1px solid #e2e8f0; color:#0f172a; }

/* =========================================================
   Header Search — universal (works in row-1 or row-2)
   Paste at the very bottom of global.css
========================================================= */
.site-header .site-search{
  position: relative;
  z-index: 12;                 /* keep above nav underlines */
  flex: 0 1 clamp(260px, 34vw, 520px);
  width: clamp(260px, 34vw, 520px);
  pointer-events: auto;
}

/* input wrapper */
.site-header .site-search .filter-search{ position: relative; }

/* CSS-only magnifier icon */
.site-header .site-search .filter-search::before{
  content:"";
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:18px; height:18px;
  background-repeat:no-repeat; background-position:center; background-size:contain;
  opacity:.65;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='%2394a3b8' stroke-width='1.8'/><path d='M21 21l-4-4' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round'/></svg>");
}

/* input itself */
.site-header .site-search input[type="search"]{
  width:100% !important;
  box-sizing:border-box;
  padding:10px 12px 10px 36px;   /* room for icon */
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#fff;               /* slightly brighter than filters */
  font-family:'Poppins',sans-serif;
  font-size:14px; font-weight:500; color:#0f172a;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.site-header .site-search input[type="search"]:focus{
  border-color:#025fbc;
  box-shadow:0 0 0 3px rgba(2,95,188,.12);
}

/* suggestions dropdown */
.site-search-list{
  position:absolute; inset-inline:0; top:calc(100% + 6px);
  z-index: 4000;
  list-style:none; margin:0; padding:6px;
  background:#fff; border:1px solid #e6e9ef; border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}
.site-search-list li{
  padding:8px 10px; border-radius:8px; cursor:pointer;
  font-size:14px; color:#0f172a; display:flex; justify-content:space-between; gap:12px;
}
.site-search-list li .meta{ color:#64748b; font-size:12px; }
.site-search-list li[aria-selected="true"], .site-search-list li:hover{ background:#f8fafc; }

/* small screens: give the search a bit more room and avoid crowding */
@media (max-width: 720px){
  .site-header .site-search{
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

/* ===== Search: compact + right-aligned ===== */
.site-header .row-1 .site-search,
.site-header .row-2 .site-search{
  margin-left: auto;                 /* push it to the right */
  flex: 0 0 240px !important;        /* smaller, fixed-ish width */
  width: 240px !important;
}

/* slightly tighter input */
.site-header .site-search input[type="search"]{
  padding: 8px 10px 8px 34px;        /* a bit shorter height */
  border-radius: 8px;
}

/* keep suggestions panel sized to the compact field */
.site-search-list{ max-width: 240px; }

/* ===== Account dropdown: modern glass card ===== */
.site-header .account { position: relative; z-index: 5001; }
.site-header .account-menu{
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 280px; max-width: min(92vw, 320px);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px) saturate(1.05);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(2,95,188,.16), 0 6px 18px rgba(15,23,42,.10);
  padding: 8px;
  display: none;  /* shown when parent gets .open */
  z-index: 9000;
}

/* tiny arrow/caret */
.site-header .account-menu::before{
  content:"";
  position:absolute; right: 18px; top: -6px;
  width: 12px; height: 12px; transform: rotate(45deg);
  background: inherit;
  border-left: 1px solid rgba(15,23,42,.10);
  border-top: 1px solid rgba(15,23,42,.10);
  backdrop-filter: inherit;
}

/* show when open */
.site-header .account.open .account-menu{ display: block; }

/* menu items = full-width, comfy, modern */
.site-header .account-menu a,
.site-header .account-menu button{
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent; border: 0;
  font: 600 14px 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: #0f172a; cursor: pointer;
  transition: background .15s ease, transform .08s ease, color .15s ease;
  text-align: left;
}
.site-header .account-menu a:hover,
.site-header .account-menu button:hover{
  background: #f8fafc;
}
.site-header .account-menu a:active,
.site-header .account-menu button:active{
  transform: translateY(1px);
}

/* focus-visible ring for keyboard users */
.site-header .account-menu a:focus-visible,
.site-header .account-menu button:focus-visible{
  outline: 2px solid #1e90ff;
  outline-offset: 2px;
}

/* subtle separators using box-shadow (no extra markup needed) */
.site-header .account-menu a + *,
.site-header .account-menu button + *{
  box-shadow: 0 -1px 0 rgba(15,23,42,.06) inset;
}

/* “Logout” as a danger action */
.site-header #logoutBtn{
  color: #b91c1c;  /* red-600 */
}
.site-header #logoutBtn:hover{
  background: #fef2f2;  /* red-50 */
}

/* optional icons via CSS only (no markup changes) */
.site-header .account-menu a[href*="account"]::before{
  content:"";
  flex: 0 0 18px; height: 18px;
  background: center/contain no-repeat
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
  margin-right: 2px;
}
.site-header #logoutBtn::before{
  content:"";
  flex: 0 0 18px; height: 18px;
  background: center/contain no-repeat
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>");
  margin-right: 2px;
}

/* make sure header allows the menu to overflow visually */
.site-header .row-1, .site-header .row-2 { overflow: visible; }

/* 1) Remove the icon from the “Account” item in the dropdown */
.site-header .account-menu a[href="/account.html"] {
  background-image: none !important;
}
.site-header .account-menu a[href="/account.html"]::before,
.site-header .account-menu a[href="/account.html"]::after {
  content: none !important;
  display: none !important;
}

/* 2) Keep nav links inside the container (wrap neatly on smaller widths) */
.site-header .row-2{
  display:flex; align-items:center; gap:10px;
  flex-wrap: wrap;                 /* allow a second line if needed */
}
.site-header .nav{
  display:flex; align-items:center;
  gap:10px; flex-wrap: wrap;       /* nav itself can wrap */
  flex:1 1 auto; min-width:0;      /* let nav shrink before overflowing */
  max-width:100%;
}
.site-header .nav a{
  white-space:nowrap;
  padding:8px 10px;
}

/* Make the two buttons “fixed width” so nav gets first dibs on space */
.site-header #partnerCta,
.site-header .btn.cta{
  flex:0 0 auto;
}

/* Slightly tighter nav on narrower viewports */
@media (max-width: 1100px){
  .site-header .nav a{ padding:6px 8px; font-size:14px; }
  .site-header .row-2 .btn{ padding:8px 12px; }
}

/* Keep nav links inside the container (no HTML changes) */
.site-header .row-2{
  display: grid;
  grid-template-columns: 1fr auto auto; /* nav grows, CTAs stay auto */
  align-items: center;
  gap: 10px;
}
.site-header .row-2 .spacer{ display:none; }       /* spacer not needed in grid */

.site-header .nav{
  display: flex;
  flex-wrap: wrap;       /* allow a second line when tight */
  gap: 10px;
  min-width: 0;          /* allow shrinking inside the grid column */
  max-width: 100%;
}
.site-header .nav a{
  white-space: nowrap;
  padding: 6px 10px;     /* slightly tighter so “Inspiration” fits */
}

/* Slightly smaller CTAs so nav gets priority */
.site-header #partnerCta,
.site-header .btn.cta{
  flex: 0 0 auto;        /* don’t grow */
}

/* Keep the account dropdown from hanging off the right edge */
.site-header .account-menu{
  right: 0; left: auto;                      /* anchor to the right */
  max-width: min(320px, calc(100vw - 48px)); /* stay inside viewport/margins */
  overflow: clip;
}

/* (Already done earlier) remove any icon from Account item */
.site-header .account-menu a[href="/account.html"],
.site-header .account-menu a[href="/account.html"]::before,
.site-header .account-menu a[href="/account.html"]::after{
  background-image: none !important;
  content: none !important;
}

/* =========================
   Admin Shell (Dashboard)
   ========================= */

.admin-shell{
  --aside-w: 240px;
  display: grid;
  grid-template-columns: var(--aside-w) 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 10px auto 40px;
  padding-top: 80px;
  padding-bottom: 50px;
}

.admin-aside{
  position: sticky;
  top: calc(var(--header-h, 72px) + 12px);
  align-self: start;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  padding: 14px;
  height: fit-content;
}

.admin-brand{
  display:flex; align-items:center; gap:10px; margin-bottom:10px;
  text-decoration:none; color: inherit;
}
.admin-brand .logo{
  width:32px; height:32px; border-radius:10px; color:#fff;
  display:grid; place-items:center; font-weight:800;
  background: linear-gradient(135deg, var(--brandFrom), var(--brandTo));
}
.admin-brand b{ font-size:14px; }

.admin-nav{ display:grid; gap:6px; margin:10px 0; }
.admin-nav a{
  display:block; padding:10px 12px; border-radius:10px; font-weight:600; color:#0f172a;
}
.admin-nav a:hover{ background:#f5f7fb; }
.admin-nav a.is-active{
  background:#0f172a; color:#fff;
}

.admin-help{ margin-top:12px; padding:10px; background:#f8fafc; border:1px solid #e6e9ef; border-radius:10px; }
.admin-email{ font-weight:600; font-size:13px; }

.admin-main{ min-width:0; }

.admin-topbar{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:6px 0 10px;
}
.admin-topbar h1{ margin:0; font-size:22px; letter-spacing:-.01em; }
.admin-topbar .muted{ margin-top:2px; font-size:13px; }

.admin-actions{ display:flex; gap:10px; }
.btn.ghost{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px; border-radius:10px;
  background:#fff; border:1px solid #e2e8f0; color:#0f172a; font-weight:600;
}
.btn.primary{ background:#0f172a; border-color:#0f172a; color:#fff; }

.admin-kpis{
  display:grid; gap:14px; grid-template-columns: repeat(4, minmax(0,1fr));
  margin-bottom: 14px;
}
@media (max-width: 960px){ .admin-kpis{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px){ .admin-kpis{ grid-template-columns: 1fr; } }

.kpi{
  background:#fff; border:1px solid #e6e9ef; border-radius:14px; box-shadow:0 1px 2px rgba(0,0,0,.04);
  padding:14px;
}
.kpi-head{ display:flex; align-items:center; justify-content:space-between; color:#475569; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.kpi-num{ font-size:28px; font-weight:800; margin-top:6px; }
.kpi-sub{ color:#64748b; font-size:12px; margin-top:2px; }

.admin-grid{
  display:grid; grid-template-columns: 1fr 340px; gap: 14px;
}
@media (max-width: 1040px){ .admin-grid{ grid-template-columns: 1fr; } }

.table-wrap{ overflow:auto; }
.table{
  width:100%; border-collapse: collapse; font-size:14px;
}
.table th, .table td{
  padding:10px 8px; text-align:left; border-bottom:1px solid #eef2f6;
}
.table th{ color:#475569; font-size:12px; letter-spacing:.06em; text-transform:uppercase; }

.glance{ display:grid; gap:12px; }
.glance-row{ display:grid; gap:6px; }
.glance-label{ font-size:13px; font-weight:600; color:#0f172a; }
.glance-bar{
  height:8px; border-radius:999px; background:#eef2f7; overflow:hidden; position:relative;
}
.glance-bar span{
  display:block; height:100%; background:linear-gradient(90deg, var(--brandFrom), var(--brandTo));
}

/* keep footer away from sticky aside on small screens */
@media (max-width: 840px){ .admin-shell{ grid-template-columns: 1fr; } .admin-aside{ position:relative; top:0; } }

/* Safety: dropdown should be click-able and above other overlays */
.site-header .account-menu { z-index: 9999; pointer-events: auto; }
.site-header .account { position: relative; z-index: 9999; }

  /* Spacer and any accidental overlays should never capture clicks */
  .header-spacer { pointer-events: none !important; z-index: 0 !important; }

/* ==== FIX 1: Make the header truly fixed and topmost (no sticky override) ==== */
#siteHeader,
.site-header{
  position: fixed !important; /* beats earlier 'sticky' */
  top: 0; left: 0; right: 0;
  z-index: 5000 !important;
}

/* Keep the dropdown safely above everything */
#accountMenu{ position: relative; z-index: 5010 !important; }
#accountDropdown,
.site-header .account-menu{ z-index: 5020 !important; pointer-events: auto !important; }

/* Spacer must never catch clicks */
.header-spacer{ pointer-events: none !important; }

/* ==== FIX 2: Hidden things should be gone (prevents ghost overlays) ==== */
[hidden]{ display: none !important; }
.site-search-list[hidden]{ display: none !important; } /* belt + suspenders */

/* if your header rows/wraps had overflow hidden, let the menu escape */
.site-header .wrap { overflow: visible; }
/* Dropdown is always above neighbors and clickable */
#siteHeader { position: fixed; z-index: 2147483000; }
.site-header .wrap,
.site-header .row-1,
.site-header .row-2 { overflow: visible; }
#accountMenu { position: relative; }
#accountDropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 2147483001; pointer-events: auto; }
/* Nav underline pseudos never intercept pointer */

/* Keep the partner CTA visible unless JS hides it on purpose */
#partnerCta {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap;
}

#mainContent:focus:not(:focus-visible) { outline: 0; }

/* Only show a main outline for keyboard users (after Tab) */
.kbd #mainContent:focus-visible {
  outline: 2px solid var(--focus-ring, #2563eb);
  outline-offset: 4px;
}
/* Never show it during boot or for mouse/touch */
.booting #mainContent,
:not(.kbd) #mainContent:focus-visible {
  outline: none !important;
}

/* Safety: ensure header spacer doesn't render a top/bottom line */
.header-spacer {
  border: 0;
  box-shadow: none;
  background: linear-gradient(135deg, var(--brandFrom,#025fbc) 0%, var(--brandTo,#06a2dd) 100%);
}

/* A11y-friendly focus: hide outlines when focus is set programmatically, keep them for keyboard users */
:focus:not(:focus-visible) {
  outline: none !important;
}

/* Header: don’t show outline unless keyboard navigates */
#siteHeader a:focus:not(:focus-visible),
#siteHeader button:focus:not(:focus-visible) {
  outline: none;
}

/* Keep a clean visual line under the header (no unintended borders) */
#siteHeader,
.site-header,
.header-spacer {
  border: 0;
  box-shadow: none;
  background-clip: padding-box; /* avoid subpixel paint lines on some browsers */
}

.booting .site-header .nav a::after { display: none !important; }

/* --- Global FOUC guard (centralized) --- */
/* Hide mounts + main while booting to prevent unstyled flash */
.booting #siteHeaderMount,
.booting #siteFooterMount,
.booting main,
.booting section { visibility: hidden; }

/* Reserve header space during boot (no DOM spacer needed) */
.booting body { padding-top: var(--header-h, 88px); }

/* Safety: when boot is over, reveal everything */
html:not(.booting) #siteHeaderMount,
html:not(.booting) #siteFooterMount,
html:not(.booting) main,
html:not(.booting) section { visibility: visible; }

/* ===== Centered Saved Toast (modal-ish card, no backdrop) ===== */
#ejCenterToastHost{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(92vw, 420px);
  pointer-events: none; /* only the card receives clicks */
}
.ej-center-toast{
  pointer-events: auto;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  box-shadow: var(--shadow-strong, 0 14px 40px rgba(15,23,42,.18), 0 6px 18px rgba(2,95,188,.12));
  padding: 16px;
  opacity: 0;
  transform: scale(.96) translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  will-change: opacity, transform;
}
.ej-center-toast.show{ opacity: 1; transform: scale(1) translateY(0); }

.ej-center-toast .hd{ font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.ej-center-toast .bd{ color: #cbd5e1; font-size: 14px; margin-bottom: 10px; }
.ej-center-toast .ft{ display: flex; gap: 8px; justify-content: flex-end; }

.ej-center-toast .btn{
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}
.ej-center-toast .btn.primary{ background: #fff; color: #0f172a; }
.ej-center-toast .btn.ghost{ background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }

/* ---------- Auth modal (global) ---------- */
#ejAuthModal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:9999; }
#ejAuthModal[open]{ display:flex; }
#ejAuthModal .backdrop{ position:absolute; inset:0; background:rgba(2,16,32,.45); backdrop-filter:blur(2px); }
#ejAuthModal .panel{
  position:relative; z-index:1; width:min(480px, calc(100% - 32px));
  background:#fff; border:1px solid #e5e7eb; border-radius:16px; padding:20px 20px 16px;
  box-shadow:0 24px 72px rgba(2,34,62,.25);
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#ejAuthModal .panel h3{ margin:0 0 6px; font-weight:800; font-size:1.15rem; letter-spacing:-.015em; }
#ejAuthModal .panel p{ margin:0 0 16px; color:#475569; }
#ejAuthModal .actions{ display:flex; gap:12px; justify-content:flex-end; }
#ejAuthModal .btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:42px; padding:0 16px; border-radius:10px; font-weight:700; text-decoration:none;
}
#ejAuthModal .btn-primary{ background:#0b1220; color:#fff; border:0; }
#ejAuthModal .btn-ghost{ background:#fff; color:#0f172a; border:1px solid #e5e7eb; }
#ejAuthModal .close-x{
  position:absolute; top:10px; right:10px; width:32px; height:32px; border-radius:8px;
  border:1px solid #e5e7eb; background:#fff; color:#0f172a; font-size:18px; line-height:1;
  display:grid; place-items:center; cursor:pointer;
}
#ejAuthModal .close-x:focus-visible{ outline:2px solid #025fbc55; outline-offset:2px; }


/* Header integration for gradient navbar + global.js hooks */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 10020; }
.site-header.is-hidden { transform: translateY(calc(-1 * var(--header-h, 88px))); transition: transform .18s ease; }
.site-header.has-shadow { box-shadow: 0 6px 18px rgba(2,6,23,.12); }

/* Icons + account dropdown on dark header */
.icon-btn { background: transparent; border: 0; padding: 8px; border-radius: 12px; color: #fff; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn .icon { font-size: 16px; }

/* Avatar + dropdown */
.account { position: relative; }
.avatar-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.15); color: #fff;
}
#avatarImg { display: none; width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { font-weight: 600; }

.account-dropdown {
  position: absolute; top: 44px; right: 0; min-width: 220px;
  background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 14px;
  padding: 6px; box-shadow: 0 10px 30px rgba(2,6,23,.12); z-index: 10030;
}
.account-dropdown a { display:block; padding:10px 12px; border-radius:10px; color:#0f172a; text-decoration:none; }
.account-dropdown a:hover { background:#f8fafc; }

/* Search panel (slides under header) */
.site-search { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid rgba(15,23,42,.06); }
.site-search .search-inner {
  max-width: 1350px; margin: 0 auto; padding: 10px 24px; display: flex; gap: 8px; align-items: center;
}
#siteSearchInput { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1px solid #e2e8f0; outline: none; }
.site-search .search-close { border: 0; background: #f1f5f9; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.search-list { max-width: 1350px; margin: 0 auto; padding: 8px 24px 14px; list-style: none; }
.search-list li { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.search-list li:hover { background: #f8fafc; }
.search-list .meta { color: #64748b; }

/* Keep your button palette consistent on dark header row-2 button */
.btn.cta.btn-primary-dark { background-color: var(--ink); color: #fff; }
.btn.cta.btn-primary-dark:hover { background-color: #333; }

/* ==== Everjoy Minimal Header (scoped to .navbar) ==== */
:root{
  /* Fallbacks in case these tokens aren't defined yet */
  --brandFrom: #025fbc;
  --brandTo:   #06a2dd;
  --primary-gradient: linear-gradient(90deg, var(--brandFrom), var(--brandTo));
}

.navbar{
  background: var(--primary-gradient);
  color:#fff;
  position: sticky;
  padding: 10px clamp(12px, 4vw, 20px); /* LR gutter on all widths */
  top:0;
  z-index:1000;
  box-shadow:0 4px 12px rgba(0,0,0,.05);
}
.navbar{ box-sizing: border-box; }

.navbar .nav-container{
  max-width:1350px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  min-width:0;                 /* critical so children can shrink */
}

.navbar .nav-logo{
  font-weight:700;
  font-size:1.7rem;                  /* larger wordmark */
  color:#fff;
  text-decoration:none;
  white-space:nowrap;
  flex: 1 1 auto;
  min-width:0;
  max-width: calc(100% - 136px);      /* room for two bigger icons + gaps */
  overflow:hidden;
  text-overflow:ellipsis;
}

/* === Compact mobile header (fix: icons clipped) === */
@media (max-width: 560px){
  /* tighter padding + safe-area support */
  .navbar{
    padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  }
  .navbar .nav-container{ gap: 10px; min-width: 0; }
  .navbar .nav-logo{
    font-size: 1.25rem;
    min-width: 0;
    max-width: calc(100% - 92px); /* ~ two 36px icons + gaps */
    overflow: hidden;
    text-overflow: ellipsis;
  }


  /* smaller icon buttons */
  #menuBtn, #avatarBtn{
    width: 32px; height: 32px; border-radius: 10px;
  }
  #menuBtn svg{ width: 18px; height: 18px; }
  #accountMenu #avatarFallback svg{ width: 18px; height: 18px; }

  /* hide big pills so only icons show on mobile */
  #partnerCta, #planEventCta, #linkLogin{ display: none !important; }

  /* smaller fallback spacer height */
  .header-spacer{ height: 56px; }
}

.navbar .nav-links{
  display:flex;
  gap:24px;
  align-items:center;
}
/* --- Mobile header controls (simple: logo left, icons right) --- */
#menuBtn{ display:none; }                         /* hidden on desktop */
.navbar .nav-container{ position: relative; }     /* anchor for dropdown */

/* Hide inline nav on small screens; show hamburger */
@media (max-width: 960px){
  .navbar .nav-links{ display:none !important; }  /* hide inline nav */
  #menuBtn{ display:inline-flex !important; }     /* show hamburger */
  .navbar .nav-actions{ min-width: unset; gap: 8px; }
}
/* Tighter header layout on mid-width desktops
   (prevents nav links from scrambling between ~960–1165px) */
@media (min-width: 960px) and (max-width: 1165px){
  #siteHeader.navbar .nav-container{
    gap: 12px;
  }

  #siteHeader.navbar .nav-links{
    gap: 14px;                   /* smaller gap between nav items */
  }

  #siteHeader.navbar .nav-links a{
    padding: 6px 8px;            /* slightly tighter pills */
    font-size: 0.9rem;           /* tiny font shrink for “Inspiration” */
  }

  #siteHeader.navbar .nav-actions .btn{
    padding: 7px 12px;           /* slimmer CTAs so nav has more room */
    font-size: 0.9rem;
  }
}
/* Extra-compact header just above mobile (960–1040px)
   Keeps nav + CTAs on a single tidy row */
@media (min-width: 960px) and (max-width: 1040px){
  #siteHeader.navbar{
    padding-inline: 10px;                 /* tighter side padding */
  }

  #siteHeader.navbar .nav-container{
    gap: 10px;                            /* less space between logo/nav/actions */
  }

  #siteHeader.navbar .nav-logo{
    font-size: 1.4rem;                    /* slightly smaller wordmark */
  }

  #siteHeader.navbar .nav-links{
    gap: 10px;                            /* tighten space between links */
  }
  #siteHeader.navbar .nav-links a{
    padding: 4px 6px;
    font-size: 0.9rem;                    /* tiny step down in size */
  }

  #siteHeader.navbar .nav-actions{
    gap: 6px;
  }
  #siteHeader.navbar .nav-actions .btn{
    padding: 6px 10px;                    /* slimmer pills */
    font-size: 0.85rem;
  }
}

/* Keep the dropdown fully inside the viewport on all widths */
.mobile-menu{
  right: 12px;
  left: auto;
  max-width: calc(100vw - 16px);
  width: min(92vw, 260px);
}

@media (max-width:560px){
  .mobile-menu{ right: max(12px, env(safe-area-inset-right)); }
}


.mobile-menu[hidden]{ display:none !important; }
.mobile-menu .mobile-nav{ display:grid; gap:6px; }
.mobile-menu .mobile-nav a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  font-weight:600;
  text-decoration:none;
  color:#0f172a;
}
.mobile-menu .mobile-nav a:hover{ background:#f8fafc; }

/* Make the hamburger icon visually consistent with your icon buttons */
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px; height:44px;            /* bigger icons */
  border-radius:12px;
  border:1px solid rgba(255,255,255,.35);
  background: transparent;
  color:#fff;
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.icon-btn:hover{
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 28px rgba(2,95,188,.18);
  border-color: rgba(255,255,255,.65);
}

.navbar .nav-links a{
  text-decoration:none;
  color:rgb(255, 255, 255);
  font-weight:600;
  font-size:.95rem;
  transition:color .15s ease;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.is-active,
.navbar .nav-links a[aria-current="page"]{
  color:#fff;
}

.navbar .nav-actions{
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  flex: 0 0 auto;              /* do not grow */
  min-width: 0;
}

/* === Fit-all-widths header (prevents right-edge clipping) === */
.navbar .nav-container{ min-width:0; }
.navbar .nav-logo{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.navbar .nav-actions{ flex:0 0 auto; gap:8px; }

/* Kill old forced width on mobile if it exists anywhere */
@media (max-width: 960px){
  .navbar .nav-actions{ min-width:unset !important; }
}
/* === Ultra-compact mobile header === */
@media (max-width: 560px){
  /* give a guaranteed inner gutter so icons never touch screen edge */
  .navbar{ padding:12px max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left)); }
  .navbar .nav-logo{ font-size:1.30rem; }
  #menuBtn, #avatarBtn{ width:36px; height:36px; border-radius:10px; }
  #menuBtn svg{ width:20px; height:20px; }
  #accountMenu #avatarFallback svg{ width:20px; height:20px; }
  .header-spacer{ height:64px; }

  /* remove hover lift on touch so scale can't push out of bounds */
  @media (hover:none){
    #menuBtn:hover, #avatarBtn:hover{ transform:none; box-shadow:none; }
  }

  /* tighter spacer under fixed header if you use it */
  .header-spacer{ height:54px; }
}

/* Extra-tight for very narrow phones */
@media (max-width: 380px){
  .navbar .nav-logo{ font-size:1.05rem; letter-spacing:-.01em; }
  #menuBtn, #avatarBtn{ width:32px; height:32px; border-radius:9px; } /* still compact */
  #menuBtn svg, #accountMenu #avatarFallback svg{ width:18px; height:18px; }

}

/* Header CTA buttons — slightly slimmer padding */
.navbar .btn{
  text-decoration:none;
  font-weight:700;
  font-size:.9rem;
  border-radius:999px;
  transition:all .15s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
}

.navbar .btn-primary{
  background:#fff;
  color:var(--brandFrom);
}
.navbar .btn-primary:hover{ background:rgba(255,255,255,.92); }
.navbar .btn-secondary{
  background:transparent;
  color:#fff;
  border-color:rgba(255,255,255,.55);
}
.navbar .btn-secondary:hover{ background:rgba(255,255,255,.10); }

/* Optional: shrink horizontal padding on small screens */
@media (max-width: 960px){
  .navbar{ padding:12px 24px; }
  .navbar .nav-links{ gap:16px; }
}

/* Right-side plain links match left nav look */
.nav-actions .nav-link{
  text-decoration:none;
  color:rgba(255,255,255,.85);
  font-weight:600;
  font-size:.95rem;
  padding:0 4px;
}
.nav-actions .nav-link:hover{ color:#fff; }

/* Account menu (small circular avatar + white dropdown) */
.account-menu{ position:relative; margin-left:8px; }
.account-menu #avatarBtn{
  width:36px; height:36px; border-radius:999px; border:1px solid rgba(255,255,255,.35);
  background:transparent; color:#fff; display:inline-grid; place-items:center; cursor:pointer;
}
.account-menu #avatarImg{ display:none; width:100%; height:100%; object-fit:cover; border-radius:999px; }
.account-menu #avatarFallback{ font-weight:700; }

/* Account icon + dropdown */
.account-menu{ position:relative; margin-left:8px; }
#avatarBtn{
  width:36px; height:36px; border-radius:999px;
  border:1px solid rgba(255,255,255,.35);
  background:transparent; color:#fff; cursor:pointer;
  display:grid; place-items:center; padding:0;
}
#avatarBtn:focus-visible{ outline:2px solid #fff; outline-offset:2px; }
#avatarImg{ display:none; width:100%; height:100%; object-fit:cover; border-radius:999px; }
#avatarFallback{ font-weight:700; line-height:1; }

.account-menu .dropdown{
  display:none; position:absolute; top:44px; right:0; min-width:220px;
  background:#fff; color:#0f172a; border-radius:14px;
  box-shadow:0 10px 30px rgba(2,11,31,.12); padding:8px; z-index:10030;
}
.account-menu.open .dropdown{ display:block; }
.account-menu .dropdown a{
  display:block; padding:10px 12px; border-radius:10px;
  text-decoration:none; color:#0f172a; font-weight:600;
}
.account-menu .dropdown a:hover{ background:#f1f5f9; }

/* Show avatar photo when it has a src; hide fallback letter */
.account-menu #avatarImg[src] { display: block; }
.account-menu #avatarImg[src] + #avatarFallback { display: none; }

/* Safety: if any page still uses btn-secondary-dark, make it white bg + blue text */
.navbar .btn-secondary-dark {
  background: #fff;
  color: var(--brandFrom);
  border-color: transparent;
}
.navbar .btn-secondary-dark:hover { background: rgba(255,255,255,.92); }

/* Force CTA to blue text on white (gradient header context) */
.navbar #partnerCta {
  background:#fff !important;
  color: var(--brandFrom) !important;
  border-color:#fff !important;
}

/* Avatar dropdown visibility override (wins against legacy rules) */
#accountMenu.open #accountDropdown { display:block !important; }
#accountDropdown[hidden] { display:none !important; }

/* === Avatar hover (subtle lift + glow) === */
#avatarBtn,
.ej-avatar-btn {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
#avatarBtn:hover,
.ej-avatar-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 10px 28px rgba(2,95,188,.18);
  border-color: rgba(255,255,255,.65);
}

/* === Modern dropdown card (glass-lite), safely above header === */
#accountMenu { position: relative; z-index: 2147483000; }
#accountDropdown {
  display: none;                 /* shown when parent has .open */
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  max-width: min(92vw, 320px);
  background: rgba(255,255,255,.98);
  backdrop-filter: saturate(1.05) blur(6px);
  border: 1px solid rgba(2,16,32,.08);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(2,95,188,.16), 0 6px 18px rgba(15,23,42,.10);
  padding: 8px;
  z-index: 2147483001;
}
#accountMenu.open #accountDropdown { display: block !important; }
#accountDropdown[hidden] { display: none !important; }

/* little caret */
#accountDropdown::before{
  content:"";
  position:absolute; right: 16px; top:-6px;
  width:12px; height:12px; transform:rotate(45deg);
  background: inherit;
  border-left: 1px solid rgba(2,16,32,.08);
  border-top: 1px solid rgba(2,16,32,.08);
}

/* items */
#accountDropdown a,
#accountDropdown button{
  display:flex; align-items:center; gap:10px;
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background:transparent;
  border:0;
  font: 600 14px 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:#0f172a;
  text-decoration:none;
  cursor:pointer;
  transition: background .15s ease, transform .08s ease, color .15s ease;
}
#accountDropdown a:hover,
#accountDropdown button:hover{ background:#f8fafc; }
#accountDropdown a:active,
#accountDropdown button:active{ transform: translateY(1px); }

/* “Logout” emphasis */
#accountDropdown .danger{ color:#b91c1c; }
#accountDropdown .danger:hover{ background:#fef2f2; }

/* --- Clamp dropdown items inside the panel --- */
#accountDropdown,
.site-header .account-menu{
  overflow: hidden;                 /* clip hover backgrounds */
  border-radius: 14px !important;   /* keep rounded card edge */
  padding: 8px !important;
}

/* Make items fit without bleeding */
#accountDropdown a,#accountDropdown button,
.site-header .account-menu a,.site-header .account-menu button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  margin:0;                         /* no accidental overflow */
  padding:9px 10px;
  border-radius:8px;                /* smaller than container */
  background:transparent;
  transition: background .12s ease, color .12s ease;
}
#accountDropdown a:hover,#accountDropdown button:hover,
.site-header .account-menu a:hover,.site-header .account-menu button:hover{
  background:#f8fafc;               /* no shadow/scale, stays inside */
}

/* Move caret to the wrapper so overflow clipping won't cut it */
#accountDropdown::before,
.site-header .account-menu::before{ display:none !important; }

.site-header .account{ position:relative; }
.site-header .account::after{
  content:"";
  position:absolute;
  right:18px;
  top:calc(100% + 6px);             /* sits above the panel */
  width:12px; height:12px;
  transform:rotate(45deg);
  background:#fff;
  border-left:1px solid rgba(15,23,42,.10);
  border-top:1px solid rgba(15,23,42,.10);
  z-index:10031;
  pointer-events:none;
}

/* Subtle avatar hover (no big lift) */
#avatarBtn:hover,.ej-avatar-btn:hover{
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 18px rgba(2,95,188,.12);
}

/* Logout row: left-align content (icon + label) */
#accountDropdown #logoutBtn,
.site-header .account-menu #logoutBtn{
  justify-content: flex-start !important; /* override space-between */
  text-align: left;
  gap: 8px;                                /* comfy gap between icon/label */
}

/* Role-driven visibility for dropdown menus */
#accountDropdown .menu { display:none; padding:6px; }
html.role-client  #accountDropdown .for-client  { display:block; }
html.role-partner #accountDropdown .for-partner { display:block; }
html.role-admin   #accountDropdown .for-partner { display:block; } /* admins see partner menu */

/* Constrain item hit-area so it never overflows container */
#accountDropdown a,
#accountDropdown .menu-danger{
  display:flex; align-items:center; gap:10px;
  width:100%; box-sizing:border-box;
  padding:10px 12px; margin:0;
  border-radius:10px; border:0; background:transparent;
  font:550 14px 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:#0f172a; text-align:left; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#accountDropdown a:hover,
#accountDropdown .menu-danger:hover{ background:#f8fafc; }
#accountDropdown .menu-danger{ color:#b91c1c; }
#accountDropdown .menu-danger:hover{ background:#fef2f2; }
#accountDropdown hr{ border:0; border-top:1px solid #e5e7eb; margin:6px 0; }

/* Hide the big CTA for partners/admins */
html.role-partner #partnerCta,
html.role-admin   #partnerCta { display:none !important; }

/* Subtle avatar hover (no size jump) */
#avatarBtn{ transition: transform .12s ease, box-shadow .12s ease; }
#avatarBtn:hover{ transform: translateY(-1px); box-shadow:0 6px 16px rgba(2,95,188,.18); }

/* Hover: brand blue text */
.navbar .nav-links a:hover,
.site-header .nav-links a:hover {
  color: var(--brandFrom) !important;
}

/* --- Header instant paint (FUOC guard) --- */
/* During "unknown" auth, keep right-side controls invisible (reserve space) */
html.auth-unknown #accountMenu,
html.auth-unknown #partnerCta,
html.auth-unknown #planEventCta,
html.auth-unknown #linkLogin { visibility: hidden; }

/* Guest */
html.role-guest #accountMenu { display: none; }
html.role-guest #linkLogin { display: inline-flex; }
html.role-guest #partnerCta { display: inline-flex; }
html.role-guest #planEventCta { display: inline-flex; }

/* Client (signed in, not partner/admin) */
html.role-client #accountMenu { display: inline-flex; }
html.role-client #linkLogin { display: none; }
html.role-client #partnerCta { display: inline-flex; }
html.role-client #planEventCta { display: inline-flex; }

/* Partner/Admin */
html.role-partner #accountMenu,
html.role-admin   #accountMenu { display: inline-flex; }
html.role-partner #linkLogin,
html.role-admin   #linkLogin { display: none; }
html.role-partner #partnerCta,
html.role-admin   #partnerCta { display: none; }
html.role-partner #planEventCta,
html.role-admin   #planEventCta { display: none; }

/* Avatar: show fallback instantly, swap to img onload (already handled in JS) */
#accountMenu #avatarImg { display: none; }
#accountMenu #avatarFallback { display: inline-flex; }

/* Ensure right group pins to the far edge */
.nav-container{ display:flex; align-items:center; } /* if not already */

.nav-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-width:unset;          /* prevent overflow */
}


/* Optional: smaller cushion when only the avatar shows */
html.role-partner .nav-actions,
html.role-admin  .nav-actions{ min-width:160px; }

/* === FINAL GUARD: keep icons inside on all portal widths === */
#siteHeader.navbar{
  /* taller bar */
  padding:14px max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left)) !important;
}
#siteHeader .nav-container{ min-width:0; padding-inline:0; }
#siteHeader .nav-logo{ min-width:0; overflow:hidden; text-overflow:ellipsis; }
#siteHeader .nav-actions{ gap:8px; }

/* tiniest screens */
@media (max-width:400px){
  #siteHeader #menuBtn, #siteHeader #avatarBtn{ width:28px; height:28px; }
  #siteHeader .nav-logo{ font-size:1.5rem; }
}

/* avoid hover scale pushing the button off the edge in tight containers */
#siteHeader .icon-btn:hover{ transform:none; box-shadow:none; }

/* === Unify hamburger + avatar buttons (same size, shape, style) === */
:root{
  --nav-icon-size: 44px;   /* desktop/tablet */
  --nav-icon-size-sm: 40px;/* ≤560px */
  --nav-icon-size-xs: 36px;/* ≤380px */
  --nav-icon-glyph: 26px;  /* inner SVG size */
}

/* Button container (same circle, same fill/border/hover) */
#menuBtn,
#avatarBtn{
  width: var(--nav-icon-size) !important;
  height: var(--nav-icon-size) !important;
  border-radius: 999px !important;                      /* same shape */
  border: 1px solid rgba(255,255,255,.45) !important;   /* same border */
  background: rgba(255,255,255,.12) !important;         /* same fill */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color:#fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
#menuBtn:hover,
#avatarBtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(2,95,188,.18);
  border-color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.16);
}

/* Inner glyphs the same size */
#menuBtn svg,
#accountMenu #avatarFallback svg{
  width: var(--nav-icon-glyph) !important;
  height: var(--nav-icon-glyph) !important;
  display: block !important;
}

/* Responsive sizes */
@media (max-width:560px){
  #menuBtn, #avatarBtn{ width: var(--nav-icon-size-sm) !important; height: var(--nav-icon-size-sm) !important; }
  #menuBtn svg, #accountMenu #avatarFallback svg{ width: 24px !important; height: 24px !important; }
}
@media (max-width:380px){
  #menuBtn, #avatarBtn{ width: var(--nav-icon-size-xs) !important; height: var(--nav-icon-size-xs) !important; }
  #menuBtn svg, #accountMenu #avatarFallback svg{ width: 22px !important; height: 22px !important; }
}
/* === Header visibility fixes (desktop vs mobile) === */

/* 1) Never show the hamburger on desktop */
@media (min-width: 961px){
  #menuBtn{ display: none !important; }
}

/* 2) Only show the user icon when signed-in (role class present).
      Default = hidden so guests won't see it on desktop. */
#accountMenu{ display: none !important; }
html.role-client  #accountMenu,
html.role-partner #accountMenu,
html.role-admin   #accountMenu{ display: inline-flex !important; }

/* Mobile menu: show all items (scroll if taller than viewport) */
#siteHeader .mobile-menu{
  max-height: min(80vh, calc(100vh - 100px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(8px, env(safe-area-inset-bottom)); /* keep last item clear */
}

/* small cushion inside the list so the last link isn't flush to the edge */
#siteHeader .mobile-menu .mobile-nav{ padding-bottom: 6px; }

/* --- Mobile menu: unclip + full height + scroll --- */
#siteHeader,
#siteHeader .nav-container{
  overflow: visible !important; /* let the dropdown escape */
}

#siteHeader .mobile-menu{
  left: auto;
  max-height: calc(100vh - var(--header-h, 72px) - 20px); /* show all items */
  overflow-y: auto !important; /* scroll when tall */
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 2147483001;         /* above everything */
}

#siteHeader .mobile-menu[hidden]{ display: none !important; }

#siteHeader .mobile-menu .mobile-nav{
  display: grid !important;
  padding: 8px !important;
}

/* Ensure every item renders (in case any older rules interfere) */
#siteHeader .mobile-menu .mobile-nav a{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* --- Mobile Bottom Tabbar (Everjoy) --- */
.mb-tabbar{
  --mb-cols: 5; /* default to five client tabs */
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 60px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 -6px 24px rgba(2,6,23,.08);
  display: grid;
  /* force a single horizontal row, one equal column per tab */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  /* grid-template-columns no longer needed */
  align-items: center;
  z-index: 1010;
}

/* allow tight phones to squeeze; and truly hide gated tabs */
.mb-tabbar .tab{ min-width: 0; }
.mb-tabbar .tab[hidden]{ display:none !important; }


/* How many columns per role */
html.role-guest   .mb-tabbar{ --mb-cols: 2; }  /* Browse, Deals */
html.role-client  .mb-tabbar{ --mb-cols: 5; }  /* Browse, Deals, Saved, Inbox, Profile */
html.role-partner .mb-tabbar,
html.role-admin   .mb-tabbar{ --mb-cols: 4; }  /* Requests, Listings, Deals, Dashboard */


/* hide on desktop */
@media (min-width: 960px){
  .mb-tabbar{ display: none; }
  body.has-tabbar{ padding-bottom: 0 !important; }
}

/* ensure content isn't hidden under the bar */
body.has-tabbar{
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* tab item */
/* Bottom tab: always stack icon over label */
.mb-tabbar .tab{
  display: grid !important;
  grid-auto-flow: row;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  gap: 4px;
  text-align: center;
  color: #0f172a;
  text-decoration: none;
  font: 600 11px Poppins, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  min-width: 0;
}
/* Bigger icons + consistent block layout */
.mb-tabbar .tab > svg{
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  margin: 0;
}
@media (max-width: 360px){
  .mb-tabbar .tab > svg{ width: 22px !important; height: 22px !important; }
}

/* Keep label under icon */
.mb-tabbar .tab > span{
  display: block !important;
  line-height: 1.05;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.mb-tabbar .tab svg{ width: 20px; height: 20px; display: block; }

@media (max-width: 360px){
  .mb-tabbar{ height: 56px; }
  .mb-tabbar .tab{ font-size: 10.5px; gap: 2px; }
  .mb-tabbar .tab svg{ width: 18px; height: 18px; }
}

.mb-tabbar .tab span{
  line-height: 1;
  opacity: .80;
}

/* active state */
.mb-tabbar .tab[aria-current="page"],
.mb-tabbar .tab[aria-current="true"],
.mb-tabbar .tab.is-active{
  color: var(--brandFrom, #025fbc);
}
.mb-tabbar .tab[aria-current="page"] svg,
.mb-tabbar .tab[aria-current="true"] svg,
.mb-tabbar .tab.is-active svg{ opacity: 1; }

/* role gating (hooked to html.role-*) */
html.role-partner .mb-tabbar .only-client{ display: none !important; }
html.role-admin   .mb-tabbar .only-client{ display: none !important; }

html.role-client  .mb-tabbar .only-partner{ display: none !important; }
html.role-guest   .mb-tabbar .only-partner{ display: none !important; }

/* optional: hide on pages that shouldn't have a tabbar */
.no-tabbar .mb-tabbar{ display:none !important; }

/* --- Force rail links into the dropdown (hide inline duplicates) --- */
/* Keep only the CTA pills (#partnerCta, #planEventCta), Login, and the avatar button visible in the rail */
#siteHeader .nav-actions > a:not(.btn):not(#linkLogin):not(#partnerCta):not(#planEventCta),
#navRight > a:not(.btn):not(#linkLogin):not(#partnerCta):not(#planEventCta),
.navbar .nav-actions > a:not(.btn):not(#linkLogin):not(#partnerCta):not(#planEventCta) {
  display: none !important;
}
/* === Global button hover pop (Everjoy) ===================== */
/* Applies to main buttons across the site; no color changes, just scale */
button.btn,
a.btn,
.btn-ghost,
.btn-with-icon {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

/* Subtle scale + shadow on hover/focus */
button.btn:hover,
button.btn:focus-visible,
a.btn:hover,
a.btn:focus-visible,
.btn-ghost:hover,
.btn-ghost:focus-visible,
.btn-with-icon:hover,
.btn-with-icon:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

/* Opt-out helper for any special case buttons */
button.btn.no-scale,
a.btn.no-scale,
.no-scale.btn-ghost,
.no-scale.btn-with-icon {
  transform: none !important;
  box-shadow: none !important;
}
button.btn.no-scale:hover,
button.btn.no-scale:focus-visible,
a.btn.no-scale:hover,
a.btn.no-scale:focus-visible,
.no-scale.btn-ghost:hover,
.no-scale.btn-ghost:focus-visible,
.no-scale.btn-with-icon:hover,
.no-scale.btn-with-icon:focus-visible {
  transform: none !important;
  box-shadow: none !important;
}

/* Fallback: hide plain .nav-link rail items ONLY on mobile-heavy pages
   (use .no-inline-rail on <body> to activate). Keeps desktop header intact elsewhere. */
body.no-inline-rail #siteHeader .nav-actions > .nav-link,
body.no-inline-rail .navbar .nav-actions > .nav-link,
body.no-inline-rail #navRight > .nav-link {
  display: none !important;
}

/* Ensure the dropdown itself shows when the menu is opened (both ID and class variants) */
#accountMenu.open #accountDropdown,
.site-header .account.open .account-menu,
.account-menu.open .dropdown {
  display: block !important;
}

/* Keep the dropdown above the header and clickable */
#accountDropdown,
.site-header .account-menu,
.account-menu .dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 2147483001;
  pointer-events: auto;
}

/* --- Bottom tabbar hard overrides (never hide client 3) --- */
#mbTabbar .tab[data-key="saved"],
#mbTabbar .tab[data-key="messages"],
#mbTabbar .tab[data-key="account"]{
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure all three auth tabs render (even if some old rule set display:none) */
#mbTabbar .tab[data-key="saved"],
#mbTabbar .tab[data-key="messages"],
#mbTabbar .tab[data-key="account"]{
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 0 !important;
}

/* Guests/Clients: always 5 equal columns; Partners/Admins: 4 */
html.role-client  .mb-tabbar,
html.role-guest   .mb-tabbar { grid-template-columns: repeat(5, minmax(0,1fr)) !important; }
html.role-partner .mb-tabbar,
html.role-admin   .mb-tabbar { grid-template-columns: repeat(4, minmax(0,1fr)) !important; }

/* Bottom tabbar — stack icon over label, slightly larger icons */
.mb-tabbar .tab{
  display: grid !important;
  grid-auto-flow: row;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.mb-tabbar .tab > svg{
  width: 24px !important;
  height: 24px !important;
  display: block !important;
}
.mb-tabbar .tab > span{
  display: block !important;
  line-height: 1.05;
  white-space: nowrap;
}

/* Bottom tabbar: consistent icon size + always-visible labels */
#mbTabbar .tab > svg{
  width: 26px !important;
  height: 26px !important;
  display: block !important;
}

#mbTabbar .tab > span{
  display: block !important;
  margin-top: 4px;
  font: 600 11px Poppins, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: #0f172a !important;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
}

/* Belt-and-suspenders: if anything was hiding the Profile label */
#mbTabbar .tab[data-key="account"] > span{ display:block !important; visibility: visible !important; }


/* Keep content below the fixed header */
.header-spacer{
  height: var(--header-h, 88px);
  pointer-events: none; /* don't block clicks */
}

/* === Reusable busy overlay + spinner (Everjoy) ===================== */
.ej-busy-overlay{
  position:absolute; inset:0;
  display:grid; place-items:center;
  background: rgba(255,255,255,.66);
  backdrop-filter: saturate(120%) blur(1.5px);
  z-index: 20; opacity:0; pointer-events:none;
  transition: opacity .18s ease;
}
.ej-busy-overlay.is-on{ opacity:1; pointer-events:auto; }

.ej-spinner{
  width:36px; height:36px;
  border:3px solid rgba(2,95,188,.18);
  border-top-color: var(--ej-brand, #025fbc);
  border-radius:50%;
  animation: ejSpin .8s linear infinite;
}
@keyframes ejSpin{ to { transform: rotate(360deg); } }

/* Header right-side CTAs (List your business / Plan an Event / Log in) */
#siteHeader .nav-actions .btn{
  font-size:0.9rem;
  line-height:1.2;
}

/* Hide bottom tab bar on desktop */
@media (min-width: 1024px) {
  #mbTabbar {
    display:none !important;
  }
}

/* Mobile account menu – slightly smaller text */
@media (max-width: 768px) {
  #accountMenu,
  .account-menu {
    font-size: 3rem; /* ~14px, 1–2 steps smaller than desktop */
  }

  #accountMenu a,
  .account-menu a {
    line-height: 1.3;
  }
}
