html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background: #f4f2f7;
    color: #1a1224;
}

/* Only content links use classic blue — never app chrome */
main a:not(.btn):not(.tabbar__item):not(.drawer__row):not(.drawer__logout):not(.top-bar__brand):not(.top-bar__login),
.content a:not(.btn),
.btn-link {
    color: #006bb7;
}

/* ========== iOS-style bottom tab bar ========== */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: calc(3.4rem + env(safe-area-inset-bottom, 0px));
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(60, 60, 67, 0.18);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.6) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

a.tabbar__item,
a.tabbar__item:link,
a.tabbar__item:visited,
a.tabbar__item:hover,
a.tabbar__item:focus,
a.tabbar__item:active,
span.tabbar__item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    height: 3.4rem;
    margin: 0;
    padding: 0.2rem 0.15rem 0.15rem;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: #8e8e93 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

a.tabbar__item.is-on,
a.tabbar__item.active {
    color: #5b21b6 !important;
}

.tabbar__item.is-off {
    opacity: 0.4;
    pointer-events: none;
}

.tabbar__ico {
    width: 1.45rem;
    height: 1.45rem;
    display: block;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tabbar__txt {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    text-align: center;
    color: inherit !important;
}

/* ========== iOS-style drawer ========== */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.35);
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    width: min(21rem, 90vw);
    height: 100%;
    height: 100dvh;
    background: #f2f2f7;
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.drawer.is-open {
    transform: translateX(0);
}

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    background: #fff;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}

.drawer__profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.drawer__avatar {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    background: #5b21b6;
}

.drawer__meta {
    min-width: 0;
}

