/* ═══════════════════════════════════════════════════════════
   Rewards System — Mobile CSS
   Optimized for Android / iOS touchscreens
═══════════════════════════════════════════════════════════ */

:root {
  --m-topbar-h:    56px;
  --m-bottomnav-h: 68px;
  --m-primary:     #0d6efd;
  --m-dark:        #0f172a;
  --m-surface:     #f1f5f9;
  --m-card-bg:     #ffffff;
  --m-radius:      16px;
  --m-accent:      #facc15;
  --font: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; overflow: hidden; }

body.m-body {
  font-family: var(--font);
  background: var(--m-surface);
  color: #1e293b;
  font-size: .9rem;
  overscroll-behavior: none;
}

/* ── Top Bar ──────────────────────────────────────────── */
.m-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--m-topbar-h);
  background: var(--m-dark);
  z-index: 100;
  display: flex;
  align-items: center;
}

.m-topbar-inner {
  width: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-store-name {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
}

.m-logout-btn {
  color: rgba(255,255,255,.7);
  font-size: 1.25rem;
  text-decoration: none;
  padding: .25rem;
  line-height: 1;
}
.m-logout-btn:hover { color: #fff; }

/* ── Page Content ─────────────────────────────────────── */
.m-content {
  position: fixed;
  top: var(--m-topbar-h);
  bottom: var(--m-bottomnav-h);
  left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
}

/* ── Bottom Navigation ────────────────────────────────── */
.m-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--m-bottomnav-h);
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.m-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .4rem 0;
  transition: color .15s;
  gap: 3px;
}
.m-nav-item i { font-size: 1.3rem; line-height: 1; }
.m-nav-item.active { color: var(--m-primary); }
.m-nav-item.active i { color: var(--m-primary); }

/* Center Scan Button */
.m-nav-center { position: relative; top: -8px; }
.m-nav-center-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(13,110,253,.45);
  margin-bottom: 2px;
  border: 3px solid #fff;
}
.m-nav-center.active .m-nav-center-btn {
  background: linear-gradient(135deg, #0a58ca, #0284c7);
}
.m-nav-center span { color: #94a3b8; font-size: .65rem; }
.m-nav-center.active span { color: var(--m-primary); }

/* ── Cards ────────────────────────────────────────────── */
.m-card {
  background: var(--m-card-bg);
  border-radius: var(--m-radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  margin-bottom: 1rem;
  overflow: hidden;
}

.m-card-header {
  padding: .85rem 1rem;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid #f1f5f9;
}

.m-card-body { padding: 1rem; }

/* ── Stat Grid ────────────────────────────────────────── */
.m-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}

.m-stat {
  background: #fff;
  border-radius: var(--m-radius);
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.m-stat-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  margin-bottom: .3rem;
}

.m-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.m-stat-sub { font-size: .7rem; color: #94a3b8; margin-top: .2rem; }

/* ── Scanner Area ─────────────────────────────────────── */
.m-scanner-wrap {
  position: relative;
  background: #000;
  border-radius: var(--m-radius);
  overflow: visible; /* BUG FIX: was 'hidden' — clipped html5-qrcode's internal canvas/UI elements */
  width: 100%;
  min-height: 260px;
  margin-bottom: 1rem;
}

/* html5-qrcode internal video overrides
   BUG FIX: Selectors now cover ALL scanner IDs (m-qr-reader, m-qr-purchase, m-qr-redeem, m-qr-reg, m-qr-scan).
   Previously only scan.php was styled; purchase.php and redeem.php were unstyled.
   BUG FIX: object-fit changed from cover → contain.
   cover visually crops the video but html5-qrcode reads the raw uncropped frame,
   so the qrbox coordinates pointed to the wrong region and nothing ever decoded. */
#m-qr-reader,
#m-qr-purchase,
#m-qr-redeem,
#m-qr-reg,
#m-qr-scan {
  width: 100% !important;
  border: none !important;
}
#m-qr-reader video,
#m-qr-purchase video,
#m-qr-redeem video,
#m-qr-reg video,
#m-qr-scan video {
  width: 100% !important;
  object-fit: contain;
  border-radius: 0 !important;
}
#m-qr-reader img,
#m-qr-purchase img,
#m-qr-redeem img,
#m-qr-reg img,
#m-qr-scan img { display: none !important; }

/* Scanner frame overlay — matches qrbox: 80% wide, 60% tall */
.scanner-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 60%;
  pointer-events: none;
  z-index: 10;
}

