:root {
    --bps-ink: #10243b;
    --bps-navy: #08233e;
    --bps-deep: #06192d;
    --bps-red: #c72d3f;
    --bps-red-dark: #a82033;
    --bps-teal: #138979;
    --bps-muted: #617184;
    --bps-line: #dce4e9;
    --bps-soft: #f3f6f7;
    --bps-white: #fff;
    --bps-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.bps-topbar,
.bps-header,
.bps-topbar *,
.bps-header * {
    box-sizing: border-box;
}

.bps-shell {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.bps-topbar {
    position: relative;
    z-index: 1002;
    min-height: 38px;
    color: #d7e3ec;
    background: var(--bps-deep);
    font-family: var(--bps-font);
    font-size: 13px;
    line-height: 1.5;
}

.bps-topbar-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.bps-topbar-message {
    margin: 0;
    white-space: nowrap;
}

.bps-topbar-contact,
.bps-language {
    display: flex;
    align-items: center;
}

.bps-topbar-contact {
    gap: 20px;
}

.bps-topbar-contact > a {
    color: #d7e3ec !important;
    text-decoration: none !important;
}

.bps-topbar-contact > a:hover {
    color: #fff !important;
}

.bps-language {
    gap: 10px;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .2);
}

.bps-language a {
    color: #d7e3ec !important;
    opacity: .6;
    text-decoration: none !important;
}

.bps-language a.active,
.bps-language a:hover {
    color: #65d6c7 !important;
    opacity: 1;
}

.bps-header {
    position: sticky;
    top: 0;
    z-index: 1001;
    height: 76px;
    border: 0 !important;
    border-bottom: 1px solid rgba(220, 228, 233, .9) !important;
    background: rgba(255, 255, 255, .96);
    box-shadow: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: var(--bps-font);
}

.bps-header-inner {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.bps-logo {
    display: flex;
    align-items: center;
    flex: 0 0 164px;
    min-width: 164px;
    border: 0 !important;
    text-decoration: none !important;
}

.bps-logo img,
.bps-logo img.bplan-brand-logo {
    display: block !important;
    width: 164px !important;
    max-width: 164px !important;
    height: auto !important;
    max-height: 52px !important;
    object-fit: contain !important;
    object-position: left center !important;
}

.bps-nav {
    height: 76px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin-left: auto;
}

.bps-nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #42566a !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    text-decoration: none !important;
}

.bps-nav a::after {
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 3px;
    background: var(--bps-red);
    content: "";
    transform: scaleX(0);
    transition: transform .2s ease;
}

.bps-nav a:hover,
.bps-nav a.active {
    color: var(--bps-navy) !important;
}

.bps-nav a:hover::after,
.bps-nav a.active::after {
    transform: scaleX(1);
}

.bps-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bps-login {
    padding: 9px 4px;
    border: 0 !important;
    color: var(--bps-navy) !important;
    background: transparent !important;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer;
}

.bps-login:hover {
    color: var(--bps-red) !important;
}

.bps-cta {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px !important;
    border: 0 !important;
    border-radius: 6px !important;
    color: #fff !important;
    background: var(--bps-red) !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .2s ease, transform .2s ease;
}

.bps-cta:hover {
    color: #fff !important;
    background: var(--bps-red-dark) !important;
    transform: translateY(-1px);
}

.bps-menu {
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--bps-navy);
    background: var(--bps-soft);
    cursor: pointer;
}

.bps-menu span {
    width: 22px;
    height: 2px;
    display: block;
    margin: 3px 0;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.bps-header.is-open .bps-menu span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.bps-header.is-open .bps-menu span:nth-child(2) {
    opacity: 0;
}

.bps-header.is-open .bps-menu span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Exact alignment for legacy public detail pages until their body templates are migrated. */
.bp-v105-shell {
    width: min(1200px, calc(100% - 48px)) !important;
}

.bp-v105-topline-inner {
    min-height: 38px !important;
}

.bp-v105-header-inner {
    height: 76px !important;
    gap: 34px !important;
}

.bp-v105-logo {
    min-width: 164px !important;
}

.bp-v105-nav {
    height: 76px !important;
    align-items: stretch !important;
    gap: 4px !important;
}

.bp-v105-nav a {
    align-items: center !important;
    padding: 0 14px !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-weight: 650 !important;
}

@media (max-width: 1000px) {
    .bps-topbar-message {
        display: none;
    }

    .bps-topbar-inner {
        justify-content: flex-end;
    }

    .bps-header,
    .bps-header-inner {
        height: 68px;
    }

    .bps-header-inner {
        gap: 14px;
    }

    .bps-menu {
        display: flex;
    }

    .bps-nav {
        position: absolute;
        top: 68px;
        right: 0;
        left: 0;
        height: auto;
        display: none;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 10px 16px 16px;
        border-bottom: 1px solid var(--bps-line);
        background: #fff;
        box-shadow: 0 18px 34px rgba(8, 35, 60, .14);
    }

    .bps-header.is-open .bps-nav {
        display: flex;
    }

    .bps-nav a {
        min-height: 44px;
        justify-content: flex-start;
        padding: 0 12px !important;
    }

    .bps-nav a::after {
        right: auto;
        bottom: 5px;
        left: 12px;
        width: 28px;
    }

    .bps-actions {
        margin-left: auto;
    }

    .bp-v105-header-inner {
        height: 68px !important;
    }
}

@media (max-width: 560px) {
    .bps-shell {
        width: min(100% - 32px, 1200px);
    }

    .bps-topbar {
        display: none;
    }

    .bps-logo {
        flex-basis: 142px;
        min-width: 142px;
    }

    .bps-logo img,
    .bps-logo img.bplan-brand-logo {
        width: 142px !important;
        max-width: 142px !important;
    }

    .bps-actions {
        gap: 8px;
    }

    .bps-cta {
        display: none;
    }

    .bps-login {
        font-size: 13px;
    }
}
