/* Keep public/member document footers at the bottom of short pages. */
body.public-shell,
body.member-shell:not(.trading-custom-shell) {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

body.public-shell > footer,
body.member-shell:not(.trading-custom-shell) > footer {
    margin-top: auto;
}

/* BEGIN extracted: includes/header.php user surface rules */
body.member-shell:not(.trading-custom-shell) {
    --background: 210 40% 98%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;
    --muted: 210 40% 94%;
    --muted-foreground: 215 16% 44%;
    --accent: 210 40% 94%;
    --accent-foreground: 222 47% 11%;
    --border: 214 32% 88%;
    --input: 214 32% 88%;
    --success: 158 86% 43%;
    --dashboard-shell-bg: #f4f7fa;
    --dashboard-radius: 8px;
    --dashboard-card-bg: #ffffff;
    --dashboard-soft-bg: rgba(15, 23, 42, .045);
    --dashboard-card-border: rgba(15, 23, 42, .10);
    --dashboard-card-shadow: 0 6px 18px rgba(15, 23, 42, .055);
    --dashboard-action-text: rgba(15, 23, 42, .58);
    --dashboard-portfolio-bg: #ffffff;
    background: var(--dashboard-shell-bg) !important;
    color: hsl(var(--foreground));
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

html.dark body.member-shell:not(.trading-custom-shell) {
    --background: 221 50% 4%;
    --foreground: 0 0% 100%;
    --card: 222 37% 10%;
    --card-foreground: 0 0% 100%;
    --popover: 222 37% 10%;
    --popover-foreground: 0 0% 100%;
    --muted: 220 30% 15%;
    --muted-foreground: 216 18% 66%;
    --accent: 221 32% 14%;
    --accent-foreground: 0 0% 100%;
    --border: 218 25% 18%;
    --input: 218 25% 18%;
    --dashboard-shell-bg: #090a0c;
    --dashboard-radius: 8px;
    --dashboard-card-bg: #111316;
    --dashboard-soft-bg: rgba(255, 255, 255, .04);
    --dashboard-card-border: rgba(255, 255, 255, .08);
    --dashboard-card-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    --dashboard-action-text: rgba(248, 250, 252, .56);
    --dashboard-portfolio-bg: #111316;
    background: var(--dashboard-shell-bg) !important;
}

body.public-shell {
    --background: 210 40% 98%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;
    --muted: 210 40% 94%;
    --muted-foreground: 215 16% 44%;
    --accent: 210 40% 94%;
    --accent-foreground: 222 47% 11%;
    --border: 214 32% 88%;
    --input: 214 32% 88%;
    --success: 158 86% 43%;
    --dashboard-shell-bg: #f4f7fa;
    --dashboard-radius: 8px;
    --dashboard-card-bg: #ffffff;
    --dashboard-soft-bg: rgba(15, 23, 42, .045);
    --dashboard-card-border: rgba(15, 23, 42, .10);
    --dashboard-card-shadow: 0 6px 18px rgba(15, 23, 42, .055);
    --dashboard-portfolio-bg: #ffffff;
    background: var(--dashboard-shell-bg) !important;
    color: hsl(var(--foreground));
    font-family: 'Inter', system-ui, sans-serif;
}

html.dark body.public-shell {
    --background: 221 50% 4%;
    --foreground: 0 0% 100%;
    --card: 222 37% 10%;
    --card-foreground: 0 0% 100%;
    --popover: 222 37% 10%;
    --popover-foreground: 0 0% 100%;
    --muted: 220 30% 15%;
    --muted-foreground: 216 18% 66%;
    --accent: 221 32% 14%;
    --accent-foreground: 0 0% 100%;
    --border: 218 25% 18%;
    --input: 218 25% 18%;
    --dashboard-shell-bg: #090a0c;
    --dashboard-card-bg: #111316;
    --dashboard-soft-bg: rgba(255, 255, 255, .04);
    --dashboard-card-border: rgba(255, 255, 255, .08);
    --dashboard-card-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    --dashboard-portfolio-bg: #111316;
    background: var(--dashboard-shell-bg) !important;
}

/* When no dedicated dark logo is configured, keep dark headers readable. */
html.dark :is(body.member-shell, body.public-shell) .theme-logo-single {
    filter: brightness(0) invert(1);
}

/* Dark surfaces always start from a live white foreground. Descendants may
 * still opt into semantic success, warning, danger, or muted colours. */
html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    #mainHeader,
    [role="dialog"],
    .member-card,
    .site-card,
    .dashboard-surface-card,
    .dashboard-wallet-card,
    .profile-card,
    .wallet-card,
    .transaction-card,
    .swap-panel,
    .wallet-panel,
    .deposit-card,
    .withdraw-card,
    .bg-card,
    .dark\:bg-black,
    .dark\:bg-zinc-900
) {
    color: #fff;
}

html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .text-foreground,
    .text-card-foreground,
    .text-popover-foreground,
    .dark\:text-white
) {
    color: #fff !important;
}

