.member-page { width: min(100% - 32px, 760px); margin: 32px auto 64px; }
.member-page h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; }
.stage { color: #53634d; }
.panel, dialog { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 4vw, 28px); margin-block: 16px; }
dialog { margin: auto; max-width: min(440px, 92vw); color: var(--ink); }
dialog::backdrop { background: #17311780; }
.member-page label, .member-page textarea { display: block; }
.member-page input, .member-page textarea { width: 100%; padding: 10px; border: 1px solid #82977f; border-radius: 8px; font: inherit; margin-bottom: 12px; }
.member-page button { cursor: pointer; font: inherit; }
.member-page button:disabled { cursor: default; opacity: .62; }
.cart-line { display: flex; gap: 14px; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 12px 0; }
.cart-line small { display: block; }
.cart-line input { width: 65px; margin: 0; }
.cart-line button, #logout { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; }
.total { display: flex; justify-content: space-between; gap: 12px; }
.order { border-top: 1px solid var(--line); padding: 12px 0; }
@media (max-width: 520px) {
  .header { flex-wrap: wrap; gap: 12px; padding-inline: 16px; }
  .header nav { gap: 14px; flex-wrap: wrap; }
  .cart-line { flex-wrap: wrap; }
}

[hidden] { display: none !important; }
#deliveryMap { min-height: 300px; height: min(50vh, 430px); border-radius: 12px; margin-block: 12px; }
#deliveryForm { margin-top: 12px; }
#savedAddress { white-space: pre-wrap; }

body[data-page="account"] { background: #f6f3e4; }
.profile-greeting { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-greeting p, .profile-greeting h2, .profile-wallet p { margin: 0; }
#profileGreeting { color: #367039; font-weight: 700; }
#profileName { font-size: clamp(2rem, 7vw, 3rem); }
#profileCode { border-radius: 99px; padding: 6px 12px; background: #205c35; color: white; font-weight: 700; overflow-wrap: anywhere; }
.profile-wallet { background: linear-gradient(120deg, #327534, #185331); color: #fff; }
#profileDashboard .profile-wallet strong { display: block; font-size: clamp(2rem, 8vw, 3.75rem); line-height: 1.15; margin-block: 6px; }
.wallet-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wallet-stats .panel { margin-top: 0; }
.wallet-stats h2 { font-size: 1rem; margin-top: 0; }
.wallet-stats p { margin-bottom: 0; }
.wallet-entry { display: flex; justify-content: space-between; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.wallet-entry small { display: block; color: #52644e; }
.order-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.order-heading strong { overflow-wrap: anywhere; }
.order-heading span, .history-note, .order-figures dt { color: #52644e; font-size: .9rem; }
.order-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-block: 18px; }
.order-figures dd { margin: 4px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.order-figures > div { min-width: 0; }
.profile-summary { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; align-items: center; gap: 24px; }
.profile-summary > div { min-width: 0; }
.profile-summary > div + div { border-left: 1px solid #ffffff40; padding-left: 24px; }
#profileDashboard .profile-summary .summary-value { font-size: clamp(1.5rem, 4vw, 2rem); }
.profile-summary p { color: #ffffffda; font-size: .9rem; }
.profile-wallet #walletHint { margin-top: 12px; }
#signInPanel.is-signed-in { display: flex; justify-content: flex-end; background: none; border: 0; padding: 0; margin-block: 0 12px; }
#signInPanel.is-signed-in #mobileLogin { display: none; }
.monthly-billing { margin-block: 16px 20px; }
.monthly-billing h3 { margin: 0 0 10px; font-size: 1rem; }
.monthly-billing-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 0; margin-block: 10px; }
.monthly-billing-year { color: #52644e; font-size: .85rem; margin-right: 16px; }
.monthly-billing-item { white-space: nowrap; padding-inline: 12px; border-left: 1px solid var(--line); font-size: .9rem; }
.monthly-billing-item strong { color: #205c35; }
.order.order-tone-a, .order.order-tone-b { border: 1px solid #dce5d6; border-radius: 12px; padding: 18px; margin-block: 14px; }
.order.order-tone-a { background: #f1f7ed; }
.order.order-tone-b { background: #fff8e9; }
.payment-badge { display: inline-block; margin-top: 12px; padding: 4px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.payment-paid { background: #d7edce; color: #20532b; }
.payment-pending { background: #f5e6bd; color: #644c17; }
.profile-wallet-actions { margin-top: 18px; }
.profile-wallet-actions .button { background: white; color: #205c35; }
#coinsLoadDialog { width: min(460px, calc(100% - 24px)); max-height: 90vh; overflow-y: auto; }
.topup-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topup-heading h2 { margin: 0; font-size: 1.4rem; }
.topup-heading button, .topup-quick button, .topup-tools button, #checkTopup, #changeTopup { border: 1px solid var(--line); background: #f4f7ee; border-radius: 8px; padding: 10px 12px; font: inherit; cursor: pointer; }
#topupAmountForm { margin-top: 22px; }
#coinsLoadDialog label { display: block; margin-block: 16px 6px; font-size: .9rem; }
#coinsLoadDialog input { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #82977f; border-radius: 8px; font: inherit; }
.topup-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.topup-total { font-size: 1.15rem; margin-bottom: 6px; }
.topup-total strong { font-size: 2rem; }
#topupQr { padding: 12px; background: white; display: flex; justify-content: center; }
#topupQr canvas, #topupQr img { max-width: 100%; height: auto; }
.topup-tools { display: flex; flex-wrap: wrap; gap: 8px; }
#topupUpiId, #topupRequestId { overflow-wrap: anywhere; }
#topupNotifyForm .button { margin-block: 12px; }
#checkTopup, #changeTopup { margin: 6px 6px 6px 0; }
#topupStatus { line-height: 1.5; }
@media (max-width: 520px) {
  .profile-summary { grid-template-columns: 1fr 1fr; gap: 20px; }
  .profile-summary .summary-coins { grid-column: 1 / -1; }
  .profile-summary > div + div { padding-left: 0; border-left: 0; }
  .profile-summary > div:last-child { padding-left: 18px; border-left: 1px solid #ffffff40; }
}

/* Keep the submitted payment screen focused on its next action. */
#topupWhatsApp { display: block; width: fit-content; margin-top: 20px; }
#topupWhatsApp[hidden] { display: none; }
#checkTopup { display: block; margin-top: 12px; padding: 6px 0; border: 0; background: transparent; color: var(--green, #2f7d2d); text-decoration: underline; font-size: .9rem; }
#checkTopup[hidden] { display: none; }
#topupStatus:empty { display: none; }

/* Compact order history: a single summary row with details on demand. */
.compact-monthly { display: flex; align-items: baseline; gap: 0; overflow-x: auto; flex-wrap: nowrap; padding-block: 8px; }
.monthly-billing-label { white-space: nowrap; font-weight: 700; padding-right: 12px; font-size: .9rem; }
.order-group-title { font-size: 1.05rem; margin: 24px 0 10px; }
.order.compact-order { padding: 0; margin-block: 8px; }
.order-summary { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; list-style: none; font-size: .85rem; }
.order-summary::-webkit-details-marker { display: none; }
.order-summary::after { content: '›'; font-size: 1.3rem; flex: 0 0 auto; }
.compact-order[open] > .order-summary::after { transform: rotate(90deg); }
.order-summary:focus-visible { outline: 2px solid #327534; outline-offset: 2px; border-radius: 12px; }
.order-summary-date { white-space: nowrap; color: #52644e; }
.order-summary-id { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-summary-amount { white-space: nowrap; }
.order-summary .payment-badge { margin: 0; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.order-expanded { padding: 0 16px 16px; border-top: 1px solid #dce5d6; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .order-summary { padding: 12px 9px; gap: 7px; font-size: .75rem; }
  .order-summary .payment-badge { max-width: 82px; padding: 4px 6px; font-size: .68rem; }
}

.signup-phone { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.signup-search { display: flex; gap: 8px; align-items: flex-start; }
.signup-search input { min-width: 0; }
#signupMap { height: 300px; border-radius: 12px; border: 1px solid var(--line); margin-block: 12px; }
#signupSubmit { margin-top: 12px; }
#newTopup { display: block; border: 0; background: transparent; color: #2f7d2d; padding: 6px 0; margin-top: 8px; text-decoration: underline; }
