.site-header {
            position: sticky;
            top: 0;
            z-index: 1000;
            border-bottom: 1px solid rgba(148, 163, 184, 0.16);
            background: color-mix(in srgb, var(--bg, #080d1d) 88%, transparent);
            box-shadow: 0 12px 35px rgba(2, 6, 23, 0.18);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
        }

        .site-header .nav-wrap {
            min-height: 86px;
            display: grid;
            grid-template-columns: 172px minmax(0, 1fr) auto;
            align-items: center;
            gap: clamp(1.25rem, 2.5vw, 2.75rem);
        }

        .site-header .brand {
            display: inline-flex;
            align-items: center;
            width: fit-content;
        }

        .site-header .brand-logo {
            width: 145px;
            height: auto;
            display: block;
            transition: transform 0.25s ease, filter 0.25s ease;
        }

        .site-header .brand:hover .brand-logo {
            transform: translateY(-1px) scale(1.02);
            filter: drop-shadow(0 8px 18px rgba(56, 189, 248, 0.2));
        }

        .site-header .site-nav {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: clamp(0.15rem, 0.5vw, 0.45rem);
            min-width: 0;
        }

        .site-header .site-nav a {
            position: relative;
            display: inline-flex;
            align-items: center;
            min-height: 42px;
            padding: 0 0.72rem;
            border-radius: 0.7rem;
            color: var(--muted, #aab5d1);
            font-size: 0.93rem;
            font-weight: 600;
            line-height: 1;
            text-decoration: none;
            white-space: nowrap;
            transition: color 0.2s ease, background 0.2s ease;
        }

        .site-header .site-nav a:hover,
        .site-header .site-nav a.is-active {
            color: var(--text, #f8fafc);
            background: rgba(148, 163, 184, 0.09);
        }

        .site-header .site-nav a.is-active::after {
            content: '';
            position: absolute;
            left: 0.72rem;
            right: 0.72rem;
            bottom: 3px;
            height: 2px;
            border-radius: 999px;
            background: linear-gradient(90deg, #38bdf8, #22d3ee);
            box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
        }

        .site-header .nav-actions {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            white-space: nowrap;
        }

        .portal-subnav {
            border-top: 1px solid rgba(148, 163, 184, .1);
            background: color-mix(in srgb, var(--surface, #111827) 90%, transparent);
        }

        .portal-subnav-inner {
            min-height: 54px;
            display: grid;
            grid-template-columns: 145px minmax(0, 1fr) auto;
            align-items: center;
            gap: clamp(1rem, 2vw, 2rem);
        }

        .portal-subnav-label,
        .mobile-nav-section-label {
            color: var(--muted, #94a3b8);
            font-size: .72rem;
            font-weight: 800;
            letter-spacing: .08em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .portal-subnav-links {
            min-width: 0;
            display: flex;
            align-items: stretch;
            justify-content: center;
            gap: .12rem;
        }

        .portal-subnav-links a {
            position: relative;
            min-height: 54px;
            display: inline-flex;
            align-items: center;
            padding: 0 .68rem;
            color: var(--muted, #aab5d1);
            font-size: .84rem;
            font-weight: 650;
            text-decoration: none;
            white-space: nowrap;
        }

        .portal-subnav-links a:hover,
        .portal-subnav-links a.is-active {
            color: var(--text, #f8fafc);
        }

        .portal-subnav-links a.is-active::after {
            content: '';
            position: absolute;
            left: .68rem;
            right: .68rem;
            bottom: 0;
            height: 3px;
            border-radius: 3px 3px 0 0;
            background: linear-gradient(90deg, #38bdf8, #22d3ee);
            box-shadow: 0 0 12px rgba(34, 211, 238, .45);
        }

        .portal-subnav-logout {
            margin: 0;
        }

        .portal-subnav-logout button {
            min-height: 38px;
            padding: 0 .7rem;
            border: 0;
            border-radius: .65rem;
            background: transparent;
            color: var(--muted, #aab5d1);
            font: inherit;
            font-size: .82rem;
            font-weight: 650;
            cursor: pointer;
        }

        .portal-subnav-logout button:hover {
            background: rgba(248, 113, 113, .08);
            color: #fca5a5;
        }

        .header-account-menu {
            position: relative;
            z-index: 30;
        }

        .header-account-menu summary {
            min-height: 42px;
            display: inline-flex;
            align-items: center;
            gap: .48rem;
            padding: 0 .78rem;
            border: 1px solid rgba(148, 163, 184, .22);
            border-radius: .75rem;
            background: rgba(148, 163, 184, .07);
            color: var(--text, #f8fafc);
            font-size: .88rem;
            font-weight: 750;
            list-style: none;
            cursor: pointer;
        }

        .header-account-menu summary::-webkit-details-marker {
            display: none;
        }

        .header-account-menu summary:hover,
        .header-account-menu[open] summary {
            border-color: rgba(56, 189, 248, .48);
            background: rgba(56, 189, 248, .11);
        }

        .header-account-menu summary svg {
            width: 18px;
            height: 18px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .header-account-menu .header-account-chevron {
            width: 14px;
            height: 14px;
            color: var(--muted, #94a3b8);
            transition: transform .2s ease;
        }

        .header-account-menu[open] .header-account-chevron {
            transform: rotate(180deg);
        }

        .header-account-dropdown {
            position: absolute;
            top: calc(100% + .65rem);
            right: 0;
            width: 190px;
            padding: .45rem;
            border: 1px solid rgba(148, 163, 184, .22);
            border-radius: .9rem;
            background: #111827;
            box-shadow: 0 22px 55px rgba(2, 6, 23, .48);
        }

        .header-account-dropdown a,
        .header-account-dropdown button {
            width: 100%;
            min-height: 42px;
            display: flex;
            align-items: center;
            padding: .55rem .72rem;
            border: 0;
            border-radius: .62rem;
            background: transparent;
            color: #dbe5f5;
            font: inherit;
            font-size: .9rem;
            font-weight: 650;
            text-align: left;
            text-decoration: none;
            cursor: pointer;
            box-sizing: border-box;
        }

        .header-account-dropdown a:hover,
        .header-account-dropdown button:hover {
            background: rgba(56, 189, 248, .12);
            color: #fff;
        }

        .header-account-dropdown form {
            margin: 0;
        }

        html[data-theme="light"] .header-account-dropdown {
            border-color: rgba(15, 23, 42, .14);
            background: #fff;
            box-shadow: 0 20px 48px rgba(15, 23, 42, .18);
        }

        html[data-theme="light"] .header-account-dropdown a,
        html[data-theme="light"] .header-account-dropdown button {
            color: #26334a;
        }

        html[dir="rtl"] .header-account-dropdown {
            right: auto;
            left: 0;
        }

        html[dir="rtl"] .header-account-dropdown a,
        html[dir="rtl"] .header-account-dropdown button {
            text-align: right;
        }

        .site-header .theme-toggle {
            width: 42px;
            height: 42px;
            padding: 0;
            display: inline-grid;
            place-items: center;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 50%;
            background: rgba(148, 163, 184, 0.07);
            color: var(--text, #f8fafc);
            cursor: pointer;
            box-shadow: none;
            transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
        }

        .site-header .theme-toggle:hover {
            transform: translateY(-1px) rotate(8deg);
            border-color: rgba(56, 189, 248, 0.45);
            background: rgba(56, 189, 248, 0.1);
        }

        .site-header .header-action {
            min-height: 42px;
            padding: 0 1rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 0.75rem;
            background: rgba(148, 163, 184, 0.065);
            color: var(--text, #f8fafc);
            font-size: 0.9rem;
            font-weight: 750;
            line-height: 1;
            text-decoration: none;
            cursor: pointer;
            transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
        }

        .site-header .header-action:hover {
            transform: translateY(-1px);
            border-color: rgba(56, 189, 248, 0.38);
            background: rgba(56, 189, 248, 0.1);
        }

        .site-header .header-action-primary {
            border-color: transparent;
            background: linear-gradient(135deg, #0ea5e9, #22c1dc);
            color: #fff;
            box-shadow: 0 8px 22px rgba(14, 165, 233, 0.22);
        }

        .site-header .header-action-primary:hover {
            border-color: transparent;
            background: linear-gradient(135deg, #0284c7, #06b6d4);
            box-shadow: 0 10px 26px rgba(14, 165, 233, 0.3);
        }

        .site-header .header-logout {
            padding-inline: 0.8rem;
            border-color: transparent;
            background: transparent;
            color: var(--muted, #aab5d1);
        }

        .site-header .header-logout:hover {
            border-color: rgba(248, 113, 113, 0.2);
            background: rgba(248, 113, 113, 0.08);
            color: #fca5a5;
        }

        .site-header .inline-form {
            margin: 0;
        }

        .site-header .mobile-nav-toggle {
            display: none;
            width: 44px;
            height: 44px;
            padding: 0;
            place-items: center;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 0.75rem;
            background: rgba(148, 163, 184, 0.07);
            color: var(--text, #f8fafc);
            font-size: 1.25rem;
            cursor: pointer;
        }

        .site-header .mobile-nav-inner {
            gap: 0.35rem;
            padding-top: 0.75rem;
            padding-bottom: 1rem;
        }

        .site-header .mobile-nav-account {
            display: grid;
            gap: 0.5rem;
            margin-top: 0.65rem;
            padding-top: 0.9rem;
            border-top: 1px solid rgba(148, 163, 184, 0.16);
        }

        .mobile-nav-section-label {
            display: block;
            margin-top: .35rem;
            padding: .65rem .15rem .2rem;
        }

        .site-header .mobile-theme-toggle {
            width: 100%;
            text-align: left;
        }

        /*
         * The mobile menu is an overlay drawn on top of page content, so it
         * needs a genuinely solid background of its own. In dark theme,
         * --card (rgba(255,255,255,0.05)) and --bg mixed with transparent
         * are both too see-through for that job on their own — the hero
         * text underneath was bleeding straight through every menu item.
         * --bg / --bg-soft are solid opaque colours in both themes, so we
         * use those here instead, scoped to just the mobile menu.
         */
        .site-header .mobile-nav {
            background: var(--bg, #0b1020);
        }

        .site-header .mobile-nav-inner a,
        .site-header .mobile-nav-inner form button {
            background: var(--bg-soft, #11182b);
        }

        @media (max-width: 1180px) {
            body.mobile-nav-open {
                overflow: hidden;
                overscroll-behavior: none;
            }

            .site-header .nav-wrap {
                min-height: 76px;
                grid-template-columns: 1fr auto;
            }

            .site-header .site-nav,
            .site-header .nav-actions,
            .portal-subnav {
                display: none;
            }

            .site-header .mobile-nav-toggle {
                display: grid;
            }

            .site-header .mobile-nav.is-open {
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                display: block !important;
                max-height: calc(100dvh - 76px - env(safe-area-inset-bottom, 0px));
                overflow-x: hidden;
                overflow-y: auto;
                overscroll-behavior: contain;
                -webkit-overflow-scrolling: touch;
                box-shadow: 0 24px 50px rgba(2, 6, 23, .42);
            }

            .site-header .mobile-nav-inner {
                padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
            }

            .site-header .brand-logo {
                width: 138px;
            }
        }