:root {
    --green: #05966a;
    --green-dark: #037a56;
    --green-deep: #0c3b2e;
    --ink: #142033;
    --muted: #667085;
    --line: #e6e8ee;
    --bg: #eef1f4;
    --orange: #ff8a1d;
    --peach: #fff1e6;
    --mint: #e8f8f1;
    --shadow: 0 10px 30px rgba(16, 24, 40, .08);
    font-family: Manrope, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body.app-body { margin: 0; background: #dfe3e8; color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }

.phone {
    width: min(420px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    background: #f6f7f9;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}
.mode-switch {
    display: flex;
    gap: 6px;
    margin: 14px auto 8px;
    padding: 4px;
    background: #eceff3;
    border-radius: 999px;
    width: min(280px, calc(100% - 48px));
}
.mode-switch a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: #98a2b3;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 999px;
}
.mode-switch a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mode-switch a.is-on { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.phone-scroll { flex: 1; padding: 18px 16px 96px; }
.gate { padding: 28px 8px 12px; }
.gate h1 { margin: 6px 0 8px; font-size: 32px; }
.gate > p { color: var(--muted); margin-top: 0; }
.gate .pay-now, .gate-second { width: 100%; margin-top: 12px; text-decoration: none; }
.gate-second { display: flex; align-items: center; justify-content: center; background: #111827; color: #fff; border-radius: 14px; padding: 14px; font-weight: 800; }
.gate-form { display: grid; gap: 12px; margin-top: 18px; }
.gate-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.gate-form input { border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 16px; }
.gate-help { text-align: center; }
.gate-help a { color: var(--green-dark); font-weight: 700; }
.app-flash { margin: 0 16px 8px; background: #fff4f2; color: #b42318; border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.welcome, .bag-hero, .dash-hero, .scan-hero {
    background: linear-gradient(165deg, #07a572 0%, #04875f 70%, #037a56 100%);
    color: #fff;
    border-radius: 22px;
    padding: 18px 16px 16px;
    box-shadow: var(--shadow);
}
.welcome-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.eyebrow { margin: 0; opacity: .85; font-size: 13px; }
.welcome h1, .bag-hero h1, .dash-hero h1, .scan-hero h1 { margin: 2px 0 0; font-size: 30px; letter-spacing: -.03em; }
.bag-hero p, .scan-hero p, .dash-hero p { margin: 4px 0 0; opacity: .9; }
.balance-pill {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 14px;
    padding: 8px 10px;
    min-width: 118px;
}
.balance-pill svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.7; }
.balance-pill small { display: block; font-size: 11px; opacity: .85; }
.balance-pill strong { font-size: 16px; }
.district { position: relative; margin-top: 14px; }
.district-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.16);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    text-align: left;
}
.district-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.district-btn span { flex: 1; }
.district-menu {
    position: absolute;
    z-index: 5;
    left: 0; right: 0; top: calc(100% + 6px);
    background: #fff;
    color: var(--ink);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(16,24,40,.16);
    overflow: hidden;
}
.district-menu a { display: block; padding: 13px 16px; text-decoration: none; font-weight: 650; }
.district-menu a.is-on { background: #e7f8f1; color: var(--green-dark); }

.bonus {
    margin: 14px 0;
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    background: linear-gradient(90deg, #ff9a2e, #ff7a12);
    color: #fff;
    border-radius: 16px;
    padding: 14px;
}
.bonus-icon { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.bonus-icon svg, .stat-icon svg, .v-name svg, .v-foot svg, .show-qr svg, .manual svg, .txn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bonus strong, .bonus small { display: block; }
.bonus small { opacity: .92; font-weight: 500; }
h2 { font-size: 22px; margin: 8px 0 12px; }

.place { background: #fff; border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.place-hero { position: relative; height: 168px; background-size: cover; background-position: center; }
.place-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.72)); }
.district-chip, .place-meta, .rating { position: relative; z-index: 1; }
.district-chip { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.place-meta { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.place-meta h3 { margin: 0; font-size: 22px; }
.place-meta p { margin: 2px 0 0; opacity: .9; }
.rating { position: absolute; right: 12px; bottom: 16px; background: rgba(0,0,0,.35); border-radius: 999px; padding: 3px 8px; font-weight: 800; }
.tiers { padding: 8px 12px 12px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 14px; }
.tier.is-popular { background: #fff8ef; }
.pay, .get { margin: 0; color: #344054; }
.pay strong, .get strong { color: var(--ink); font-size: 18px; }
.get strong { color: var(--green); }
.popular { display: inline-block; margin-left: 6px; background: var(--orange); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 6px; vertical-align: 2px; }
.buy, .pay-now, .show-qr, .mint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.buy { background: var(--green); color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 800; min-width: 104px; }
.empty-note { color: var(--muted); }

.bag-hero { margin-bottom: 14px; }
.voucher-card { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.voucher-card header { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--green); color: #fff; padding: 12px 14px; }
.v-name { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.v-tag { background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.v-body { padding: 14px; }
.v-balance, .v-original { display: inline-block; width: 58%; vertical-align: top; }
.v-original { width: 40%; text-align: right; }
.v-balance p, .v-original p { margin: 0; color: var(--muted); font-size: 13px; }
.v-balance strong { display: block; font-size: 32px; color: var(--green-dark); letter-spacing: -.03em; }
.v-original strong, .v-balance small, .v-original small { display: block; color: #98a2b3; }
.v-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin: 12px 0; color: #475467; font-size: 13px; }
.v-foot span { display: flex; align-items: center; gap: 6px; }
.v-foot em { font-style: normal; background: #e7f8f1; color: var(--green-dark); border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.show-qr { width: 100%; background: #111827; color: #fff; border-radius: 14px; padding: 14px; font-weight: 800; gap: 8px; }

.shade { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; z-index: 4; }
.sheet, .modal {
    background: #fff;
    width: 100%;
    border-radius: 26px 26px 0 0;
    padding: 10px 18px 24px;
    position: relative;
    max-height: 92%;
    overflow: auto;
}
.modal { margin: auto 18px 120px; border-radius: 24px; width: auto; }
.grabber { width: 42px; height: 5px; border-radius: 99px; background: #e4e7ec; margin: 4px auto 10px; }
.sheet-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; display: grid; place-items: center; text-decoration: none; color: #98a2b3; font-size: 24px; }
.sheet h2, .modal h2 { margin: 0 36px 0 0; font-size: 26px; }
.sheet-sub { margin: 4px 0 14px; color: var(--muted); }
.pay-summary { background: #eefbf5; border-radius: 16px; padding: 8px 14px; }
.pay-summary div { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.pay-summary strong { font-size: 26px; }
.green { color: var(--green); }
.orange { color: #f97316; }
.bonus-line { border-top: 1px solid #d9f3e6; }
.field-label { font-weight: 800; margin: 16px 0 8px; }
.pay-option { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 8px; }
.pay-option:has(input:checked), .pay-option.is-selected { border-color: var(--green); background: #f3fbf7; }
.pay-option input { position: absolute; opacity: 0; }
.pay-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.pay-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; }
.pay-icon.apple { background: #111827; }
.pay-icon.fps { background: #ff8a1d; }
.pay-icon.fps svg { fill: #fff; stroke: none; }
.pay-icon.card { background: #3b82f6; }
.pay-copy { flex: 1; }
.pay-copy strong, .pay-copy small { display: block; }
.pay-copy small { color: var(--muted); font-weight: 500; }
.radio-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d0d5dd; }
.pay-option:has(input:checked) .radio-mark { border-color: var(--green); background: radial-gradient(circle, var(--green) 0 6px, #fff 7px); }
.pay-now { width: 100%; margin-top: 8px; background: var(--green); color: #fff; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 16px; }
.demo-note { color: var(--muted); font-size: 12px; text-align: center; }
.check-badge { width: 72px; height: 72px; margin: 12px auto; border-radius: 50%; background: #d9f8ea; color: var(--green); display: grid; place-items: center; }
.check-badge svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.success-sheet, .approved { text-align: center; }
.added-box, .remain-box { background: #e9f8f1; border-radius: 16px; padding: 16px; margin: 8px 0 16px; }
.added-box strong, .approved-amt { color: var(--green); font-size: 34px; font-weight: 800; display: block; }
.added-box span, .remain-box span, .receipt-note { color: var(--muted); }

.qr-modal { background: #fff; margin: 70px 16px auto; border-radius: 24px; padding: 18px 16px 20px; position: relative; text-align: center; }
.qr-modal h2 { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0; font-size: 20px; }
.qr-modal h2 svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 1.8; }
.qr-frame { width: 220px; height: 220px; margin: 8px auto; border-radius: 18px; background: #f3fbf7; display: grid; place-items: center; border: 1px solid #d8f3e6; }
#qr-box { width: 180px; height: 180px; }
#qr-box img, #qr-box canvas { width: 180px; height: 180px; }
.qr-code { letter-spacing: .14em; color: #667085; font-weight: 700; }
.timer { width: 92px; height: 92px; margin: 8px auto; border-radius: 50%; border: 6px solid var(--green); display: grid; place-items: center; align-content: center; }
.timer-num { font-size: 28px; font-weight: 800; color: var(--green); line-height: 1; }
.timer-unit, .timer-note { color: var(--muted); font-size: 12px; }
.qr-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pill { border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.pill.mint { background: #e7f8f1; color: #087a55; }
.pill.amber { background: #fff1e0; color: #f97316; }

.dash-hero, .scan-hero { background: #171e2e; border-radius: 22px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.stat.mint { background: #e9f8f1; }
.stat.peach { background: #fff3ea; }
.stat p, .paid-row p, .outstanding p { margin: 8px 0 0; color: #475467; font-weight: 700; }
.stat strong, .outstanding strong { display: block; font-size: 26px; margin-top: 4px; }
.stat.mint strong { color: var(--green-dark); }
.stat.peach strong { color: #ea580c; }
.stat small { color: var(--muted); }
.stat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.7); color: var(--green); }
.stat.peach .stat-icon { color: #ea580c; }
.outstanding { margin-top: 12px; background: linear-gradient(90deg, #ff9a32, #ff7a12); color: #fff; border-radius: 18px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.outstanding p, .outstanding small, .outstanding strong { color: #fff; }
.outstanding strong { font-size: 32px; }
.out-arrow { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.paid-row { margin-top: 12px; background: #e9f8f1; border-radius: 18px; padding: 14px 16px; display: flex; justify-content: space-between; }
.paid-row strong { display: block; font-size: 26px; color: var(--green-dark); }
.paid-side { text-align: right; }
.paid-side strong { font-size: 16px; }
.recent header { display: flex; justify-content: space-between; align-items: baseline; }
.recent header span { color: var(--muted); }
.txn { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.txn-icon { width: 36px; height: 36px; border-radius: 12px; background: #fff3ea; color: #ea580c; display: grid; place-items: center; }
.txn strong { display: block; }
.txn small { color: var(--muted); }
.txn-amt { margin-left: auto; text-align: right; }
.txn-amt em { font-style: normal; color: #ea580c; font-size: 12px; font-weight: 800; }
.txn-amt em.is-paid { color: var(--green); }

.finder { margin-top: 16px; background: #111827; border-radius: 24px; min-height: 360px; position: relative; display: grid; place-items: center; }
.live { position: absolute; top: 14px; left: 14px; background: #0b1220; color: #fff; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 800; display: flex; gap: 6px; align-items: center; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; display: block; }
.finder-frame { width: 250px; height: 280px; position: relative; }
.corner { position: absolute; width: 28px; height: 28px; border: 3px solid #3ee0a2; }
.tl { top: 20px; left: 16px; border-right: 0; border-bottom: 0; }
.tr { top: 20px; right: 16px; border-left: 0; border-bottom: 0; }
.bl { bottom: 64px; left: 16px; border-right: 0; border-top: 0; }
.br { bottom: 64px; right: 16px; border-left: 0; border-top: 0; }
.finder-idle { text-align: center; color: #98a2b3; padding-top: 70px; }
.finder-idle svg { width: 42px; height: 42px; fill: none; stroke: #667085; stroke-width: 1.6; }
.tap-scan { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: #d9f8ea; color: var(--green); display: grid; place-items: center; }
.tap-scan svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tap-label { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; color: #98a2b3; font-size: 13px; }
#scan-video { width: 100%; height: 230px; object-fit: cover; border-radius: 16px; }
.manual { margin-top: 14px; display: flex; justify-content: center; gap: 8px; align-items: center; background: #fff; border-radius: 16px; padding: 14px; text-decoration: none; font-weight: 800; box-shadow: var(--shadow); }
.mint-btn { width: 100%; margin-top: 12px; background: #8ee0cb; color: #fff; border-radius: 14px; padding: 14px; font-weight: 800; }
.code-input, #bill, #amount { width: 100%; border: 1px solid #e4e7ec; background: #f8fafc; border-radius: 14px; padding: 14px; font-size: 18px; }
.redeem-input { background: #e7f8f1; }
.money-label { display: block; margin: 12px 0 6px; color: #344054; font-weight: 700; }
.cash-row { margin: 12px 0; background: #fff6ee; border-radius: 14px; padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.cash-row strong { color: #f97316; font-size: 20px; }
.found-sheet h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.found-icon { width: 36px; height: 36px; border-radius: 12px; background: #e7f8f1; color: var(--green); display: grid; place-items: center; }
.found-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.code-line { margin-top: -8px; color: var(--muted); }
.found-row { display: flex; justify-content: space-between; padding: 8px 0; }
.remain-box strong { display: block; font-size: 28px; }
.approved-amt { margin: 0; }

.tabbar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 74px;
    background: #fff;
    border-top: 1px solid #eef0f3;
    display: flex;
    z-index: 5;
}
.tabbar a { flex: 1; text-decoration: none; color: #98a2b3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; }
.tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tabbar a.is-on { color: var(--green); }
.tab-icon { position: relative; }
.tab-badge { position: absolute; top: -6px; right: -10px; background: #ff8a1d; color: #fff; border-radius: 999px; min-width: 16px; height: 16px; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

@media (min-width: 480px) {
    body.app-body { padding: 18px 0; }
    .phone { min-height: calc(100vh - 36px); border-radius: 28px; overflow: hidden; }
}
