#fx-header {
    padding-top: 3px;
    margin-bottom: 20px !important;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#fx-header .fx-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#fx-header .fx-header-right{
    display: flex;
    align-items: center;
    gap: 12px;
}
#fx-header .fx-header-tools,
#fx-header .fx-header-actions{
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

#fx-header .fx-chip-group{
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ── Responsive: Laptop / iPad Pro (≤1399px) ── */
@media (max-width: 1399px) {
    #fx-header .fx-header-inner { gap: 8px; }
    #fx-header .fx-header-chip { font-size: 0.78rem; padding: 6px 10px 6px 12px; }

    #fx-header .fx-steps-pill { padding: 7px 10px 7px 12px; gap: 10px; border-radius: 12px; }
    #fx-header .fx-steps-ring { width: 38px; height: 38px; }
    #fx-header .fx-steps-ring svg { width: 38px; height: 38px; }
    #fx-header .fx-steps-ring .ring-label { font-size: 0.68rem; }

    #fx-header .fx-mode-btn { width: 32px; height: 32px; font-size: 0.85rem; }

    #fx-header .fx-open-account-btn { padding: 7px 14px; font-size: 0.8rem; }
    #fx-header .fx-icon-btn { width: 34px; height: 34px; font-size: 0.95rem; }
    #fx-header .fx-avatar { width: 34px; height: 34px; }
}

/* ── Responsive: iPad Pro / small laptops (≤1199px) ── */
@media (max-width: 1199px) {
    /* Allow wrapping instead of overflow */
    #fx-header .fx-header-inner { flex-wrap: wrap; align-items: flex-start; }
    #fx-header .fx-header-divider { height: 26px; }

    #fx-header .fx-header-right{ flex-wrap: wrap; justify-content: flex-end; row-gap: 10px; }
    #fx-header .fx-header-tools{ gap: 10px; }
    #fx-header .fx-header-actions{ gap: 10px; }

    /* Slightly smaller coin icons (they were inline-styled 42px) */
    #fx-header .fx-coin-wrap img { width: 36px !important; height: 36px !important; }
}

/* ── Responsive: iPad Pro (1024×1366 / 1366×1024) ── */
@media (min-width: 1024px) and (max-width: 1366px) and (min-height: 900px) {
    #fx-header .fx-header-inner{ gap: 8px; }
    #fx-header .fx-header-right{ gap: 10px; }
    #fx-header .fx-header-tools,
    #fx-header .fx-header-actions{ gap: 10px; }

    /* Make wrapping predictable */
    #fx-header .fx-header-inner{ flex-wrap: wrap; }
    #fx-header .fx-header-left{
        flex: 1 1 auto;
        min-width: 260px;
        align-self: flex-start;
        margin-top: 4px;
    }
    #fx-header .fx-header-right{
        flex: 0 1 auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    /* Slightly smaller items so everything fits */
    #fx-header .fx-steps-pill{ padding: 7px 10px 7px 12px; border-radius: 12px; gap: 10px; }
    #fx-header .fx-steps-ring{ width: 36px; height: 36px; }
    #fx-header .fx-steps-ring svg{ width: 36px; height: 36px; }
    #fx-header .fx-mode-btn{ width: 32px; height: 32px; }
    #fx-header .fx-coin-wrap img{ width: 36px !important; height: 36px !important; }
    #fx-header .fx-open-account-btn{ padding: 7px 12px; }
}

/* ── Left chip ── */
#fx-header .fx-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 10px 6px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.2);
    color: #0f172a;
    background: #FFFFFF;
    white-space: nowrap;
}
#fx-header .fx-header-chip .chip-amount { color: #0501DA; }
#fx-header .fx-header-chip .chip-arrow {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
}

/* ── Steps Completed pill ── */
#fx-header .fx-steps-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #605E65;
    border: none;
    border-radius: 14px;
    padding: 8px 12px 8px 16px;
}
#fx-header .fx-steps-text {
    font-size: 0.7rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
}
#fx-header .fx-steps-ring {
    position: relative;
    width: 42px; height: 42px;
    flex-shrink: 0;
}
#fx-header .fx-steps-ring svg { transform: rotate(-90deg); }
#fx-header .fx-steps-ring .ring-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: #fff;
}