/*
 * User-facing brand tokens. Keep the first declaration for every token
 * usable in browsers without color-mix(), then enhance it below with a
 * single-hue tonal ramp derived from the admin-configured --primary.
 * Trading has its own visual system and is intentionally excluded.
 */
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) {
    --theme-primary: hsl(var(--primary));
    --theme-primary-fg: hsl(var(--primary-foreground));
    --theme-primary-light: hsl(var(--primary));
    --theme-primary-dark: hsl(var(--primary));
    --theme-primary-gradient: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary)));
    --theme-primary-soft-gradient: linear-gradient(135deg, hsl(var(--primary) / .09), hsl(var(--primary) / .09));
    --theme-primary-glow: hsl(var(--primary) / .28);
    --theme-primary-shadow: 0 12px 30px hsl(var(--primary) / .22);
    --theme-primary-text-on-light: hsl(var(--primary));
    --theme-primary-text-on-dark: hsl(var(--primary));
}

@supports (color: color-mix(in srgb, white, black)) {
    :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) {
        --theme-primary-light: color-mix(in srgb, var(--theme-primary) 72%, white);
        --theme-primary-dark: color-mix(in srgb, var(--theme-primary) 78%, black);
        --theme-primary-gradient: linear-gradient(135deg, var(--theme-primary-light), var(--theme-primary) 52%, var(--theme-primary-dark));
        --theme-primary-soft-gradient: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 14%, transparent), color-mix(in srgb, var(--theme-primary) 5%, transparent));
        --theme-primary-glow: color-mix(in srgb, var(--theme-primary) 30%, transparent);
        --theme-primary-shadow: 0 12px 30px color-mix(in srgb, var(--theme-primary) 24%, transparent);
        --theme-primary-text-on-light: color-mix(in srgb, var(--theme-primary) 35%, #111827 65%);
        --theme-primary-text-on-dark: color-mix(in srgb, var(--theme-primary) 35%, white 65%);
    }
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .text-primary {
    color: var(--theme-primary-text-on-light) !important;
}

html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .text-primary {
    color: var(--theme-primary-text-on-dark) !important;
}

body.public-shell :is(.site-card,
    .card-glass,
    .home-market-panel,
    .home-feature,
    .home-step,
    .home-cta,
    .glass-card,
    .auth-card) {
    background: var(--dashboard-card-bg) !important;
    border: 1px solid var(--dashboard-card-border) !important;
    border-radius: var(--dashboard-radius) !important;
    color: hsl(var(--foreground)) !important;
    box-shadow: var(--dashboard-card-shadow) !important;
}

body.public-shell :is(.site-button-primary,
    .home-btn-primary) {
    background: hsl(var(--primary)) !important;
    background-image: none !important;
    border: 1px solid hsl(var(--primary)) !important;
    border-radius: var(--dashboard-radius) !important;
    color: hsl(var(--primary-foreground)) !important;
    box-shadow: none !important;
}

body.public-shell :is(.site-accent-text) {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: hsl(var(--primary)) !important;
}

body.public-shell :is(input,
    select,
    textarea) {
    min-height: 44px;
    border-color: var(--dashboard-card-border) !important;
    border-radius: var(--dashboard-radius) !important;
}

body.public-shell .hover-lift:hover {
    transform: translateY(-1px);
}

body.member-shell:not(.trading-custom-shell) .fixed.inset-0.-z-10 {
    opacity: .45;
}

body.member-shell:not(.trading-custom-shell) main,
body.member-shell:not(.trading-custom-shell) .main-content,
body.member-shell:not(.trading-custom-shell) .page-content {
    color: hsl(var(--foreground));
}

