/* ==============================
   Tokens
   ============================== */
   :root{
    --nav-white:#fff;
    --nav-text:#111;
    --muted:#6b7280;
    --line:#e7e7e7;
    --chip:#f4f4f5;
    --chip-text:#111;
    --tile-bg:#f7f7f8;
    --shadow:0 20px 40px rgba(0,0,0,.08);
    --header-h:64px;
  }
  
  /* ==============================
     Navbar
     ============================== */
  #site-navbar.nav--light{
    font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
    color:var(--nav-text);
  }
  .navbar{
    position:fixed; inset:0 0 auto 0; height:var(--header-h);
    background:var(--nav-white); color:var(--nav-text);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 18px; border-bottom:1px solid var(--line);
    z-index:1000; transition:box-shadow .2s ease,border-color .2s ease;
  }
  .navbar.is-scrolled{ box-shadow:0 6px 16px rgba(0,0,0,.06); border-color:rgba(0,0,0,.06); }
  
  .navbar__brand{
    display:flex; align-items:center; gap:6px;
    color:var(--nav-text); text-decoration:none; font-weight:800; letter-spacing:.04em;
  }
  .brand-word{ font-weight:800; }
  .brand-word.alt{ font-weight:700; opacity:.9; }
  
  .navbar__left{ display:flex; align-items:center; gap:10px; }
  .navbar__menu{
    display:inline-flex; align-items:center; gap:8px;
    padding:10px 12px; border-radius:999px; border:1px solid var(--line);
    background:#fff; color:var(--nav-text); font-weight:700; letter-spacing:.02em;
    cursor:pointer; transition:transform .12s ease, background .15s ease;
  }
  .navbar__menu:hover{ background:#f7f7f7; transform:translateY(-1px); }
  .navbar__menu svg{ width:20px; height:20px; fill:currentColor; }
  
  .navbar__icon{
    width:40px; height:40px; display:grid; place-items:center;
    border-radius:999px; border:1px solid var(--line);
    background:#fff; color:var(--nav-text); cursor:pointer;
    transition:transform .12s ease, background .15s ease;
  }
  .navbar__icon:hover{ background:#f7f7f7; transform:translateY(-1px); }
  .navbar__icon svg{ width:20px; height:20px; fill:currentColor; }
  
  /* Account popover */
  .account-popover{
    position:absolute; top:calc(var(--header-h) - 8px); left:140px;
    background:#fff; border:1px solid var(--line); border-radius:12px;
    padding:6px; box-shadow:var(--shadow); display:none; z-index:1100;
  }
  .account-popover.is-open{ display:block; }
  .account-popover .account-link{
    display:block; padding:10px 12px; border-radius:8px; color:#111; text-decoration:none;
  }
  .account-popover .account-link:hover{ background:#f5f5f5; }
  
  body{ padding-top:var(--header-h); }
  
  /* ==============================
     Overlay (Option B: dim backdrop + slide-down sheet)
     ============================== */
  .overlay{
    position:fixed; inset:0; z-index:1200;
    background: rgba(17,17,17,.40);            /* dim only — no heavy blur */
    opacity:0; pointer-events:none; transition: opacity .18s ease;
  }
  .overlay.is-visible{ opacity:1; pointer-events:auto; }
  
  /* Top sheet */
  .overlay__sheet{
    position:absolute; left:0; right:0; top:0;
    background:#fff; color:#111; border-bottom:1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
  
    /* auto height (fit content) with a safe cap */
    max-height: min(86vh, 100%);
    overflow:auto;
  
    transform: translateY(-12px);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
  }
  .overlay.is-visible .overlay__sheet{ transform: translateY(0); }
  
  /* Top section */
  .overlay__top{
    position:sticky; top:0; z-index:2;
    display:flex; align-items:center; gap:14px;
    padding:18px; border-bottom:1px solid var(--line); background:#fff;
  }
  .overlay__close{
    display:inline-flex; align-items:center; gap:8px; padding:10px 14px;
    font-weight:700; background:#fff; color:#111;
    border:1px solid var(--line); border-radius:999px; cursor:pointer;
    transition:background .15s ease, transform .12s ease;
  }
  .overlay__close:hover{ background:#f7f7f7; transform:translateY(-1px); }
  
  /* Search */
  .overlay__search{ position:relative; flex:1; display:flex; align-items:center; }
  .overlay__search input{
    width:100%; height:46px; border-radius:10px; border:1px solid var(--line);
    padding:0 46px 0 14px; font-size:15px; background:#fff; color:#111;
  }
  .overlay__search .search-btn{
    position:absolute; right:8px; width:36px; height:36px; border:0; background:transparent; border-radius:8px; cursor:pointer;
  }
  .overlay__search .search-btn:hover{ background:#efefef; }
  
  /* Primary row */
  .overlay__primary{
    display:flex; flex-wrap:wrap; align-items:center; gap:48px;
    padding:16px 22px 28px; margin:0; list-style:none; border-bottom:1px solid var(--line);
  }
  .overlay__primary > li > a,
  .overlay__primary > li > .overlay__toggle{
    color:#111; text-decoration:none; font-weight:600;
  }
  .overlay .overlay__toggle{
    -webkit-appearance:none; appearance:none; background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important;
    padding:0 !important; margin:0; line-height:1.2; display:inline-flex; align-items:center; gap:6px;
    color:#111; font-weight:600; cursor:pointer; text-decoration:none;
  }
  .overlay .overlay__toggle:hover,
  .overlay .overlay__toggle:focus-visible{
    color:#000; text-decoration:underline; text-underline-offset:.2em; outline:none;
  }
  .overlay__primary > li{ position:relative; padding-bottom:4px; }
  .overlay__primary > li.has-children::after{
    content:""; position:absolute; left:50%; bottom:-14px; transform:translateX(-50%);
    width:0; height:0; border-left:7px solid transparent; border-right:7px solid transparent; border-top:7px solid #111;
    opacity:0; transition:opacity .18s ease;
  }
  .overlay__primary > li.has-children:has([aria-expanded="true"])::after{ opacity:1; }
  
  /* Panels */
  .overlay__panel[hidden]{ display:none !important; }
  .overlay__panel{ padding:0; background:#fff; border-bottom:1px solid var(--line); }
  .overlay__chips{
    display:flex; gap:12px; flex-wrap:wrap;
    padding:14px 22px; border-bottom:1px solid var(--line);
  }
  .chip{
    background:var(--chip); color:var(--chip-text); text-decoration:none; white-space:nowrap;
    padding:8px 12px; border-radius:999px; border:1px solid #eaeaea;
    font-weight:600; transition:background .12s ease, transform .12s ease;
  }
  .chip:hover{ background:#eee; transform:translateY(-1px); }
  
  /* Tiles */
  .overlay__tiles{
    display:grid; grid-template-columns:repeat(3, minmax(160px,1fr));
    gap:16px; padding:18px 22px;
  }
  .tile{
    background:var(--tile-bg); border:1px solid var(--line); border-radius:12px;
    padding:16px; color:#111; text-decoration:none; font-weight:700;
    display:flex; align-items:center; gap:12px;
    transition:transform .12s ease, background .15s ease, box-shadow .2s ease;
  }
  .tile:hover{ background:#efefef; transform:translateY(-2px); box-shadow:0 12px 24px rgba(0,0,0,.06); }
  .tile__icon{ font-size:20px; }
  
  .overlay__brandline{ margin-left:auto; padding:10px 22px 22px; font-weight:800; letter-spacing:.08em; }
  
  /* Responsive */
  @media (max-width:1024px){
    .overlay__tiles{ grid-template-columns:repeat(2,1fr); }
  }
  @media (max-width:700px){
    .overlay__tiles{ grid-template-columns:1fr; }
    .account-popover{ left:12px; right:12px; }
    .overlay__sheet{ max-height:88vh; }
  }
  

  /* Brand line layout */
.overlay__brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* pushes login to the right */
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--overlay-border, rgba(255,255,255,.12));
  background: var(--overlay-brandline-bg, transparent);
}

/* Right-side login link */
.brandline__login {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: .5rem;
  outline: none;
  transition: transform .12s ease, background-color .12s ease;
}

.brandline__login:hover { transform: translateY(-1px); }
.brandline__login:active { transform: translateY(0); }


/* Default: hide */
.overlay__tiles {
  display: none;
}

/* Show only if logged in */
.overlay__tiles[data-authenticated="1"] {
  display: grid;   /* or flex depending on your layout */
  gap: 1rem;       /* adjust as needed */
  padding: 18px 22px; /* restore your padding only when visible */
}