:root { --global-header-height:72px; }

.cleverly-global-header {
  position:sticky;
  top:0;
  z-index:2000;
  min-height:var(--global-header-height);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto auto minmax(0,1fr);
  align-items:center;
  gap:18px;
  padding:0 max(18px,calc((100vw - 1120px)/2 + 24px));
  border-bottom:1px solid rgba(59,130,246,.13);
  background:linear-gradient(180deg,rgba(242,247,255,.98),rgba(232,240,253,.96));
  color:#17213a;
  box-shadow:0 5px 18px rgba(37,99,235,.08);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
.cleverly-global-header * { box-sizing:border-box; }
.cleverly-global-header a { text-decoration:none; }
.global-header-brand { justify-self:start; display:flex; align-items:center; gap:14px; color:#111a31; letter-spacing:0; }
.global-header-brand img { display:block; width:52px; height:58px; object-fit:contain; filter:contrast(1.08) saturate(1.08); }
.global-brand-copy { display:flex; flex-direction:column; justify-content:center; min-width:0; line-height:1.16; }
.global-brand-copy strong { color:#0f172a; font-size:clamp(17px,2.6vw,21px); font-weight:820; letter-spacing:.005em; white-space:nowrap; }
.global-brand-copy small { margin-top:4px; color:#526078;font-size:12px; font-weight:450; letter-spacing:.01em; white-space:nowrap; }
.global-header-nav { justify-self:center; display:flex; align-items:stretch; gap:25px; height:var(--global-header-height); }
.global-header-link { position:relative; display:flex; align-items:center; padding:2px 0 0; border-radius:0; color:#536077; font-size:.96rem; font-weight:650; transition:color .15s ease; }
.global-header-link:hover { background:transparent; color:#17213a; transform:none; }
.global-header-link.active { background:transparent; color:#155eef; }
.global-header-link.active::after { content:""; position:absolute; left:0; right:0; bottom:15px; height:2px; border-radius:99px; background:#2563eb; }
.global-app-divider { justify-self:center; width:1px; height:26px; background:rgba(15,23,42,.14); }
.global-app-link { position:relative; justify-self:center; display:flex; align-items:center; gap:10px; padding:9px 16px; border:1px solid rgba(37,99,235,.2); border-radius:11px; background:rgba(219,234,254,.76); color:#23446f!important; font-size:.86rem; font-weight:750; letter-spacing:.015em; box-shadow:0 4px 13px rgba(37,99,235,.1); transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease; }
.global-app-link:hover { transform:translateY(-1px); background:rgba(219,234,254,.98); box-shadow:0 7px 16px rgba(37,99,235,.16); }
.global-app-link.active { border-color:#6e91f5; box-shadow:0 0 0 2px rgba(110,145,245,.2); }
.global-app-link > * { position:relative; z-index:1; }
.global-app-logo { width:21px; height:24px; object-fit:contain; flex-shrink:0; filter:contrast(1.12) saturate(1.12); }
.global-header-actions { justify-self:end; display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.global-header-actions:empty { min-width:45px; }
.global-header-actions .auth-cta,.global-header-actions .account-auth,.global-header-actions .topbar-actions { display:flex!important; align-items:center; gap:10px; color:#17213a; }
.global-header-actions .topbar-copy { display:none!important; }
.global-header-actions #auth-area { color:#17213a; }
.global-header-actions a,.global-header-actions button { font-family:inherit; }
.global-header-actions .avatar { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:#dbeafe; color:#1d4ed8; }
.global-header-actions .icon-button,.global-header-actions .account-logout-btn { min-height:40px; padding:9px 13px; border:1px solid rgba(37,99,235,.16); border-radius:11px; background:rgba(255,255,255,.68); color:#17213a; cursor:pointer; }
.global-header-actions .topbar-actions .avatar { display:none!important; }
.global-account-link { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:9px 15px; border:1px solid rgba(37,99,235,.16); border-radius:11px; background:rgba(255,255,255,.7); color:#334155; font-size:.9rem; font-weight:700; box-shadow:0 4px 12px rgba(37,99,235,.06); }
.global-account-link:hover { border-color:rgba(37,99,235,.3); color:#1d4ed8; background:#fff; }
.global-account-state { position:relative; display:flex; align-items:center; }
.global-account-loading { display:block; width:104px; height:38px; border-radius:12px; background:linear-gradient(90deg,#e2e8f0,#f8fafc,#e2e8f0); background-size:200% 100%; animation:global-account-pulse 1.2s linear infinite; }
.global-profile-trigger { display:flex; align-items:center; gap:10px; min-height:44px; padding:2px 8px 2px 2px; border:0; border-radius:14px; background:transparent; color:#17213a; font:inherit; cursor:pointer; }
.global-profile-trigger:hover,.global-profile-trigger[aria-expanded="true"] { background:rgba(255,255,255,.58); }
.global-profile-avatar { display:grid; place-items:center; width:42px; height:42px; overflow:hidden; border-radius:13px; background:#f4511e; color:#fff; font-size:20px; font-style:normal; font-weight:750; box-shadow:0 5px 14px rgba(244,81,30,.18); }
.global-profile-avatar img { width:100%; height:100%; object-fit:cover; }
.global-profile-name { max-width:150px; overflow:hidden; padding:5px 9px; border-radius:10px; background:rgba(255,255,255,.38); color:#536077; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.global-profile-chevron { color:#64748b; font-size:16px; transform:translateY(-1px); }
.global-profile-menu { position:absolute; top:calc(100% + 8px); right:0; z-index:20; width:160px; padding:6px; border:1px solid #dbe5f2; border-radius:13px; background:#fff; box-shadow:0 18px 45px rgba(15,23,42,.16); }
.global-profile-menu a,.global-profile-menu button { display:flex; width:100%; padding:10px 11px; border:0; border-radius:9px; background:transparent; color:#334155; font:inherit; font-size:13px; font-weight:650; text-align:left; cursor:pointer; }
.global-profile-menu a:hover,.global-profile-menu button:hover { background:#eff6ff; color:#1d4ed8; }
.global-login-link { display:inline-flex; align-items:center; min-height:40px; padding:8px 15px; border:1px solid #bfdbfe; border-radius:11px; background:rgba(255,255,255,.65); color:#1d4ed8; font-size:13px; font-weight:750; }
@keyframes global-account-pulse { to { background-position:-200% 0; } }
.global-unified-auth,.global-unified-profile { position:relative; display:flex; align-items:center; }
.global-unified-trigger { display:flex; align-items:center; gap:10px; margin:0; padding:2px 8px 2px 2px; border:0; border-radius:14px; background:transparent; color:#17213a; font:inherit; cursor:pointer; }
.global-unified-trigger:hover,.global-unified-trigger[aria-expanded="true"] { background:rgba(255,255,255,.58); }
.global-unified-avatar { display:grid; place-items:center; width:42px; height:42px; overflow:hidden; border-radius:13px; background:#f4511e; color:#fff; font-size:20px; font-style:normal; font-weight:750; box-shadow:0 5px 14px rgba(244,81,30,.18); }
.global-unified-avatar img { width:100%; height:100%; object-fit:cover; }
.global-unified-name { max-width:150px; overflow:hidden; padding:5px 9px; border-radius:10px; background:rgba(255,255,255,.38); color:#536077; font-size:12px; line-height:1; text-overflow:ellipsis; white-space:nowrap; }
.global-unified-chevron { display:inline-flex; align-items:center; justify-content:center; width:14px; height:14px; color:#64748b; transition:transform .2s ease; }
.global-unified-chevron svg { display:block; width:100%; height:100%; }
.global-unified-profile.is-open .global-unified-chevron { transform:rotate(180deg); }
.global-unified-menu { position:absolute; top:50px; right:0; z-index:30; min-width:180px; padding:6px; border:1px solid #dbe5f2; border-radius:13px; background:#fff; box-shadow:0 18px 45px rgba(15,23,42,.16); opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-6px) scale(.96); transform-origin:top right; transition:opacity .16s ease,transform .16s ease,visibility 0s linear .16s; }
.global-unified-menu.is-open { opacity:1; visibility:visible; pointer-events:auto; transform:none; transition-delay:0s; }
.global-unified-menu a,.global-unified-menu button { display:flex; width:100%; padding:10px 11px; border:0; border-radius:9px; background:transparent; color:#334155; font:inherit; font-size:13px; font-weight:650; text-align:left; cursor:pointer; }
.global-unified-menu a:hover,.global-unified-menu button:hover { background:#eff6ff; color:#1d4ed8; }
.global-nav-toggle { display:none; justify-self:end; width:46px; height:42px; padding:8px 10px; border:1px solid rgba(37,99,235,.18); border-radius:12px; background:rgba(255,255,255,.68); cursor:pointer; }
.global-nav-toggle span { display:block; height:2px; margin:5px 0; border-radius:99px; background:#334155; }
.global-mobile-nav { display:none; grid-column:1/-1; padding:4px 0 16px; }
.global-mobile-nav.open { display:grid; gap:5px; }

@media(max-width:760px) {
  :root { --global-header-height:70px; }
  .cleverly-global-header { grid-template-columns:1fr auto; padding:0 16px; }
  .global-header-brand img { width:44px; height:44px; }
  .global-brand-copy small { display:none; }
  .global-header-nav { display:none; }
  .global-app-divider { display:none; }
  .global-app-link { display:none; }
  .global-header-actions { display:none; }
  .global-nav-toggle { display:block; }
  .global-mobile-nav { background:rgba(238,245,255,.98); }
  .global-mobile-nav .global-header-link { min-height:42px; padding:0 10px; border-radius:9px; }
  .global-mobile-nav .global-header-link.active { background:#dbeafe; }
  .global-mobile-nav .global-header-link.active::after { display:none; }
  .global-mobile-nav .global-app-link-mobile { display:flex; justify-self:stretch; justify-content:center; margin-top:14px; padding:12px 14px; border-top:1px solid rgba(15,23,42,.1); }
}

@media(prefers-reduced-motion:reduce) { .global-header-link { transition:none; } }
