:root {
    --ink: #252929;
    --muted: #53616b;
    --green: #008451;
    --green-start: #04c776;
    --green-end: #00ae61;
    --white: #fff;
    --payment: #f5f5f5;
    --orders: #eff0f1;
    --line: #e6e8e9;
    --frame: 480px;
    --gutter: 16px;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    font-synthesis: none;
    color: var(--ink);
    background: #e6ebef;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 2px solid #008451; outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.cashier { width: min(100%, var(--frame)); margin-inline: auto; min-height: 100vh; min-height: 100dvh; }
.screen { min-height: 100vh; min-height: 100dvh; }

.home {
    padding: clamp(103px, 15.6vh, 145px) var(--gutter) 48px;
    background: linear-gradient(145deg, #eaf2fb, #eef2fd 36%, #e5f0fa);
}
.welcome { margin-inline: var(--gutter); }
.greeting {
    margin: 0 0 8px;
    color: #4e5a65;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.035em;
}
.welcome h1 { margin: 0; font-size: clamp(22px, 6vw, 29px); line-height: 1.35; letter-spacing: -.045em; font-weight: 800; }
.support { margin: 7px 0 0; color: #6e7f90; font-size: 14px; font-weight: 600; }
.home-actions {
    margin-top: clamp(80px, 12.6vh, 116px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    border-radius: 10px;
    background: var(--white);
}
.home-actions::after {
    content: "";
    position: absolute;
    inset: 28% auto 28% 50%;
    width: 2px;
    background: #f1f1f1;
    pointer-events: none;
}
.home-actions a {
    display: flex;
    min-height: 124px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #4d5a68;
    border-radius: inherit;
    font-size: 17px;
    font-weight: 750;
}
.home-actions svg { width: 31px; height: 31px; color: #19242d; }
.home-actions a:active { background: #f5f8fb; }
.home-help { margin-top: clamp(58px, 9.7vh, 86px); font-size: 13px; line-height: 1.6; }
.home-help h2 { margin: 0 0 9px; font-size: 14px; }
.home-help ol { margin: 0; padding-left: 21px; }
.home-help li { margin-bottom: 9px; padding-left: 2px; }

.pay { background: var(--payment); }
.screen-header {
    min-height: 72px;
    padding: max(8px, env(safe-area-inset-top)) var(--gutter) 0;
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    align-items: center;
    column-gap: 4px;
}
.screen-header h1 { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 500; }
.back { display: grid; place-items: center; width: 42px; height: 42px; margin-left: -9px; border-radius: 50%; }
.back svg { width: 22px; height: 22px; }
.demo-mark {
    justify-self: end;
    background: #ebeeef;
    border-radius: 20px;
    color: #57626c;
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
}
.payment-form { padding: 0 12px 108px; }
.merchant {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 28px 17px 18px 10px;
    min-height: 102px;
}
.merchant label { display: block; font-size: 15px; margin-bottom: 5px; }
.merchant p, .merchant select { margin: 0; font-size: clamp(16px, 4.9vw, 21px); line-height: 1.5; font-weight: 750; }
.merchant select { max-width: 100%; min-height: 34px; padding: 0 4px 0 0; border: 0; background: transparent; cursor: pointer; }
.merchant-avatar {
    width: 49px;
    height: 49px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e4f4eb;
    color: #008451;
}
.merchant-avatar svg { width: 27px; height: 27px; }
.amount-card { padding: 16px 16px 9px; border-radius: 12px; background: var(--white); box-shadow: 0 1px 6px #262a2e05; }
.amount-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.amount-heading label { display: flex; align-items: center; gap: 7px; font-weight: 750; }
.coin {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #ffbf15;
    border: 1px solid #ffd44a;
    box-shadow: inset 0 0 0 1px #ffd650;
    color: #fff8dd;
    font-weight: 750;
    font-size: 12px;
}
.green-link { background: none; border: 0; padding: 0; color: var(--green); }
.amount-line { display: flex; align-items: center; gap: 10px; min-height: 76px; border-bottom: 1px solid #dedfe0; margin-top: 6px; }
.amount-line span { padding-left: 4px; font-size: 41px; font-weight: 700; line-height: 1; }
.amount-line input { border: 0; min-width: 0; width: 100%; height: 57px; background: none; font-size: clamp(25px, 8vw, 40px); font-weight: 650; font-variant-numeric: tabular-nums; }
.amount-line input:focus { outline: 0; }
.amount-line:focus-within { border-color: var(--green); }
.note-area { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; }
.plain-link { border: 0; background: none; color: #4d6473; padding: 8px 0 8px 12px; font-size: 13px; }
.note-area input { padding: 6px 0; border: 0; outline-offset: 0; width: 100%; font-size: 13px; }
.referral-field { margin-top: 10px; padding: 10px 16px; border-radius: 10px; background: var(--white); }
.referral-field label { display: block; font-size: 13px; }
.referral-field input { width: 100%; min-height: 35px; border: 0; background: transparent; font-size: 16px; }
.payment-footer {
    position: fixed;
    z-index: 2;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, var(--frame));
    padding: 15px var(--gutter) max(14px, env(safe-area-inset-bottom));
    background: var(--white);
    border-radius: 17px 17px 0 0;
    box-shadow: 0 -2px 16px #262a2e0a;
}
.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 13px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(90deg, var(--green-start), var(--green-end));
    color: var(--white);
    font-size: 15px;
    font-weight: 750;
}
.primary:active:not(:disabled) { filter: brightness(.93); }
.payment-footer .primary { width: 100%; min-height: 47px; }
.feedback { margin: 10px var(--gutter); font-size: 13px; color: var(--muted); line-height: 1.6; }
.feedback.error, .dialog-error { color: #a72e36; }

.orders, .wallet { background: var(--orders); }
.orders .screen-header, .wallet .screen-header { background: var(--white); }
.wallet-link { justify-self: end; padding: 10px 0 10px 4px; font-size: 13px; white-space: nowrap; }
.order-filters { display: flex; align-items: stretch; justify-content: space-between; background: var(--white); padding-inline: var(--gutter); height: 67px; }
.order-filters button {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0 0 2px;
    color: #646a6f;
    font-size: clamp(13px, 3.6vw, 16px);
    white-space: nowrap;
}
.order-filters button[aria-pressed="true"] { color: var(--ink); }
.order-filters button[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 15px; height: 2px; background: var(--green-start); }
.phone-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; min-height: 44px; font-size: 13px; }
.phone-row button { min-height: 40px; white-space: nowrap; }
.phone-row button span { margin-left: 2px; font-size: 19px; vertical-align: -1px; }
.orders-empty { padding-top: clamp(76px, 11.7vh, 104px); display: grid; justify-items: center; }
.orders-empty svg { width: 151px; height: auto; }
.orders-empty p { margin: 18px 0 0; font-size: 15px; }
.orders-list { display: grid; gap: 9px; padding: 0 12px 20px; }
.orders-list:empty { padding: 0; }
.order-card { border-radius: 10px; padding: 12px 13px; background: var(--white); }
.order-card header, .order-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-card h2 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.order-card header span { font-size: 12px; white-space: nowrap; color: var(--green); }
.order-card .order-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.order-card footer { padding-top: 9px; }
.order-card strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.order-card .resume-payment { font-size: 13px; min-height: 32px; padding-inline: 13px; }

.wallet-body { display: grid; gap: 11px; padding: 15px var(--gutter) 28px; }
.wallet-summary, .wallet-panel { padding: 15px; background: var(--white); border-radius: 11px; }
.wallet-summary { display: grid; gap: 6px; background: #e4f5eb; color: #285043; }
.wallet-summary span, .wallet-panel p { font-size: 13px; }
.wallet-summary strong { color: #064932; font-size: 31px; font-variant-numeric: tabular-nums; }
.wallet-summary button { justify-self: start; min-height: 35px; }
.wallet-panel h2, .wallet-panel label { margin: 0; display: block; font-size: 15px; font-weight: 750; }
.wallet-panel p { color: var(--muted); margin: 7px 0 12px; }
.wallet-panel .primary { width: 100%; }
.withdraw-input { display: flex; align-items: center; gap: 8px; margin-top: 8px; border-bottom: 1px solid var(--line); }
.withdraw-input span { font-size: 19px; font-weight: 750; }
.withdraw-input input { min-width: 0; min-height: 40px; width: 100%; border: 0; background: transparent; font-size: 16px; }
.withdraw-input:focus-within { border-color: var(--green); }
.withdraw-input input:focus { outline: 0; }
.withdrawals-list { margin-top: 8px; }
.withdrawals-list article + article { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.withdrawals-list article span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.withdrawals-list article strong { font-size: 14px; }

dialog { width: min(calc(100% - 36px), 378px); max-width: none; border: 0; padding: 19px; border-radius: 14px; background: var(--white); color: var(--ink); }
dialog::backdrop { background: #1b283154; }
dialog h2 { margin: 0 0 9px; font-size: 18px; }
dialog p { margin: 7px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
dialog label { display: block; margin: 12px 0 5px; font-size: 13px; }
dialog input { width: 100%; border: 1px solid var(--line); border-radius: 8px; min-height: 42px; padding: 8px 10px; font-size: 16px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-top: 15px; }
.secondary { border: 1px solid var(--line); background: var(--white); padding: 8px; border-radius: 24px; font-size: 14px; }
dialog .confirm-amount { margin: 6px 0; font-size: 30px; line-height: 1.25; font-weight: 750; color: var(--ink); }
.cashier-activity-badge { margin: 0; padding: 9px 11px; border-radius: 10px; background: #fff0e5; color: #a13c25; font-size: 12px; overflow-wrap: anywhere; }
.cashier-red-packet { display: grid; gap: 6px; margin: 10px 0; padding: 11px; border: 1px solid #f0d5c9; border-radius: 10px; background: #fff8f3; }
.cashier-red-packet > strong { color: #9b3328; font-size: 13px; overflow-wrap: anywhere; }
.cashier-red-packet p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.cashier-red-packet progress { width: 100%; height: 6px; accent-color: #df6950; }
.cashier-campaign-dialog { width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 22px; border-radius: 17px; background: linear-gradient(150deg, #e4f1ff, #fff 55%); }
.cashier-campaign-dialog h2 { margin-bottom: 18px; font-size: 20px; }
.cashier-campaign-dialog h2::before { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px; border-radius: 50%; background: #ffa622; color: #fff; content: "i"; font-size: 15px; }
.cashier-campaign-dialog h3 { margin: 0 0 12px; font-size: 16px; text-align: center; overflow-wrap: anywhere; }
.cashier-campaign-dialog .campaign-lead { margin: 12px 0; color: var(--ink); font-size: 16px; text-align: center; }
.campaign-lead strong { color: #d33232; font-size: 22px; white-space: nowrap; }
.cashier-campaign-dialog .campaign-amount { padding: 9px; border-radius: 8px; background: #ffffffb3; font-size: 13px; text-align: center; }
.campaign-amount b { color: #c62e30; font-size: 20px; }
.cashier-campaign-dialog .campaign-description, .cashier-campaign-dialog .campaign-note { margin: 12px 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.campaign-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.campaign-actions button { min-height: 43px; border: 0; border-radius: 999px; background: #f0f1f4; color: var(--ink); font: inherit; cursor: pointer; }
.campaign-actions button:last-child { background: #3e70ff; color: #fff; }
.toast {
    position: fixed;
    z-index: 4;
    bottom: max(25px, env(safe-area-inset-bottom));
    left: 50%;
    width: max-content;
    max-width: calc(100% - 30px);
    transform: translateX(-50%);
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--white);
    background: #263238;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 345px) {
    :root { --gutter: 12px; }
    .home-actions a { min-height: 112px; }
    .phone-row { font-size: 12px; }
}

@media (min-width: 481px) {
    .cashier { box-shadow: 0 0 24px #25374013; }
}