.scanner-frame::before,
.scanner-frame::after,
.scanner-frame-inner::before,
.scanner-frame-inner::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #fff;
  border-style: solid;
}

.scanner-frame::before   { top:0;    left:0;  border-width: 3px 0 0 3px; }
.scanner-frame::after    { top:0;    right:0; border-width: 3px 3px 0 0; }
.scanner-frame-inner::before { bottom:0; left:0;  border-width: 0 0 3px 3px; }
.scanner-frame-inner::after  { bottom:0; right:0; border-width: 0 3px 3px 0; }

/* Animated scan line */
/* Animated scan line */
.scan-line {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0d6efd, #0ea5e9, transparent);
  z-index: 11;
  animation: scanMove 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scanMove {
  0%   { margin-top: -60px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { margin-top: 60px; opacity: 0; }
}

/* Scanner hint text */
.scanner-hint {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,.8);
  font-size: .75rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
}

/* ── Member Info Card ─────────────────────────────────── */
.m-member-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  border-radius: var(--m-radius);
  overflow: hidden;
  color: #fff;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
}

.m-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.m-member-name { font-weight: 700; font-size: 1rem; }
.m-member-card { font-family: monospace; font-size: .7rem; opacity: .7; margin-top: 1px; }

.m-member-points {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  margin-top: .35rem;
}

.m-member-pts-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--m-accent);
  line-height: 1;
}

.m-member-pts-label { font-size: .7rem; opacity: .8; }

/* Banner nested inside a card body — tighten padding so it doesn't feel double-padded */
.m-card-body .m-member-banner {
  margin-bottom: .75rem;
}

/* ── Inputs ───────────────────────────────────────────── */
.m-input-group {
  background: #f8fafc;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: .5rem;
  transition: border-color .15s;
  margin-bottom: 1rem;
}

.m-input-group:focus-within {
  border-color: var(--m-primary);
  background: #fff;
}

.m-input-group i { color: #94a3b8; font-size: 1.1rem; flex-shrink: 0; }

.m-input-group input,
.m-input-group textarea {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  padding: .85rem 0;
  font-size: 1rem;
  font-family: var(--font);
  color: #1e293b;
}

.m-input-label {
  font-size: .75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: .35rem;
  display: block;
}

/* ── Buttons ──────────────────────────────────────────── */
.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  padding: .9rem 1.5rem;
  border: none;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  width: 100%;
  text-decoration: none;
}

.m-btn:active { transform: scale(.97); }

.m-btn-primary {
  background: linear-gradient(135deg, #0d6efd, #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 16px rgba(13,110,253,.35);
}

.m-btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 16px rgba(5,150,105,.35);
}

.m-btn-warning {
  background: linear-gradient(135deg, #d97706, #facc15);
  color: #fff;
  box-shadow: 0 4px 16px rgba(217,119,6,.35);
}

.m-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,.3);
}

.m-btn-outline {
  background: #fff;
  color: var(--m-primary);
  border: 2px solid var(--m-primary);
  box-shadow: none;
}

.m-btn:disabled {
  opacity: .55;
  transform: none;
  cursor: not-allowed;
}

/* ── Points Preview Box ───────────────────────────────── */
.m-points-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px dashed #10b981;
  border-radius: var(--m-radius);
  text-align: center;
  padding: clamp(.75rem, 3vw, 1.25rem);
  margin-bottom: 1rem;
  overflow: hidden;
}

.m-points-number {
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 800;
  color: #059669;
  line-height: 1;
  word-break: break-all;
}

/* ── Alert ────────────────────────────────────────────── */
.m-alert {
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1rem;
}

