:root {
    --h8-mobile-header-height: 64px;
    --h8-mobile-header-offset: 76px;
}

html {
    scroll-padding-top: var(--h8-mobile-header-offset);
}

[id],
.tool-heading,
.member-tools,
.profile-summary,
.payment-summary,
.history-filter,
.history-summary,
.collect-notice,
.draw-panel,
.lottery-panel,
.service-panel,
.auth-panel {
    scroll-margin-top: var(--h8-mobile-header-offset);
}

.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;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    max-width: 430px;
    height: var(--h8-mobile-header-height);
    min-height: var(--h8-mobile-header-height);
    margin: 0 auto;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

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

.h8-mobile-brand {
    display: flex;
    align-items: center;
    flex: 0 0 94px;
    width: 94px;
    min-width: 0;
    max-width: 25vw;
}

.h8-mobile-brand img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
}

.h8-mobile-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.h8-build-version {
    display: none;
}

.h8-language-form {
    display: block;
    flex: 0 0 78px;
    width: 78px;
    min-width: 0;
}

.h8-language-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.h8-language-select {
    display: block;
    width: 100%;
    height: 34px;
    padding: 5px 16px 5px 6px;
    color: #263a55;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.h8-mobile-footer {
    width: min(100%, 430px);
    margin: 14px auto 0;
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
}

.h8-google-translate-host,
.h8-google-translate-host *,
.h8-mobile-header .skiptranslate,
.h8-mobile-header [class*="VIpgJd"],
.skiptranslate,
[class*="goog-te"],
[id*="goog-gt"],
[class*="VIpgJd"],
iframe[src*="translate.google"],
iframe[src*="translate.googleapis"],
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-gadget,
.goog-te-combo,
.goog-te-menu-frame,
.goog-te-spinner-pos,
.goog-te-spinner,
.goog-te-spinner-animation,
.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO,
.VIpgJd-ZVi9od-xl07Ob-lTBxed,
.VIpgJd-yAWNEb-L7lbkb,
.VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q,
iframe.goog-te-banner-frame,
iframe.skiptranslate {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

html,
body {
    top: 0 !important;
}

body > .skiptranslate,
body > .goog-te-banner-frame,
body > .goog-te-menu-frame {
    display: none !important;
    visibility: hidden !important;
}

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

.h8-mobile-header-inner.has-legacy-link .h8-member-chip {
    flex: 1 1 94px;
    max-width: none;
}

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

.h8-member-avatar {
    display: none;
    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;
}

.profile-default-avatar,
.h8-member-profile .h8-member-avatar {
    display: none !important;
}

.h8-member-chip-text {
    display: grid;
    flex: 1 1 auto;
    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: 11px;
    font-weight: 800;
}

.h8-member-chip-text strong {
    color: #059669;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    overflow: visible;
    text-overflow: clip;
}

.h8-member-chip-text strong span {
    flex: 0 1 auto;
    min-width: 0;
}

.h8-member-caret {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    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: calc(var(--h8-mobile-header-height) + 18px) 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 {
    flex: 1 1 auto;
}

.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: 86px;
    margin-left: auto;
    flex: 0 0 86px;
    transform: none;
}

.h8-member-actions a,
.h8-header-actions a,
.h8-header-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 8px;
    color: #e5edf8;
    background: rgba(37, 99, 235, .26);
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    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%);
}

.member-tool-page,
.member-edit-page,
.payment-page,
.collect-page,
.buy-list-page,
.buy-list-shell,
.lotto-master-page {
    padding-top: var(--h8-mobile-header-offset);
}

.payment-page .h8-mobile-header + *,
.member-edit-page .h8-mobile-header + *,
.collect-page .h8-mobile-header + * {
    margin-top: 0 !important;
}

.payment-page .h8-mobile-header-inner,
.member-edit-page .h8-mobile-header-inner,
.collect-page .h8-mobile-header-inner {
    height: var(--h8-mobile-header-height);
    min-height: var(--h8-mobile-header-height);
}

@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-inner {
        overflow: visible;
    }

    .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: 520px) {
    .h8-mobile-header-inner {
        height: var(--h8-mobile-header-height);
        min-height: var(--h8-mobile-header-height);
        padding: 8px;
        gap: 5px;
    }

    .h8-mobile-brand-wrap {
        flex-basis: auto;
    }

    .h8-mobile-brand,
    .h8-mobile-brand img {
        width: 82px;
    }

    .h8-mobile-brand {
        flex-basis: 82px;
        max-width: 23vw;
    }

    .h8-language-form {
        flex-basis: 76px;
        width: 76px;
    }

    .h8-mobile-meta {
        gap: 4px;
    }

    .h8-language-select {
        height: 30px;
        padding-right: 16px;
        padding-left: 5px;
        font-size: 10px;
    }

    .h8-member-chip {
        flex: 1 1 94px;
        margin-left: 0;
        max-width: none;
        min-height: 34px;
        padding: 4px 6px;
        gap: 5px;
    }

    .h8-header-actions,
    .buy-app .h8-header-actions,
    .buy-app .h8-member-chip {
        margin-left: 0;
    }

    .h8-mobile-header-inner.has-legacy-link .h8-member-chip {
        flex: 1 1 94px;
        max-width: none;
    }

    .h8-legacy-link {
        min-height: 32px;
        padding: 6px 7px;
        font-size: 11px;
    }

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

    .h8-member-chip-text span {
        font-size: 11px;
    }

    .h8-member-chip-text strong {
        font-size: 12px;
        white-space: nowrap;
    }

    .h8-header-actions {
        gap: 6px;
        width: 72px;
        flex-basis: 72px;
    }

    .h8-header-actions a,
    .h8-header-actions button {
        min-height: 34px;
        padding: 5px 4px;
        font-size: 10px;
        line-height: 1.1;
        white-space: nowrap;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .h8-mobile-header-inner {
        gap: 4px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .h8-mobile-brand,
    .h8-mobile-brand img {
        width: 78px;
    }

    .h8-mobile-brand {
        flex-basis: 78px;
    }

    .h8-language-form {
        flex-basis: 70px;
        width: 70px;
    }

    .h8-legacy-link {
        padding-right: 6px;
        padding-left: 6px;
        font-size: 10px;
    }

    .h8-member-chip {
        flex-basis: 82px;
        min-width: 0;
    }
}