body.member-shell:not(.trading-custom-shell) :is(.dashboard-wallet-card,
    .dashboard-surface-card,
    .member-card,
    .profile-card,
    .wallet-card,
    .transaction-card,
    .swap-panel,
    .wallet-panel,
    .wallet-card,
    .deposit-card,
    .withdraw-card) {
    background: var(--dashboard-card-bg) !important;
    border-color: var(--dashboard-card-border) !important;
    color: hsl(var(--foreground)) !important;
    box-shadow: var(--dashboard-card-shadow) !important;
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) :is(.swap-panel,
    .wallet-panel) {
    border-color: var(--dashboard-card-border) !important;
}

body.member-shell:not(.trading-custom-shell) :is(
    div,
    section,
    article,
    form
):is(.swap-panel, .wallet-panel):is(.border, .border-border) {
    background: var(--dashboard-card-bg) !important;
    border-color: var(--dashboard-card-border) !important;
    box-shadow: var(--dashboard-card-shadow) !important;
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) .member-page-shell {
    min-height: calc(100vh - 64px);
    background: var(--dashboard-shell-bg);
    color: hsl(var(--foreground));
}

body.member-shell:not(.trading-custom-shell) .member-page-container {
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
}

body.member-shell:not(.trading-custom-shell) .member-page-header {
    color: hsl(var(--foreground));
}

body.member-shell:not(.trading-custom-shell) :is(.member-card,
    .member-stat-card,
    .member-action-card,
    .member-table-card,
    .member-empty-state) {
    background: var(--dashboard-card-bg) !important;
    border: 1px solid var(--dashboard-card-border) !important;
    border-radius: var(--dashboard-radius) !important;
    color: hsl(var(--foreground)) !important;
    box-shadow: var(--dashboard-card-shadow) !important;
}

body.member-shell:not(.trading-custom-shell) .member-stat-card {
    min-height: 66px;
}

body.member-shell:not(.trading-custom-shell) .member-action-card {
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

body.member-shell:not(.trading-custom-shell) .member-action-card:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, hsl(var(--primary)) 7%, var(--dashboard-card-bg)) !important;
    border-color: color-mix(in srgb, hsl(var(--primary)) 30%, var(--dashboard-card-border)) !important;
}

body.member-shell:not(.trading-custom-shell) :is(.member-input,
    input.member-input,
    select.member-input,
    textarea.member-input) {
    min-height: 44px;
    border: 1px solid var(--dashboard-card-border) !important;
    border-radius: var(--dashboard-radius) !important;
    background: var(--dashboard-soft-bg) !important;
    color: hsl(var(--foreground)) !important;
    outline: none;
}

body.member-shell:not(.trading-custom-shell) .member-button {
    border-radius: var(--dashboard-radius) !important;
    font-weight: 700;
}

body.member-shell:not(.trading-custom-shell) .member-alert {
    border-radius: var(--dashboard-radius) !important;
    box-shadow: none !important;
}

body.member-shell:not(.trading-custom-shell) .member-table-card {
    overflow: hidden;
}

body.member-shell:not(.trading-custom-shell) :is(input,
    select,
    textarea) {
    min-height: 44px;
    font-size: 14px;
}

body.member-shell:not(.trading-custom-shell) :is(h1,
    h2,
    h3,
    .text-lg,
    .text-xl,
    .text-2xl) {
    letter-spacing: 0;
}

body.member-shell:not(.trading-custom-shell) :is(.bg-accent,
    .bg-accent\/50,
    .bg-muted) {
    background-color: var(--dashboard-soft-bg) !important;
}

body.member-shell:not(.trading-custom-shell) :is(input,
    select,
    textarea) {
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) :is(.deposit-page-scroll,
    .withdraw-page-scroll,
    .transactions-page-scroll,
    .exchange-page-scroll,
    .wallet-pro-app > div,
    .swap-pro-app > div) {
    max-width: 1400px !important;
}

body.member-shell:not(.trading-custom-shell) .member-header-inner {
    width: min(1400px, calc(100% - 2rem));
    max-width: 1400px !important;
    margin-inline: auto;
    padding-inline: 0 !important;
}

