body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* auth */
.auth { min-height: 100vh; padding: 28px 20px 40px; max-width: 440px; margin: 0 auto; }
.auth-hero { text-align: center; padding: 16px 0 22px; }
.auth-hero .logo { font-size: 24px; }
.auth-hero .logo svg { width: 40px; height: 40px; }
.tabs { display: flex; background: #e6ebf4; border-radius: 12px; padding: 4px; margin-bottom: 4px; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; padding: 10px; border-radius: 9px; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* app shell */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: calc(12px + env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.top h1 { font-size: 20px; margin: 0; }
.page { padding: 4px 16px 20px; max-width: 640px; margin: 0 auto; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 0; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--primary); }
.nav .dot { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--red); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* dashboard */
.hero-card { background: linear-gradient(135deg, #2457e6, #1437a8); color: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 8px 24px rgba(31, 79, 216, .25); }
.hero-card .lbl { opacity: .8; font-size: 13px; }
.hero-card .amt { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 10px; }
.hero-card .split { display: flex; gap: 18px; font-size: 13px; opacity: .92; }
.hero-card .split b { display: block; font-size: 16px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.action { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); border: 0; font-family: inherit; cursor: pointer; }
.action .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.action .ic svg { width: 22px; height: 22px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 30px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars .b span { font-size: 11px; color: var(--ink-3); }
.section-h { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 8px; }
.section-h h3 { margin: 0; }

/* payment list */
.plist { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pitem:last-child { border-bottom: 0; }
.pitem .av { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.pitem .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .s { font-size: 12.5px; color: var(--ink-3); }
.pitem .r { text-align: right; flex: none; }
.pitem .r b { display: block; font-size: 15px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips button { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(11, 31, 51, .45); z-index: 50; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff; border-radius: 20px 20px 0 0;
  max-height: 92vh; overflow-y: auto; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.amount-input { position: relative; }
.amount-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 28px; font-weight: 700; color: var(--ink-3); }
.amount-input input { font-size: 30px; font-weight: 800; padding: 14px 14px 14px 40px; }
.qr-box { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; width: 230px; margin: 8px auto; }
.qr-box img { width: 100%; display: block; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; word-break: break-word; }

/* shop poster */
.poster { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 26px 20px; text-align: center; max-width: 380px; margin: 0 auto; border-top: 8px solid var(--primary); }
.poster h2 { font-size: 22px; margin-bottom: 4px; }
.poster .qr-box { width: 250px; border: 0; }
.poster .apps { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.poster .powered { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: 14px; }
.poster .powered svg { width: 16px; height: 16px; }

/* plans */
.plan { border: 2px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; }
.plan.on { border-color: var(--primary); background: #f7f9ff; }
.plan .price { font-size: 22px; font-weight: 800; }
.plan ul { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.menu a, .menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 16px; border: 0; background: #fff; font: inherit; color: var(--ink); border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.menu > :last-child { border-bottom: 0; }
.menu { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

@media print {
  body { padding: 0; }
  .top, .nav, .toast { display: none !important; }
  .poster { box-shadow: none; margin-top: 40px; }
}

/* one-tap confirm + 4 actions */
.actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action { font-size: 12.5px; padding: 12px 4px; }
.qok { border: 0; background: var(--green); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; cursor: pointer; margin-top: 2px; white-space: nowrap; }
.qok.armed { background: var(--ink); }
