/* One global header, independent of page-specific .site-shell__nav overrides. */
:root { --aibu-topbar-height: 64px; }
body .site-shell:has(> .aibu-topbar) { overflow-x: clip !important; overflow-y: visible !important; }
body:has(.aibu-topbar):not(.create-page):not(.ecom-canvas-page) { overflow-x: clip; overflow-y: visible; }
body .aibu-topbar {
    --top-ink: #273c56; --top-muted: #6c809a; --top-border: rgba(210, 225, 245, 0.9); --top-bg: rgba(255, 255, 255, 0.85); --top-soft: rgba(240, 246, 255, 0.86); --top-btn-bg: rgba(255, 255, 255, 0.92);
    position: sticky; top: 0; z-index: 1300;
    display: flex; align-items: center; gap: 16px;
    flex: 0 0 var(--aibu-topbar-height); height: var(--aibu-topbar-height); min-height: var(--aibu-topbar-height);
    width: 100%; padding: 8px 24px; box-sizing: border-box;
    color: var(--top-ink); background: var(--top-bg); border-bottom: 1px solid var(--top-border);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    font: 13px/1.4 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    overflow: visible;
}
html.dark-mode body .aibu-topbar {
    --top-ink: #dce8f8; --top-muted: #8ca2bf; --top-border: rgba(45, 72, 108, 0.85); --top-bg: rgba(8, 18, 33, 0.86); --top-soft: rgba(17, 35, 62, 0.88); --top-btn-bg: rgba(19, 39, 68, 0.9);
    box-shadow: 0 1px 0 rgba(125, 211, 252, 0.06) inset, 0 8px 24px rgba(0, 0, 0, 0.22);
}
body .aibu-topbar [hidden] { display: none !important; }
body .aibu-topbar .aibu-topbar__brand { display: flex; flex: 0 0 144px; width: 144px; min-width: 0; margin: 0; padding: 0; }
body .aibu-topbar .aibu-topbar__brand img { width: 144px; height: 34px; max-width: 100%; object-fit: contain; }
body .aibu-topbar .aibu-topbar__brand .logo-dark { display: none; }
html.dark-mode body .aibu-topbar .logo-light { display: none; }
html.dark-mode body .aibu-topbar .aibu-topbar__brand .logo-dark { display: block; }
body .aibu-topbar__menu { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--top-border); border-radius: 10px; background: var(--top-bg); color: var(--top-ink); cursor: pointer; }
body .aibu-topbar__links { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
body .aibu-topbar__links a { padding: 10px 9px; color: var(--top-ink); border-radius: 8px; white-space: nowrap; text-decoration: none; font-size: 13px; font-weight: 600; }
body .aibu-topbar__links a:hover, body .aibu-topbar__links a[aria-current] { color: #146cff; background: var(--top-soft); }
body .aibu-topbar .aibu-topbar__search { position: relative; flex: 1 1 200px; min-width: 120px; max-width: 360px; margin: 0; display: flex; align-items: center; }
body .aibu-topbar__search-icon { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--top-muted); pointer-events: none; z-index: 1; }
body .aibu-topbar .search-input { width: 100%; height: 36px; padding: 0 32px 0 33px !important; border: 1px solid var(--top-border) !important; border-radius: 10px !important; background: var(--top-soft) !important; color: var(--top-ink) !important; font-size: 12px; transition: border-color 140ms ease, box-shadow 140ms ease !important; }
body .aibu-topbar .search-input::placeholder { color: var(--top-muted) !important; }
body .aibu-topbar .search-input:focus { border-color: #146cff !important; background: var(--top-btn-bg) !important; box-shadow: 0 0 0 3px rgba(20, 108, 255, 0.14) !important; outline: none; }
html.dark-mode body .aibu-topbar .search-input:focus { border-color: #38bdf8 !important; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important; }
body .aibu-topbar__search-kbd { position: absolute; right: 9px; padding: 1px 6px; border: 1px solid var(--top-border); border-radius: 5px; background: var(--top-btn-bg); color: var(--top-muted); font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; pointer-events: none; }
body .aibu-topbar .search-input:focus + .aibu-topbar__search-kbd { opacity: 0; }
body .aibu-topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; margin-left: auto; min-width: 0; overflow: visible; }
body .aibu-topbar__actions > button, body .aibu-topbar__actions > a { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; min-height: 36px !important; min-width: 36px !important; margin: 0; padding: 0 11px; border: 1px solid var(--top-border) !important; border-radius: 10px !important; background: var(--top-btn-bg) !important; color: var(--top-ink) !important; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease !important; }
body .aibu-topbar__actions > button:hover, body .aibu-topbar__actions > a:hover { border-color: rgba(20, 108, 255, 0.45) !important; color: #146cff !important; }
html.dark-mode body .aibu-topbar__actions > button:hover, html.dark-mode body .aibu-topbar__actions > a:hover { border-color: rgba(56, 189, 248, 0.55) !important; color: #7dd3fc !important; }
body .aibu-topbar__actions > [data-points-badge] { background: linear-gradient(135deg, rgba(20, 108, 255, 0.09), rgba(14, 165, 233, 0.08)) !important; border-color: rgba(20, 108, 255, 0.24) !important; color: #0b4ed1 !important; font-variant-numeric: tabular-nums; }
html.dark-mode body .aibu-topbar__actions > [data-points-badge] { background: linear-gradient(135deg, rgba(20, 108, 255, 0.22), rgba(14, 165, 233, 0.16)) !important; border-color: rgba(56, 189, 248, 0.34) !important; color: #7dd3fc !important; }
body .aibu-topbar__actions > .nav-auth-button { background: linear-gradient(135deg, #146cff 0%, #0284c7 100%) !important; border-color: rgba(255, 255, 255, 0.18) !important; color: #fff !important; box-shadow: 0 4px 14px rgba(20, 108, 255, 0.22); }
body .aibu-topbar__actions > .nav-auth-button:hover { color: #fff !important; box-shadow: 0 6px 18px rgba(20, 108, 255, 0.32); transform: translateY(-1px); }
body .aibu-topbar__actions > .primary-button { background: linear-gradient(135deg, #146cff 0%, #0ea5e9 100%) !important; color: #fff !important; border-color: rgba(255, 255, 255, 0.18) !important; box-shadow: 0 4px 14px rgba(20, 108, 255, 0.22); }
body .aibu-topbar__actions > .primary-button:hover { color: #fff !important; border-color: rgba(255, 255, 255, 0.28) !important; box-shadow: 0 6px 18px rgba(20, 108, 255, 0.32); transform: translateY(-1px); }
body.create-page .aibu-topbar__actions > .aibu-topbar__create { display: none !important; }
body .aibu-topbar__actions > .aibu-topbar__earn { background: linear-gradient(135deg, rgba(20, 108, 255, 0.1), rgba(14, 165, 233, 0.12)) !important; border-color: rgba(20, 108, 255, 0.26) !important; color: #0b55c9 !important; font-weight: 700; }
html.dark-mode body .aibu-topbar__actions > .aibu-topbar__earn { background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(14, 165, 233, 0.18)) !important; border-color: rgba(56, 189, 248, 0.36) !important; color: #7dd3fc !important; }
@media (max-width: 960px) { body .aibu-topbar__actions > .aibu-topbar__earn { display: none !important; } }
body .aibu-topbar__actions > .nav-icon-button { width: 36px; padding: 0; }
body .aibu-topbar .aibu-auth-short { display: none; }
body .aibu-topbar__actions svg { width: 18px; height: 18px; flex-shrink: 0; }
body .aibu-topbar__actions > [data-vip-badge] { display: none; } /* Membership is available in the top links and account menu. */
body .aibu-topbar .user-dropdown-wrap { position: relative; display: block; }
body .aibu-topbar .user-avatar-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #146cff; color: #fff; cursor: pointer; }
body .aibu-topbar .user-dropdown { position: absolute; top: 44px; right: 0; width: min(300px, calc(100vw - 20px)); max-height: calc(100dvh - 80px); overflow-y: auto; background: var(--top-bg); color: var(--top-ink); border: 1px solid var(--top-border); border-radius: 14px; box-shadow: 0 10px 35px #10254b24; }
body .aibu-topbar .nav-checkin-button:disabled { cursor: default; opacity: .7; }
body .aibu-topbar .sidebar-drawer { position: fixed; inset: 0; z-index: 1400; width: 100vw; height: 100dvh; }
body .aibu-topbar .drawer-overlay { position: absolute; inset: 0; background: #10213b66; }
body .aibu-topbar .drawer-content { position: relative; width: min(320px, 88vw); max-width: none; height: 100%; padding: 18px 12px; overflow-y: auto; background: var(--top-bg); border-right: 1px solid var(--top-border); }
body .aibu-drawer-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding: 0 10px; }
body .aibu-drawer-heading button { width: 36px; height: 36px; border: 1px solid var(--top-border); border-radius: 10px; background: var(--top-bg); color: var(--top-ink); font-size: 24px; cursor: pointer; }
body .aibu-topbar a:focus-visible, body .aibu-topbar button:focus-visible { outline: 2px solid #146cff; outline-offset: 2px; }
body .workspace-shell { min-height: calc(100dvh - var(--aibu-topbar-height)); }
body .workspace-sidebar.aibu-global-sidebar { top: var(--aibu-topbar-height); height: calc(100dvh - var(--aibu-topbar-height)); }
body .v3-sidebar.aibu-global-sidebar { top: var(--aibu-topbar-height); height: calc(100dvh - var(--aibu-topbar-height)); }
body.create-page .main-content { height: calc(100dvh - var(--aibu-topbar-height)) !important; }
body.ecom-canvas-page .ecom-shell { height: calc(100dvh - var(--aibu-topbar-height)); min-height: 0; }
body.ecom-canvas-page .ecom-body { min-height: 0; }
body .expiry-reminder-stack:empty { display: none; }
body.ecom-canvas-page .expiry-reminder-stack,
body.create-page .expiry-reminder-stack { position: fixed; top: var(--aibu-topbar-height); right: 16px; width: min(380px, calc(100vw - 32px)); max-height: 50dvh; overflow-y: auto; z-index: 1301; }
@media (max-width: 760px) { body .aibu-topbar .aibu-topbar__search { display: none; } }
@media (max-width: 1060px) { body .aibu-topbar__links { display: none; } }
@media (max-width: 600px) {
    body .aibu-topbar { gap: 8px; padding: 8px 10px; }
    body .aibu-topbar .aibu-topbar__brand { flex-basis: 108px; width: 108px; }
    body .aibu-topbar .aibu-topbar__brand img { width: 108px; height: 30px; }
    body .aibu-topbar__actions { gap: 6px; }
    body .aibu-topbar__actions > .primary-button, body .aibu-topbar__actions > [data-points-badge] { display: none; }
    body .aibu-topbar .user-dropdown { position: fixed; top: var(--aibu-topbar-height); right: 10px; }
    body .aibu-topbar__actions > button { padding: 0 8px; }
}
@media (max-width: 380px) {
    body .aibu-topbar .aibu-auth-full { display: none; }
    body .aibu-topbar .aibu-auth-short { display: inline; }
    body .aibu-topbar .aibu-topbar__brand { flex-basis: 96px; width: 96px; }
}
/* Account actions stay in the account menu, leaving the header for search and balance. */
body .aibu-topbar .ud-menu .nav-checkin-button { width: 100%; text-align: left; }
body .aibu-topbar .ud-menu [data-checkin-label] { display: inline; }
