/* BANDS app shell (/app). Header + scrolling screen + tab bar, like a native app.
   Full screen on phones; a phone-sized frame on desktop. */
html:has(.mapp-body) { background: var(--ground); }
.mapp-body { margin: 0; background: var(--ground); height: 100dvh; overflow: hidden; }
.mapp { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; background: var(--ground); }

@media (min-width: 600px) and (min-height: 640px) {
  .mapp-body { background: var(--surface); display: grid; place-items: center; }
  .mapp { height: min(880px, calc(100dvh - 64px)); border: 1px solid var(--line); border-radius: 36px; overflow: hidden; }
}

/* Top bar */
.mapp-top { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; background: var(--ground); border-bottom: 1px solid var(--line); }
.mapp-top__logo { justify-self: center; display: block; width: 104px; height: auto; }
.mapp-top__btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.mapp-top__btn:hover { background: var(--surface-raised); }

/* Scrolling screen area */
.mapp-main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 20px max(16px, env(safe-area-inset-left, 0px)) 20px max(16px, env(safe-area-inset-right, 0px)); scroll-padding-bottom: 96px; }
.mapp-screen[hidden] { display: none; }
.mapp-title { font-family: var(--font-display); font-weight: 700; font-stretch: 112%; font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; }
.mapp-sub { color: var(--ink-muted); margin: -8px 0 16px; font-size: 15px; }