.drawer__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer__sub {
    margin-top: 0.1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.drawer__x {
    appearance: none;
    border: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #e5e5ea;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.drawer__x svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.drawer__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.5rem;
}

.drawer__group {
    margin-bottom: 1.1rem;
}

.drawer__group-title {
    margin: 0 0 0.45rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.drawer__list {
    background: #fff;
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

a.drawer__row,
a.drawer__row:link,
a.drawer__row:visited,
a.drawer__row:hover,
a.drawer__row:focus,
a.drawer__row:active {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.9rem;
    padding: 0.75rem 0.9rem;
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 0;
    background: #fff !important;
    color: #111827 !important;
    font-size: 1rem;
    font-weight: 450;
    line-height: 1.25;
    text-decoration: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

a.drawer__row:last-child {
    border-bottom: 0;
}

a.drawer__row:active {
    background: #ececf0 !important;
}

a.drawer__row.is-on,
a.drawer__row.active {
    color: #5b21b6 !important;
    font-weight: 650;
    background: #f5f0ff !important;
}

a.drawer__row span {
    color: inherit !important;
}

.drawer__chev {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    fill: none;
    stroke: #c7c7cc;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

a.drawer__row.is-on .drawer__chev,
a.drawer__row.active .drawer__chev {
    stroke: #5b21b6;
}

.drawer__foot {
    padding: 0.75rem 1rem 1rem;
}

a.drawer__logout,
a.drawer__logout:link,
a.drawer__logout:visited,
a.drawer__logout:hover,
a.drawer__logout:focus,
button.drawer__logout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    width: 100%;
    border: 0;
    border-radius: 0.85rem;
    background: #5b21b6 !important;
    color: #fff !important;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    cursor: pointer;
}

a.drawer__logout:active,
button.drawer__logout:active {
    background: #4c1d95 !important;
}

/* Shared screen panels */
.panel {
    border: 1px solid #ebe4f1;
    border-radius: 1rem;
    padding: 1rem 1rem 1.15rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(58, 6, 71, 0.05);
}

.panel h2 {
    font-size: 1.15rem;
    margin: 0 0 0.25rem;
    color: #1a1224;
}

.panel__hint {
    margin: 0 0 1rem;
    color: #7c6b8a;
    font-size: 0.9rem;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .panel {
        border-radius: 0.85rem;
        padding: 0.9rem 0.85rem 1rem;
        box-shadow: none;
        border-color: #eee6f5;
    }
}

.btn-primary {
    color: #fff;
    background-color: #5b21b6;
    border-color: #5b21b6;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(91, 33, 182, 0.35);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.25rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.token-price-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: #f3e8ff;
    color: #5b21b6;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.paywall {
    margin: 1rem 0 1.5rem;
    padding: 1.15rem 1.1rem 1.25rem;
    border: 1px solid #ebe4f1;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(58, 6, 71, 0.05);
}

.paywall h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.paywall__lead,
.paywall__balance,
.paywall__hint,
.paywall__ok {
    color: #7c6b8a;
    line-height: 1.45;
}

.paywall__hint {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
}

.wallet__hero {
    margin: 0 0 1rem;
    padding: 1.1rem 1.15rem;
    border-radius: 1rem;
    background: linear-gradient(160deg, #3a0647, #5b21b6);
    color: #fff;
}

.wallet__label {
    margin: 0;
    opacity: 0.8;
    font-size: 0.85rem;
}

.wallet__amount {
    margin: 0.15rem 0;
    font-size: 2.4rem;
    font-weight: 780;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.wallet__rate {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.wallet-packs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.65rem;
}

.wallet-pack {
    appearance: none;
    border: 1px solid #ebe4f1;
    background: #faf8fc;
    border-radius: 0.9rem;
    padding: 0.85rem 0.7rem;
    text-align: center;
    cursor: pointer;
}

.wallet-pack:hover:not(:disabled) {
    border-color: #5b21b6;
    background: #f6f0fb;
}

.wallet-pack__sgd {
    display: block;
    font-weight: 750;
    color: #3a0647;
}

.wallet-pack__tokens {
    display: block;
    margin-top: 0.2rem;
    color: #7c6b8a;
    font-size: 0.85rem;
}

.wallet-redeem {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wallet-redeem .form-control {
    flex: 1 1 12rem;
}

.wallet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wallet-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1ebf6;
}

.wallet-credit { color: #15803d; font-weight: 650; }
.wallet-debit { color: #b42318; font-weight: 650; }

.wallet-codes textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
}

.panel + .panel {
    margin-top: 1rem;
}

.token-price-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #f3e8ff;
    color: #5b21b6;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.paywall {
    margin: 1rem 0;
    padding: 1.1rem 1.15rem 1.2rem;
    border: 1px solid #ebe4f1;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(58, 6, 71, 0.05);
}

.paywall h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.paywall__lead,
.paywall__hint,
.paywall__balance {
    color: #7c6b8a;
    line-height: 1.45;
}

.paywall .btn {
    margin-top: 0.35rem;
}

.wallet {
    display: grid;
    gap: 1rem;
    max-width: 42rem;
}

.wallet__hero {
    padding: 1.1rem 1.15rem;
    border-radius: 1rem;
    background: linear-gradient(160deg, #3a0647, #5b21b6);
    color: #fff;
}

.wallet__label {
    margin: 0;
    opacity: 0.8;
    font-size: 0.85rem;
}

.wallet__amount {
    margin: 0.15rem 0 0.25rem;
    font-size: 2.4rem;
    font-weight: 780;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.wallet__rate {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

.wallet-packs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.wallet-pack {
    appearance: none;
    border: 1px solid #ebe4f1;
    background: #faf7fc;
    border-radius: 0.9rem;
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    text-align: left;
}

.wallet-pack:hover:not(:disabled) {
    border-color: #5b21b6;
    background: #f6f0fb;
}

.wallet-pack__sgd {
    display: block;
    font-weight: 750;
    color: #3a0647;
}

.wallet-pack__tokens {
    display: block;
    margin-top: 0.15rem;
    color: #7c6b8a;
    font-size: 0.88rem;
}

.wallet-redeem {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wallet-redeem .form-control {
    flex: 1 1 12rem;
}

.wallet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wallet-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1ebf6;
}

.wallet-credit { color: #15803d; font-weight: 650; }
.wallet-debit { color: #b42318; font-weight: 650; }

.wallet-codes textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .wallet-packs {
        grid-template-columns: 1fr 1fr;
    }
}