.m-alert i { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.m-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.m-alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.m-alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.m-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── ATM Card (mobile size) ───────────────────────────── */
.m-reward-card {
  width: 100%;
  max-width: 340px;
  height: 210px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #0ea5e9 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(29,78,216,.4);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Transaction List ─────────────────────────────────── */
.m-txn-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.m-txn-item:last-child { border-bottom: none; }

.m-txn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.m-txn-icon.earn   { background: #ecfdf5; color: #059669; }
.m-txn-icon.redeem { background: #eff6ff; color: #0d6efd; }

.m-txn-name   { font-weight: 600; font-size: .875rem; }
.m-txn-code   { font-size: .7rem; color: #94a3b8; font-family: monospace; }
.m-txn-amount { margin-left: auto; text-align: right; flex-shrink: 0; }
.m-txn-pts    { font-weight: 700; font-size: .875rem; }
.m-txn-date   { font-size: .65rem; color: #94a3b8; }

/* ── Success Overlay ──────────────────────────────────── */
.m-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.m-success-card {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.m-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* ── Section Heading ──────────────────────────────────── */
.m-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #64748b;
  margin-bottom: .5rem;
  padding: 0 .25rem;
}

/* ── Quick Action Grid (dashboard) ───────────────────── */
.m-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}

.m-quick-btn {
  background: #fff;
  border-radius: var(--m-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: block;
  transition: transform .15s, box-shadow .15s;
}

.m-quick-btn:active { transform: scale(.96); }

.m-quick-btn i {
  font-size: 2rem;
  display: block;
  margin-bottom: .4rem;
}

.m-quick-btn span {
  font-size: .8rem;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   POS Tile Dashboard
   ══════════════════════════════════════════════════════ */

/* Greeting bar */
.pos-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .75rem;
  min-width: 0;
}
/* FIX 1: left side needs min-width:0 so it shrinks instead of pushing badge off-screen */
.pos-greeting > div:first-child {
  min-width: 0;
  overflow: hidden;
}
.pos-greeting-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-primary); /* FIX 2: was hardcoded #0f172a — invisible in dark mode */
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-greeting-date {
  font-size: .72rem;
  color: var(--color-text-secondary); /* FIX 2: was hardcoded #64748b */
  margin-top: 2px;
  white-space: nowrap;
}
.pos-today-badge {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff;
  border-radius: 14px;
  padding: .5rem .9rem;
  text-align: center;
  flex-shrink: 0;
  max-width: 130px;
}
.pos-today-label  { font-size: .6rem; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.pos-today-sales  { font-size: 1rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.pos-today-txns   { font-size: .65rem; opacity: .75; }

/* Tile grid */
.pos-tile-grid {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: -.3rem -.3rem .7rem;
}

/* Base tile — WebView-safe: no clamp(), no gap, no filter */
.pos-tile {
  background: #3b82f6;
  border-radius: 16px;
  color: #fff !important;
  text-decoration: none !important;
  text-align: center;
  padding: .75rem .4rem .65rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 80px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: .3rem;
  width: calc(33.333% - .6rem);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.pos-tile:active { opacity: .85; }

.pos-tile i {
  font-size: 1.75rem;
  display: block;
  margin-bottom: .25rem;
  color: #fff !important;
}
.pos-tile span {
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff !important;
  display: block;
}

/* Wide tile — 2/3 width */
.pos-tile-wide {
  width: calc(66.666% - .6rem);
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 70px;
}
.pos-tile-wide i   { font-size: 1.9rem; margin-bottom: 0; margin-right: .5rem; }
.pos-tile-wide span{ font-size: .88rem; }

/* Stat tile */
.pos-stat-tile { min-height: 90px; padding: .7rem .3rem .65rem; }
.pos-stat-tile i { font-size: 1.2rem; margin-bottom: .1rem; }
.pos-stat-num {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  margin: .1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #fff !important;
  display: block;
}
.pos-stat-tile span { font-size: .67rem; font-weight: 600; }

/* ── Print area (hidden) ─────────────────────────────── */
#m-printArea { display: none; }

@media print {
  body > * { display: none !important; }
  body > #m-printArea {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw; height: 100vh;
  }
  .m-reward-card {
    width: 3.375in !important;
    height: 2.125in !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ── Shared ATM Card Sub-elements (used in mobile card) ── */
.m-reward-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 6px;
  position: relative;
  z-index: 2;
}
.m-reward-card .chip {
  width: 32px; height: 24px;
  background: linear-gradient(145deg, #d4a017, #f5d060, #c8860a);
  border-radius: 4px; position: relative; overflow: hidden;
}
.m-reward-card .chip-inner {
  position: absolute; inset: 3px;
  border: 1px solid rgba(0,0,0,.2); border-radius: 2px;
  background: linear-gradient(145deg, #e8b824, #c8860a);
}
.m-reward-card .card-store-name {
  font-size: .55rem; font-weight: 700; letter-spacing: .16em;
}
.m-reward-card .card-stripe {
  background: rgba(0,0,0,.22);
  padding: 3px 0 2px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
}
.m-reward-card .card-stripe svg { width: 100%; height: 36px; padding: 0 8px; }
.m-reward-card .card-bottom {
  flex: 1; display: flex; align-items: flex-end;
  justify-content: space-between;
  padding: 4px 14px 12px; position: relative; z-index: 2;
}
.m-reward-card .card-label   { font-size: .45rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 2px; }
.m-reward-card .card-number  { font-size: .7rem; font-weight: 700; letter-spacing: .1em; font-family: 'Courier New', monospace; }
.m-reward-card .card-validity{ font-size: .5rem; letter-spacing: .1em; margin-top: 2px; }
.m-reward-card .card-qr-wrap img,
.m-reward-card .card-qr-wrap canvas { width: 64px !important; height: 64px !important; border-radius: 4px; display: block; }
.m-reward-card .card-shimmer-overlay {
  position: absolute; top: -60%; left: -40%; width: 100%; height: 180%;
  background: linear-gradient(105deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.12) 50%, rgba(255,255,255,0) 70%);
  transform: rotate(-15deg); pointer-events: none; z-index: 1;
}
.m-reward-card .card-circle-deco {
  position: absolute; right: -35px; top: -35px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none; z-index: 1;
}

/* ── Menu Row (Settings / More page) ─────────────────── */
.m-menu-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
  min-height: 56px; /* guaranteed touch target */
}
.m-menu-row:last-child { border-bottom: none; }
.m-menu-row:active     { background: #f8fafc; }

.m-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Mobile Button Refinements ────────────────────────── */

/* Prevent button text from overflowing on very narrow screens */
.m-btn {
  min-height: 52px;        /* strong touch target */
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Secondary / icon-only button variant */
.m-btn-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Ensure stacked buttons (with Bootstrap mb-2) don't collapse on tiny screens */
.m-btn + .m-btn {
  margin-top: 0; /* gap comes from mb-2 utility */
}

/* ── Safe Area Insets (iPhone notch / home bar) ───────── */
.m-content {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.m-bottom-nav {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), .5rem);
  height: calc(var(--m-bottomnav-h) + env(safe-area-inset-bottom, 0px));
}

/* ── Extra-small phones (≤ 360px width) ──────────────── */
@media (max-width: 360px) {
  .m-stat-value    { font-size: 1.2rem; }
  .m-nav-item      { font-size: .58rem; }
  .m-nav-center-btn{ width: 52px; height: 52px; font-size: 1.3rem; }
  .m-topbar-inner  { padding: 0 .75rem; }
  .m-content       { padding: .75rem; }
  .m-btn           { font-size: .92rem; padding: .8rem 1rem; }
}

/* ── Step Progress Dots (purchase / multi-step flows) ─── */
.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
  transition: background .2s;
}
.step-dot.active { background: var(--m-primary); }

/* ── Inline / auto-width button modifier ─────────────── */
.m-btn-auto {
  width: auto;
  display: inline-flex;
  padding: .7rem 1.5rem;
}

/* ── Large amount input (purchase & redeem) ───────────── */
.m-input-lg {
  font-size: 1.25rem;
  font-weight: 700;
}