/* Bottom tab bar */
.mapp-tabs { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.mapp-tab { display: grid; justify-items: center; gap: 4px; padding: 6px 4px; background: none; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--ink-muted); font: 600 12px/1 var(--font-body); text-decoration: none; }
.mapp-tab svg { display: block; }
.mapp-tab[aria-current="page"] { color: var(--ink); }
.mapp-tab[aria-current="page"] svg { color: var(--brand-text); }
.mapp-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Converter, restyled as native app screens */
.mapp .bx-card { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.mapp .bx-steps { padding: 0; }
.mapp .bx-body { padding: 20px 0 0; gap: 14px; }
.mapp .bx-row { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.mapp .bx-input { background: var(--surface); border-radius: 14px; min-height: 52px; }
.mapp .bx-input--figure { background: transparent; font-size: 40px; line-height: 44px; min-height: 48px; }
.mapp .bx-figure { font-size: 34px; line-height: 40px; }
.mapp .bx-meta { padding: 4px 2px; }
.mapp .bx-btn { min-height: 54px; border-radius: 16px; font-size: 17px; }
.mapp .bx-btn--sm { min-height: 40px; font-size: 14px; border-radius: 12px; }
.mapp .bx-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 18px; }
.mapp .bx-verified { background: var(--surface); }
.mapp .bx-deposit { grid-template-columns: 1fr; }
.mapp .bx-qr { width: 208px; margin: 0 auto; }
.mapp .bx-deposit__addr { justify-items: stretch; }
.mapp .bx-receipt__amount { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }

/* Primary action pinned to the bottom of the screen, above the tab bar */
.mapp-screen[data-screen="convert"] .bx-body > .bx-btn--block,
.mapp-screen[data-screen="convert"] .bx-body > .bx-actions:last-child {
  position: sticky; bottom: 0; z-index: 10; box-shadow: 0 0 0 12px var(--ground), 0 12px 0 12px var(--ground); }
.mapp-screen[data-screen="convert"] .bx-body > .bx-actions:last-child { background: var(--ground); }
.mapp-screen[data-screen="convert"] .bx-actions > .bx-btn { flex: 1 1 auto; }

/* Activity */
.mapp .bx-track .bx-actions > .bx-btn { flex: 0 0 auto; }
.mapp .bx-card--receipt { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.mapp .bx-card--receipt .bx-receipt { padding: 18px; }

@media print {
  .mapp-body { height: auto; overflow: visible; }
  .mapp { height: auto; }
  .mapp-main { overflow: visible; }
  .mapp-top, .mapp-tabs { display: none !important; }
}

/* ---------- Compact pass: fit each step on one phone screen ---------- */
.mapp-top { grid-template-columns: 40px 1fr 40px; padding: calc(env(safe-area-inset-top, 0px) + 4px) 8px 4px; }
.mapp-top__btn { width: 40px; height: 40px; }
.mapp-top__logo { width: 92px; }
.mapp-main { padding-top: 12px; padding-bottom: 12px; }
.mapp-screen[data-screen="convert"] .mapp-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mapp-title { font-size: 24px; margin-bottom: 10px; }
.mapp-sub { margin: -4px 0 12px; font-size: 14px; }

.mapp .bx-steps { gap: 4px; }
.mapp .bx-step { gap: 6px; }
.mapp .bx-step__bar { height: 4px; }
.mapp .bx-step__name { font-size: 10px; line-height: 12px; letter-spacing: .1em; }
.mapp .bx-body { padding-top: 12px; gap: 10px; }
.mapp .bx-row { padding: 10px 14px; border-radius: 16px; gap: 2px; }
.mapp .bx-input--figure { font-size: 32px; line-height: 36px; min-height: 38px; }
.mapp .bx-figure { font-size: 28px; line-height: 32px; }
.mapp .bx-row .bx-help { margin-top: 2px; font-size: 12px; line-height: 16px; }
.mapp .bx-label { font-size: 13px; line-height: 16px; margin-bottom: 4px; }
.mapp .bx-help { font-size: 12px; line-height: 16px; margin-top: 4px; }
.mapp .bx-input { min-height: 44px; border-radius: 12px; font-size: 16px; }
.mapp .bx-grid2 { gap: 10px; }
.mapp .bx-meta { gap: 4px; padding: 0 2px; }
.mapp .bx-meta > div { font-size: 13px; line-height: 18px; }
.mapp .bx-grid2 ~ .bx-meta > div:nth-child(3) { display: none; } /* network already shown in the selector */
.mapp .bx-btn { min-height: 50px; border-radius: 14px; font-size: 16px; }
.mapp .bx-btn--sm { min-height: 36px; }
.mapp .bx-alert { padding: 8px 12px; font-size: 13px; line-height: 18px; }

/* Step 2 */
.mapp .bx-summary { padding: 10px 14px; border-radius: 16px; }
.mapp .bx-summary p { margin-top: 2px; font-size: 15px; line-height: 20px; }
.mapp .bx-verified { padding: 8px 12px; }

/* Step 3: QR beside the address instead of above it */
.mapp .bx-payhead .bx-help { margin-top: 2px; }
.mapp .bx-deposit { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.mapp .bx-qr { width: 112px; margin: 0; padding: 6px; border-radius: 10px; }
.mapp .bx-deposit__addr { gap: 6px; justify-items: start; }
.mapp .bx-address { font-size: 12px; line-height: 16px; padding: 8px 10px; border-radius: 10px; }
.mapp .bx-deposit .bx-help { margin-top: 0; }
.mapp-screen[data-screen="convert"] .bx-actions:last-child > .bx-btn { min-height: 44px; font-size: 15px; }

/* Receipt */
.mapp .bx-receipt { gap: 12px; }
.mapp .bx-receipt__title { font-size: 20px; }
.mapp .bx-receipt__amount { padding: 12px 14px; border-radius: 16px; }
.mapp .bx-receipt__figure { font-size: 28px; line-height: 32px; }
.mapp .bx-receipt__rows { padding-top: 10px; }
.mapp .bx-receipt__note { font-size: 12px; }

/* Tab bar */
.mapp-tabs { padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); }
.mapp-tab { gap: 2px; padding: 6px 4px; font-size: 11px; }
.mapp-tab svg { width: 22px; height: 22px; }

/* Short phones: tighten further */
@media (max-height: 700px) {
  .mapp .bx-input--figure { font-size: 28px; line-height: 32px; min-height: 34px; }
  .mapp .bx-figure { font-size: 24px; line-height: 28px; }
  .mapp .bx-body { gap: 8px; }
  .mapp .bx-input { min-height: 42px; }
  .mapp .bx-btn { min-height: 46px; }
}

/* Step 3 / receipt: keep header and actions on one line */
.mapp .bx-payhead { flex-wrap: nowrap; align-items: center; }
.mapp .bx-payhead > div:first-child { min-width: 0; }
.mapp .bx-payhead .bx-pill { padding: 3px 10px; letter-spacing: .08em; }
.mapp-screen[data-screen="convert"] .bx-body > .bx-actions:last-child { flex-wrap: nowrap; gap: 8px; }
.mapp-screen[data-screen="convert"] .bx-body > .bx-actions:last-child > .bx-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; white-space: nowrap; }
.mapp .bx-receipt__head { flex-wrap: nowrap; }
.mapp .bx-receipt__head > .bx-pill { margin-left: auto; padding: 3px 10px; letter-spacing: .08em; }
.mapp .bx-grid2 { grid-template-columns: 1fr 1fr; }

/* Premium pass (sizes unchanged so every step still fits one screen) */
@media (min-width: 600px) and (min-height: 640px) {
  .mapp-body { background: #070707; }
  .mapp { border-color: var(--hair); box-shadow: 0 60px 120px -60px rgba(0,0,0,.9), 0 0 0 10px #0B0B0B, 0 0 0 11px var(--hair); }
}
.mapp-top { background: rgba(0,0,0,.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--hair); }
.mapp-tabs { background: rgba(13,13,13,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top-color: var(--hair); }
.mapp-tab { position: relative; font-weight: 500; }
.mapp-tab[aria-current="page"]::before { content: ""; position: absolute; top: -4px; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: var(--brand); }
.mapp .bx-btn { border-radius: 999px; font-weight: 600; }
.mapp .bx-row, .mapp .bx-summary, .mapp .bx-receipt__amount, .mapp .bx-card--receipt { background: var(--surface); border-color: var(--hair); }
.mapp .bx-input { background: var(--surface); border-color: var(--line); }
.mapp .bx-input--figure { background: transparent; }
.mapp .bx-figure, .mapp .bx-input--figure { font-weight: 400; letter-spacing: -0.03em; }
.mapp .bx-step__bar { height: 3px; }
.mapp .bx-label { font-weight: 500; color: var(--ink-soft); }
.mapp .bx-pill { background: transparent; }
.mapp .bx-btn--secondary { border-color: var(--line); }
.mapp .bx-input.bx-input--figure { font-size: 34px; line-height: 38px; min-height: 40px; padding: 0; border: 0; background: transparent; }
@media (max-height: 700px) { .mapp .bx-input.bx-input--figure { font-size: 30px; line-height: 34px; min-height: 36px; } }

/* Two tabs: Convert, Activity */
.mapp-tabs { grid-template-columns: repeat(2, 1fr); }
.mapp .bx-grid2 ~ .bx-meta > div:nth-child(3) { display: flex; }

.mapp .bx-live { padding: 6px 8px 18px; }
@media (max-height: 700px) { .mapp .bx-live { padding: 2px 8px 12px; } }
@media (max-height: 640px) { .mapp .bx-live { padding: 0 8px 10px; gap: 2px; } .mapp .bx-live__value { font-size: 38px; } .mapp .bx-live__sub { font-size: 13px; line-height: 18px; } }
.mapp .bx-live__sub, .bx-live__sub { font-size: 12px; line-height: 16px; letter-spacing: .01em; }
.mapp .bx-live__sub, .bx-live__sub { font-size: 10px; line-height: 14px; letter-spacing: .02em; }
.mapp .bx-live__label, .bx-live__label { font-size: 12px; line-height: 16px; letter-spacing: .14em; }
