.h8-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    width: 100%;
    max-width: 100%;
    transform: none;
    background: #ffffff;
    border: 1px solid #dfe6ef;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 24px rgba(16, 33, 58, .08);
    box-sizing: border-box;
}

.h8-mobile-header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 430px;
    min-height: 72px;
    margin: 0 auto;
    padding: 12px 14px;
    box-sizing: border-box;
}

.h8-mobile-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.h8-mobile-brand img {
    display: block;
    width: 124px;
    max-width: 34vw;
    height: auto;
}

.h8-legacy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 10px;
    color: #475569;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.h8-mobile-header-inner.has-legacy-link .h8-member-chip {
    max-width: min(42vw, 220px);
}

.h8-member-chip {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
    max-width: min(58vw, 270px);
    min-height: 42px;
    padding: 5px 9px;
    color: #182230;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
    transform: none;
}

.h8-member-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: #ffffff;
    background: #b51b23;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
}

.h8-member-avatar.is-large {
    width: 44px;
    height: 44px;
    font-size: 14px;
}

.h8-member-chip-text {
    display: grid;
    min-width: 0;
    text-align: left;
    line-height: 1.2;
}

.h8-member-chip-text span,
.h8-member-chip-text strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h8-member-chip-text span {
    color: #263a55;
    font-size: 12px;
    font-weight: 800;
}

.h8-member-chip-text strong {
    color: #059669;
    font-size: 13px;
}

.h8-member-caret {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 1px solid #d9e2ee;
    border-radius: 999px;
}

.h8-member-caret::before {
    content: "";
    position: absolute;
    top: 45%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translate(-50%, -55%) rotate(45deg);
}

.h8-member-panel.is-hidden {
    display: none !important;
}

.h8-member-panel {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 82px 12px 16px;
}

.h8-member-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    border: 0;
    backdrop-filter: blur(4px);
}

.h8-member-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    width: min(100%, 390px);
    max-height: calc(100vh - 98px);
    overflow-y: auto;
    padding: 14px;
    color: #e5edf8;
    background: #172235;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .3);
}

.h8-member-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.h8-member-profile div {
    display: grid;
    min-width: 0;
}

.h8-member-profile strong,
.h8-member-profile small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h8-member-profile strong {
    color: #ffffff;
    font-size: 17px;
}

.h8-member-profile small {
    color: #aab6c8;
    font-size: 13px;
    font-weight: 800;
}

.h8-member-balance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.h8-member-balance div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    background: rgba(15, 23, 42, .32);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
}

.h8-member-balance span {
    color: #aab6c8;
    font-size: 12px;
    font-weight: 800;
}

.h8-member-balance strong {
    color: #34d399;
    font-size: 16px;
}

.h8-member-actions,
.h8-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.h8-header-actions {
    position: static;
    grid-template-columns: 1fr;
    width: 104px;
    margin-left: auto;
    flex: 0 0 104px;
    transform: none;
}

.h8-member-actions a,
.h8-header-actions a,
.h8-header-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    color: #e5edf8;
    background: rgba(37, 99, 235, .26);
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.h8-header-actions a,
.h8-header-actions button {
    color: #b51b23;
    background: #fff7f7;
    border-color: #f3c5c5;
}

.h8-member-actions a:last-child {
    grid-column: 1 / -1;
    background: rgba(153, 27, 27, .36);
    border-color: rgba(248, 113, 113, .38);
}

.payment-page .h8-mobile-header,
.member-edit-page .h8-mobile-header,
.collect-page .h8-mobile-header {
    left: 50%;
    right: auto;
    width: min(100%, 430px);
    transform: translateX(-50%);
}

.payment-page .h8-mobile-header-inner,
.member-edit-page .h8-mobile-header-inner,
.collect-page .h8-mobile-header-inner {
    min-height: 72px;
}

@media (min-width: 720px) {
    .payment-page .h8-mobile-header,
    .member-edit-page .h8-mobile-header,
    .collect-page .h8-mobile-header {
        width: min(100%, 920px);
    }

    .payment-page .h8-mobile-header-inner,
    .member-edit-page .h8-mobile-header-inner,
    .collect-page .h8-mobile-header-inner {
        max-width: 920px;
    }
}

.preview-app .h8-mobile-header-inner {
    max-width: 1120px;
}

.buy-app .h8-mobile-header {
    position: sticky;
    top: 0;
    left: auto;
    width: 100%;
    transform: none;
    border-radius: 0;
}

.buy-app .h8-mobile-header-inner {
    max-width: 1180px;
    padding-right: 14px;
    padding-left: 14px;
}

.buy-app .h8-member-chip,
.buy-app .h8-header-actions {
    position: static;
    flex: 0 1 auto;
    margin-left: auto;
    transform: none;
}

.buy-app .h8-header-actions {
    width: auto;
}

@media (min-width: 700px) {
    .h8-mobile-header .h8-member-panel {
        position: absolute;
        inset: auto 14px auto auto;
        top: calc(100% + 8px);
        z-index: 140;
        display: block;
        width: min(330px, calc(100vw - 28px));
        padding: 0;
    }

    .h8-mobile-header .h8-member-panel-backdrop {
        display: none;
    }

    .h8-mobile-header .h8-member-card {
        width: 100%;
        max-height: calc(100vh - 98px);
    }
}

@media (max-width: 460px) {
    .h8-mobile-header-inner {
        min-height: 64px;
        padding: 10px;
    }

    .h8-member-chip {
        max-width: 58vw;
        padding: 5px 7px;
    }

    .h8-mobile-header-inner.has-legacy-link .h8-member-chip {
        max-width: 40vw;
    }

    .h8-legacy-link {
        min-height: 34px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .h8-member-caret {
        width: 20px;
        height: 20px;
    }

    .h8-header-actions {
        gap: 6px;
        width: 96px;
    }

    .h8-header-actions a,
    .h8-header-actions button {
        min-height: 38px;
        padding: 7px 8px;
        font-size: 13px;
    }
}