body.member-shell:not(.trading-custom-shell) #mainHeader {
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid hsl(var(--border) / .75);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

html.dark body.member-shell:not(.trading-custom-shell) #mainHeader {
    background: hsl(var(--background) / .82);
}

body.member-shell:not(.trading-custom-shell) #headerGradientOverlay,
body.member-shell:not(.trading-custom-shell) #headerBottomLine {
    display: none;
}

body.member-shell:not(.trading-custom-shell) #sidebarMenu {
    background: hsl(var(--card));
    border-color: hsl(var(--border));
    box-shadow: -20px 0 60px rgba(15, 23, 42, .18);
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild {
    min-height: calc(100vh - 64px);
    background: var(--dashboard-shell-bg);
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-container {
    max-width: 1400px !important;
    padding-inline: clamp(1rem, 3vw, 2rem) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-header {
    padding: 1.35rem 0 1rem !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-header > div {
    padding-inline: 0 !important;
    padding-bottom: 0 !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-header h1 {
    font-size: clamp(1.25rem, 2vw, 1.65rem) !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-header .member-alert {
    display: none !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .animate-panel-fade {
    animation: none !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-card,
body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-empty-state,
body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-table-card {
    border-radius: var(--dashboard-radius) !important;
    box-shadow: var(--dashboard-card-shadow) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-card:hover {
    border-color: color-mix(in srgb, hsl(var(--primary)) 18%, var(--dashboard-card-border)) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild :is(input, select, textarea, .member-input) {
    min-height: 46px;
    background: var(--dashboard-soft-bg) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-button {
    min-height: 42px;
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-action-card {
    padding: .65rem;
    text-decoration: none;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-action-card > div {
    height: 42px !important;
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild :is(#deposit-step1, #deposit-step2) > .flex:first-child {
    margin-bottom: .65rem;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild :is(.deposit-method, .withdraw-method, .plan-card) {
    border-radius: var(--dashboard-radius) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild .lg\:grid {
    align-items: start;
}

@media (min-width: 1024px) {
    body.member-shell:not(.trading-custom-shell) .transaction-rebuild .lg\:grid-cols-\[1fr_360px\] {
        grid-template-columns: minmax(0, 1fr) 400px !important;
    }
}

body.member-shell:not(.trading-custom-shell) .transaction-list-rebuild .member-card > a,
body.member-shell:not(.trading-custom-shell) .transaction-rebuild a[href*="transactions-details.php"] {
    border-radius: 0 !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-rebuild a[href*="transactions-details.php"]:hover {
    background: color-mix(in srgb, hsl(var(--primary)) 5%, var(--dashboard-card-bg)) !important;
}

body.member-shell:not(.trading-custom-shell) .transaction-detail-rebuild .member-card:first-of-type {
    max-width: 760px;
    margin-inline: auto;
}

@media (max-width: 1023px) {
    /* Use the dashboard mobile canvas width consistently on every member page. */
    body.member-shell:not(.trading-custom-shell) :is(
        #dash-scroll-root,
        .member-page-shell,
        .member-page-container,
        [class$="-page-scroll"],
        [class*="-page-scroll "],
        .profile-edit-scroll,
        .wallet-pro-app,
        .swap-pro-app,
        .mkts-wrap
    ) {
        width: 100% !important;
        max-width: 430px !important;
        margin-inline: auto !important;
    }

    body.member-shell:not(.trading-custom-shell) {
        min-height: 100%;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.member-shell:not(.trading-custom-shell) :is(
        #dash-scroll-root,
        .member-page-shell,
        .member-page-container,
        [class$="-page-scroll"],
        [class*="-page-scroll "]
    ) {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-container {
        padding-inline: 0 !important;
    }

    body.member-shell:not(.trading-custom-shell) .transaction-rebuild .member-page-header {
        padding-inline: 1rem !important;
    }

}

body.member-shell:not(.trading-custom-shell) .ih-bottom-nav {
    background: rgba(255, 255, 255, .92);
    border-color: hsl(var(--border));
}

html.dark body.member-shell:not(.trading-custom-shell) .ih-bottom-nav {
    background: hsl(var(--card) / .92);
}

body.member-shell:not(.trading-custom-shell) .ih-nav-trade-btn {
    border-radius: 16px;
}

@media (min-width: 1024px) {
    body.member-shell:not(.trading-custom-shell) main:not([data-investment-deal-screen]) {
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 767px) {
    body.member-shell:not(.trading-custom-shell) {
        font-size: 14px;
    }

    body.member-shell:not(.trading-custom-shell) :is(.px-4, .p-4) {
        --member-mobile-pad: 1rem;
    }
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/*
 * Unified user-facing card contract.
 * Trading and admin intentionally remain outside this selector.
 */
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) {
    --portfolio-card-surface: var(--dashboard-portfolio-bg, var(--dashboard-card-bg, hsl(var(--card))));
    --portfolio-card-border: hsl(var(--primary) / .22);
    --portfolio-card-radius: var(--dashboard-radius, 8px);
    --portfolio-card-shadow: var(--dashboard-card-shadow, 0 6px 18px rgba(15, 23, 42, .07));
    --portfolio-card-hover: color-mix(in srgb, hsl(var(--primary)) 6%, var(--portfolio-card-surface));
    --portfolio-card-selected: color-mix(in srgb, hsl(var(--primary)) 9%, var(--portfolio-card-surface));
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .dashboard-portfolio-card,
    .dashboard-wallet-card,
    .dashboard-surface-card,
    .dashboard-stat-card,
    .dashboard-desktop-card,
    .dashboard-activity-card,
    .dashboard-monthly-overview-card,
    .dashboard-line-chart-card,
    .dashboard-cryptoaw-market-card,
    .member-card,
    .member-stat-card,
    .member-action-card,
    .member-table-card,
    .member-empty-state,
    .site-card,
    .card-glass,
    .glass-card,
    .auth-card,
    .home-live-card,
    .home-product-card,
    .home-market-panel,
    .home-feature,
    .home-step,
    .home-cta,
    .profile-card,
    .wallet-card,
    .transaction-card,
    .deposit-card,
    .withdraw-card,
    .notification-card,
    .market-card,
    .stat-card,
    .page-card,
    .bc-card,
    .pr-card,
    .wallet-hero-shell,
    .wallet-market-panel,
    .swap-panel,
    .wallet-panel,
    .plan-card,
    .faq-item
) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--portfolio-card-surface) !important;
    border: 1px solid var(--portfolio-card-border) !important;
    border-radius: var(--portfolio-card-radius) !important;
    color: hsl(var(--foreground)) !important;
    box-shadow: var(--portfolio-card-shadow) !important;
}

/* Utility surfaces are not cards.  Keep only their surface colour so
 * inputs, dropdowns, sticky bars, modals and navs retain their own
 * border/radius/shadow and never inherit clipping. */
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .bg-card,
html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dark\:bg-card {
    background: var(--portfolio-card-surface) !important;
    color: hsl(var(--foreground)) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .bg-card\/40,
html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dark\:bg-card\/40 {
    background: color-mix(in srgb, var(--portfolio-card-surface) 40%, transparent) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .bg-card\/70,
html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dark\:bg-card\/70 {
    background: color-mix(in srgb, var(--portfolio-card-surface) 70%, transparent) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .bg-card\/95,
html.dark :is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dark\:bg-card\/95 {
    background: color-mix(in srgb, var(--portfolio-card-surface) 95%, transparent) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-action-card,
    .plan-card,
    .site-card,
    .home-product-card,
    .market-card,
    .wallet-card,
    .transaction-card
):hover {
    background: var(--portfolio-card-hover) !important;
    border-color: hsl(var(--primary) / .34) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .active,
    .selected,
    [aria-selected="true"],
    [aria-current="true"],
    [data-state="active"]
):is(
    .member-card,
    .member-action-card,
    .plan-card,
    .site-card,
    .market-card,
    .wallet-card,
    .transaction-card
) {
    background: var(--portfolio-card-selected) !important;
    border-color: hsl(var(--primary) / .42) !important;
    box-shadow: var(--portfolio-card-shadow), 0 0 0 1px hsl(var(--primary) / .14) inset !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-card,
    .site-card,
    .plan-card
):focus-visible,
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-card,
    .site-card,
    .plan-card
):focus-within {
    border-color: hsl(var(--primary) / .52) !important;
    box-shadow: var(--portfolio-card-shadow), 0 0 0 2px hsl(var(--primary) / .14) !important;
    outline: none !important;
}

/* Preserve semantic status borders while retaining the shared portfolio surface. */
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-card,
    .site-card,
    .plan-card,
    .member-alert
):is([class*="border-rose"], [class*="border-red"], [class*="border-destructive"]) {
    border-color: hsl(var(--destructive) / .45) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-card,
    .site-card,
    .plan-card,
    .member-alert
):is([class*="border-emerald"], [class*="border-green"], [class*="border-success"]) {
    border-color: hsl(var(--success) / .42) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) :is(
    .member-card,
    .site-card,
    .plan-card,
    .member-alert
):is([class*="border-amber"], [class*="border-yellow"], [class*="border-warning"]) {
    border-color: hsl(var(--warning) / .42) !important;
}

:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dashboard-portfolio-card::before,
:is(body.member-shell:not(.trading-custom-shell), body.public-shell:not(.trading-custom-shell)) .dashboard-portfolio-card::after {
    display: none !important;
}

/* Bicrypto5 SiteHeader port for public pages. */
body.public-shell:not(.trading-custom-shell) #mainHeader {
    min-height: 64px;
    border-bottom: 1px solid transparent !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, .82), rgba(255, 255, 255, .42)) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: bicryptoHeaderEnter .5s ease-out both;
}

body.public-shell:not(.trading-custom-shell) #mainHeader.nav-scrolled {
    border-bottom-color: rgba(228, 228, 231, .72) !important;
    background: rgba(255, 255, 255, .95) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

html.dark body.public-shell:not(.trading-custom-shell) #mainHeader {
    background: linear-gradient(to bottom, rgba(9, 9, 11, .92), rgba(9, 9, 11, .42)) !important;
}

html.dark body.public-shell:not(.trading-custom-shell) #mainHeader.nav-scrolled {
    border-bottom-color: rgba(63, 63, 70, .52) !important;
    background: rgba(9, 9, 11, .95) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .26) !important;
}

body.public-shell:not(.trading-custom-shell) .public-header-inner {
    width: min(1280px, calc(100% - 2rem));
    max-width: 1280px !important;
    padding-inline: 0 !important;
}

body.public-shell:not(.trading-custom-shell) .public-header-content {
    min-height: 64px;
}

body.public-shell:not(.trading-custom-shell) .public-logo-link {
    transition: transform .2s ease;
}

body.public-shell:not(.trading-custom-shell) .public-logo-link:hover {
    transform: scale(1.04);
}

body.public-shell:not(.trading-custom-shell) .bc-public-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: 1.25rem;
    margin-left: 2rem;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-trigger {
    position: relative;
    display: inline-flex;
    min-height: 64px;
    align-items: center;
    gap: .25rem;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    color: #52525b !important;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
}

html.dark body.public-shell:not(.trading-custom-shell) .bc-nav-trigger {
    color: #d4d4d8 !important;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-trigger:hover,
body.public-shell:not(.trading-custom-shell) .bc-nav-trigger.active {
    color: var(--theme-primary-text-on-light) !important;
}

html.dark body.public-shell:not(.trading-custom-shell) .bc-nav-trigger:hover,
html.dark body.public-shell:not(.trading-custom-shell) .bc-nav-trigger.active {
    color: var(--theme-primary-text-on-dark) !important;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-trigger.active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    content: "";
    border-radius: 999px 999px 0 0;
    background: currentColor;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-chevron {
    width: .9rem;
    height: .9rem;
    transition: transform .2s ease;
}

body.public-shell:not(.trading-custom-shell) .bc-nav-group:hover .bc-nav-chevron {
    transform: rotate(180deg);
}

body.public-shell:not(.trading-custom-shell) .bc-mega-panel {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    width: 20rem;
    padding: .6rem;
    border: 1px solid rgba(228, 228, 231, .75);
    border-radius: .75rem;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(.35rem);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    backdrop-filter: blur(22px);
}

html.dark body.public-shell:not(.trading-custom-shell) .bc-mega-panel {
    border-color: rgba(63, 63, 70, .68);
    background: rgba(24, 24, 27, .97);
    box-shadow: 0 24px 65px rgba(0, 0, 0, .36);
}

body.public-shell:not(.trading-custom-shell) .bc-nav-group:hover .bc-mega-panel,
body.public-shell:not(.trading-custom-shell) .bc-nav-group:focus-within .bc-mega-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.public-shell:not(.trading-custom-shell) .bc-mega-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .7rem;
    align-items: start;
    border-radius: .6rem;
    padding: .7rem;
    color: #27272a;
    text-decoration: none;
}

html.dark body.public-shell:not(.trading-custom-shell) .bc-mega-item {
    color: #e4e4e7;
}

body.public-shell:not(.trading-custom-shell) .bc-mega-item:hover {
    background: var(--theme-primary-soft-gradient);
}

body.public-shell:not(.trading-custom-shell) .bc-mega-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .7rem;
    background: var(--theme-primary-gradient);
    box-shadow: var(--theme-primary-shadow);
}

body.public-shell:not(.trading-custom-shell) .bc-mega-item strong,
body.public-shell:not(.trading-custom-shell) .bc-mega-item small {
    display: block;
}

body.public-shell:not(.trading-custom-shell) .bc-mega-item small {
    margin-top: .2rem;
    color: #71717a;
    font-size: .75rem;
    line-height: 1.4;
}

body.public-shell:not(.trading-custom-shell) .public-language-control > button {
    border: 1px solid transparent;
    color: #52525b !important;
}

html.dark body.public-shell:not(.trading-custom-shell) .public-language-control > button {
    color: #d4d4d8 !important;
}

body.public-shell:not(.trading-custom-shell) .public-language-control > button:hover {
    border-color: rgba(161, 161, 170, .34);
    background: rgba(161, 161, 170, .12) !important;
}

body.public-shell:not(.trading-custom-shell) .public-login-button,
body.public-shell:not(.trading-custom-shell) .public-signup-button {
    min-height: 2.5rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 600;
}

body.public-shell:not(.trading-custom-shell) .public-login-button {
    padding-inline: .85rem;
    color: #27272a !important;
}

html.dark body.public-shell:not(.trading-custom-shell) .public-login-button {
    color: #f4f4f5 !important;
}

body.public-shell:not(.trading-custom-shell) .public-login-button:hover {
    background: rgba(161, 161, 170, .12);
}

body.public-shell:not(.trading-custom-shell) .public-signup-button {
    border: 1px solid var(--theme-primary) !important;
    background: var(--theme-primary-gradient) !important;
    padding-inline: 1rem;
    color: var(--theme-primary-fg) !important;
    box-shadow: var(--theme-primary-shadow);
}

html.dark body.public-shell:not(.trading-custom-shell) .public-signup-button {
    border-color: var(--theme-primary-light) !important;
    background: var(--theme-primary-gradient) !important;
    color: var(--theme-primary-fg) !important;
}

body.public-shell:not(.trading-custom-shell) .public-signup-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--theme-primary-shadow), 0 0 0 1px var(--theme-primary-glow);
}

@keyframes bicryptoHeaderEnter {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1279px) {
    body.public-shell:not(.trading-custom-shell) .bc-public-nav {
        display: none !important;
    }
}

@media (max-width: 639px) {
    body.public-shell:not(.trading-custom-shell) .public-header-inner {
        width: calc(100% - 1rem);
    }

    body.public-shell:not(.trading-custom-shell) .public-header-left,
    body.public-shell:not(.trading-custom-shell) .public-header-actions {
        gap: .35rem;
    }

    body.public-shell:not(.trading-custom-shell) .public-logo-link img {
        max-width: 108px !important;
    }

    body.public-shell:not(.trading-custom-shell) .public-login-button {
        padding-inline: .45rem;
    }

    body.public-shell:not(.trading-custom-shell) .public-signup-button {
        padding-inline: .7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.public-shell:not(.trading-custom-shell) #mainHeader {
        animation: none;
    }
}

/* The terminal owns the full viewport and renders its own compact header.
 * Global member navigation is intentionally omitted on terminal routes. */
html:has(body.trading-custom-shell),
body.trading-custom-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

body.trading-custom-shell {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.trading-custom-shell #mainHeader {
    display: none !important;
}

body.trading-custom-shell #sidebarOverlay {
    display: none !important;
}

body.trading-custom-shell #sidebarMenu {
    display: none !important;
}

body.trading-custom-shell #fxPage {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
}
/* END extracted: includes/header.php user surface rules */