/* ── Mode toggle ── */
#fx-header .fx-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #605E65;
    border: none;
    border-radius: 999px;
    padding: 4px;
    gap: 6px;
}
#fx-header .fx-mode-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
#fx-header .fx-mode-btn.active {
    background: #0501DA;
    color: #fff;
}

/* ── Coin icons ── */
#fx-header .fx-coin-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
#fx-header .fx-coin {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f59e0b;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: #7c3700;
    font-weight: 900;
    position: relative;
    box-shadow: 0 2px 8px rgba(245,158,11,0.45);
    cursor: pointer;
}
#fx-header .fx-coin .coin-arrow {
    position: absolute;
    bottom: -2px; right: -2px;
    font-size: 0.6rem;
    color: #fff;
    background: #f59e0b;
    border-radius: 50%;
    width: 13px; height: 13px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0,0,0,0.15);
}

/* ── Open Account button ── */
#fx-header .fx-open-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
#fx-header .fx-open-account-btn:hover { opacity: 0.88; }

/* ── Divider ── */
#fx-header .fx-header-divider {
    width: 1px; height: 30px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* ── Icon buttons ── */
#fx-header .fx-icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: #605E65;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}
#fx-header .fx-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
#fx-header .fx-badge {
    position: absolute;
    top: -3px; right: -3px;
    min-width: 16px; height: 16px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #050b1a;
    padding: 0 3px;
}

/* ── Avatar ── */
#fx-header .fx-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: #605E65;
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: #fff;
    flex-shrink: 0; cursor: pointer;
}
#fx-header .fx-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive ── */
@media (max-width: 991px) {
    /* Only hide these in the DESKTOP header block */
    #fx-header .fx-header-desktop .fx-steps-pill { display: none !important; }
    #fx-header .fx-header-desktop .fx-mode-toggle { display: none !important; }
    #fx-header .fx-header-desktop .fx-coin-wrap { display: none !important; }
    #fx-header .fx-header-inner { flex-wrap: wrap; }
}
@media (max-width: 575px) {
    /* Mobile header is separate markup now */
    #fx-header .fx-open-account-btn .btn-label { display: none; }
    #fx-header .fx-header-divider { display: none; }

    #fx-header .fx-header-mobile{
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    #fx-header .fx-header-mobile-row{
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }
    #fx-header .fx-header-mobile .fx-header-chip{
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
        font-size: 0.7rem;
        padding: 6px 10px 6px 12px;
    }
    #fx-header .fx-header-mobile .fx-open-account-btn{
        width: 36px;
        height: 32px;
        padding: 0;
        border-radius: 10px;
        justify-content: center;
    }
    #fx-header .fx-header-mobile .fx-open-account-btn i{ margin: 0; }

    #fx-header .fx-header-mobile .fx-icon-btn { width: 30px; height: 30px; font-size: 0.86rem; }
    #fx-header .fx-header-mobile .fx-avatar { width: 30px; height: 30px; }
    #fx-header .fx-header-mobile .fx-mode-btn{ width: 26px; height: 26px; font-size: 0.74rem; }
    #fx-header .fx-header-mobile .fx-coin-wrap img{ width: 28px !important; height: 28px !important; }

    #fx-header .fx-header-mobile .fx-steps-pill{
        padding: 6px 9px 6px 10px;
        gap: 8px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    #fx-header .fx-header-mobile .fx-steps-text{ font-size: 0.6rem; line-height: 1.2; }
    #fx-header .fx-header-mobile .fx-steps-ring{ width: 30px; height: 30px; }
    #fx-header .fx-header-mobile .fx-steps-ring svg{ width: 30px; height: 30px; }
    #fx-header .fx-header-mobile .fx-steps-ring .ring-label{ font-size: 0.6rem; }
}

/* Keep Language icon visible on mobile */
