/* Livin' Food Stamp prototype. Colours sampled from the Food Stamp logo. */
:root {
  --navy: #0b2f7a;
  --navy-2: #1a47a8;
  --blue: #1ea0f0;
  --blue-text: #0f7fd0;
  --blue-soft: #e7f4fe;
  --yellow: #ffc72c;
  --yellow-deep: #f2a900;
  --yellow-soft: #fff6d6;
  --green: #16a34a;
  --ink: #0f1b3d;
  --text-2: #3a4560;
  --muted: #5e6b85;
  --line: #e2e8f1;
  --bg: #f3f6fb;
  --page: #e8f1fb;
  --shadow-sm: 0 1px 2px rgba(15, 27, 61, 0.06), 0 2px 8px rgba(15, 27, 61, 0.04);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, #d3e9fd 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #fff1c7 0%, transparent 55%),
    var(--page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
svg { display: block; }
b { font-weight: 800; }

/* ---------- Page layout ---------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
  align-items: start;
}
.stage { display: flex; justify-content: center; min-width: 0; }
.app[data-view='dashboard'] .stage { display: block; }

/* ---------- Phone frame ---------- */
.phone {
  width: 414px;
  height: min(868px, calc(100vh - 56px));
  min-height: 640px;
  padding: 12px;
  border-radius: 56px;
  background: #0d1530;
  box-shadow: 0 40px 80px -30px rgba(11, 47, 122, 0.55), inset 0 0 0 2px #2a3558;
  flex-shrink: 0;
}
.phone-inner {
  position: relative;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.phone-inner::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 134px;
  height: 5px;
  margin-left: -67px;
  border-radius: 3px;
  background: #0f1b3d;
  opacity: 0.85;
  z-index: 50;
  pointer-events: none;
}
.phone.status-dark .phone-inner::after { background: #fff; opacity: 0.7; }

.statusbar {
  position: relative;
  z-index: 40;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 30px 0 34px;
  font-size: 15px;
  font-weight: 700;
  background: #1ea0f0;
  color: #fff;
  transition: background 0.2s;
}
.phone[data-status='white'] .statusbar { background: #fff; color: var(--ink); }
.phone.status-dark .statusbar { background: transparent; color: #fff; }
.island { position: absolute; left: 50%; top: 10px; width: 120px; height: 33px; margin-left: -60px; border-radius: 20px; background: #000; }
.sb-icons { display: flex; align-items: center; gap: 6px; }
.sb-icons svg { height: 12px; width: auto; fill: currentColor; }

.screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }
.scroll.pad { padding: 16px; }
.spacer { height: 24px; }

/* ---------- App bar & tab bar ---------- */
.appbar { flex: 0 0 auto; padding: 4px 8px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.appbar.blue { background: linear-gradient(180deg, #1ea0f0 0%, #1689dd 100%); color: #fff; border-bottom: 0; }
.ab-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.ab-title { margin: 0; font-size: 17px; font-weight: 800; text-align: center; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.icon-btn svg { width: 22px; height: 22px; }
.dot-badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--yellow); color: var(--navy); font-size: 11px; font-weight: 800; line-height: 18px;
}
.ab-addr { display: flex; align-items: center; gap: 6px; padding: 2px 12px 2px; font-size: 13px; opacity: 0.95; }
.ab-addr svg { width: 16px; height: 16px; flex-shrink: 0; }

.tabbar { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 0 24px; background: #fff; border-top: 1px solid var(--line); }
.tb { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tb svg { width: 22px; height: 22px; }
.tb.on { color: var(--blue-text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 22px; border-radius: 14px; font-size: 15px; font-weight: 800;
  transition: transform 0.1s, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { border: 1.5px solid var(--line); color: var(--navy); background: #fff; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.45; }
.btn svg { width: 16px; height: 16px; }
.link-btn { display: inline-flex; align-items: center; gap: 2px; color: var(--blue-text); font-size: 13px; font-weight: 700; }
.link-btn svg { width: 16px; height: 16px; }

/* ---------- Shared bits ---------- */
.mbadge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  height: 22px; padding: 0 7px; border-radius: 6px; background: var(--mc); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.rating { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); font-weight: 700; }
.rating svg { width: 13px; height: 13px; color: var(--yellow-deep); }

.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: #e1e7f1; }
.dots i.ms { box-shadow: 0 0 0 2px var(--yellow); }
.dots i.f { background: var(--navy); }
.dots i.p { background: var(--yellow); animation: pulse 1.2s ease-in-out infinite; }

/* ---------- Stamp card (like the card in the logo) ---------- */
.stampcard {
  position: relative;
  overflow: hidden;
  padding: 10px 14px 22px;
  border: 3px solid var(--navy);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 14px 28px -14px rgba(11, 47, 122, 0.45);
}
.stampcard::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--yellow); }
.sc-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 2px solid #d6e8f8; }
.sc-wordmark { height: 30px; width: auto; mix-blend-mode: multiply; }
.sc-right { display: flex; align-items: center; gap: 6px; }
.sc-cycle { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--yellow-soft); color: #7a5200; }
.sc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px;
  padding: 12px 2px 6px;
  background: linear-gradient(#d6e8f8, #d6e8f8) center / 100% 2px no-repeat;
}
.slot {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 50px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid #c5cfdf;
  background: #eef2f8;
  color: #9aa6bc;
  font-size: 13px;
  font-weight: 700;
}
.slot .fork, .slot svg { width: 56%; height: 56%; }
.slot.ms { border-style: dashed; border-color: var(--yellow-deep); background: var(--yellow-soft); color: #946400; }
.slot.ms b { font-size: 12.5px; }
.slot.filled { border-style: solid; border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.slot.filled.ms { border-color: var(--yellow); box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px rgba(255, 199, 44, 0.45); }
.slot.just { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.slot.just::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid var(--navy); opacity: 0; animation: ink 0.6s ease-out;
}
.sc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.sc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }

/* ---------- Home ---------- */
.hero { margin: 16px; padding: 10px 10px 16px; border-radius: 20px; background: #fff; text-align: center; box-shadow: var(--shadow-sm); }
.hero img { display: block; width: 100%; height: auto; }
.hero p { margin: 6px 12px 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.sec-title { margin: 20px 16px 10px; font-size: 16px; font-weight: 800; }
.hscroll { display: flex; gap: 12px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
.minicard {
  flex: 0 0 210px; scroll-snap-align: start; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; text-align: left; box-shadow: var(--shadow-sm);
}
.mc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mc-count { font-size: 13px; color: var(--muted); }
.mc-count b { font-size: 20px; color: var(--navy); }
.mc-next { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.mlist { display: grid; gap: 10px; padding: 0 16px 24px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; text-align: left; box-shadow: var(--shadow-sm); }
.mrow > svg { width: 18px; height: 18px; color: var(--muted); }
.mrow-img { flex: 0 0 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; font-size: 30px; background: color-mix(in srgb, var(--mc) 10%, #fff); }
.mrow-body { flex: 1; min-width: 0; }
.mrow-name { font-size: 15px; font-weight: 700; }
.mrow-meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tag-stamp {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 8px; border-radius: 999px;
  background: var(--blue-soft); color: var(--navy); font-size: 11.5px; font-weight: 700;
}
.tag-stamp svg { width: 13px; height: 13px; }

/* ---------- Merchant storefront ---------- */
.promo-float {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px;
  background: linear-gradient(90deg, var(--yellow), #ffd95e); color: var(--navy);
  font-size: 13px; font-weight: 800; text-align: left; line-height: 1.3;
  box-shadow: 0 4px 12px rgba(242, 169, 0, 0.25);
}
.promo-float svg { width: 20px; height: 20px; flex-shrink: 0; }
.promo-float span { flex: 1; }
.promo-float svg:last-child { width: 16px; height: 16px; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px; }
.m-logo { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--mc); color: #fff; font-size: 14px; font-weight: 800; }
.m-name { font-size: 17px; font-weight: 800; }
.m-meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.stamp-section { padding: 12px 16px 4px; }
.sc-progress { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sc-progress b { font-size: 15px; color: var(--navy); white-space: nowrap; }
.sc-progress span { font-size: 12.5px; color: var(--muted); text-align: right; }
.sc-rule {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--muted); line-height: 1.4;
}
.sc-rule > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--blue); }
.sc-rule .link-btn { margin-left: auto; }
.voucher-hint {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px;
  border: 1px solid #ffe08a; background: var(--yellow-soft); color: #6b4a00; font-size: 13px; text-align: left;
}
.voucher-hint svg { width: 20px; height: 20px; flex-shrink: 0; }
.voucher-hint svg:last-child { margin-left: auto; width: 16px; height: 16px; }
.cat-chips { display: flex; gap: 8px; padding: 16px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.menu-sec { padding: 4px 16px; }
.menu-sec h3 { margin: 12px 0 8px; font-size: 15px; font-weight: 800; }
.mi { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.mi-img { flex: 0 0 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; background: #fff4e5; font-size: 34px; }
.mi-body { flex: 1; min-width: 0; }
.mi-name { font-size: 14.5px; font-weight: 700; }
.pill { margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: #ffe9ec; color: #c4122f; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.mi-desc { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.mi-price { font-size: 14px; font-weight: 800; color: var(--navy); }
.add-btn { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }
.add-btn svg { width: 18px; height: 18px; }
.stepper { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 999px; background: var(--blue-soft); flex-shrink: 0; }
.stepper button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.stepper svg { width: 16px; height: 16px; }
.stepper span { min-width: 16px; text-align: center; font-size: 14px; font-weight: 800; }

.cartbar-wrap { flex: 0 0 auto; padding: 8px 12px 26px; background: #fff; border-top: 1px solid var(--line); }
.cb-hint { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px 14px 0 0; font-size: 12.5px; }
.cb-hint svg { width: 16px; height: 16px; flex-shrink: 0; }
.cb-hint.warn { background: var(--yellow-soft); color: #6b4a00; }
.cb-hint.ok { background: #e6f6ec; color: #0f7a3d; }
.cartbar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 16px; border-radius: 0 0 14px 14px; background: var(--navy); color: #fff; text-align: left; }
.cb-left { display: flex; flex-direction: column; }
.cb-left span { font-size: 12px; opacity: 0.8; }
.cb-left b { font-size: 16px; }
.cb-go { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--yellow); }
.cb-go svg { width: 18px; height: 18px; }

/* ---------- Cart ---------- */
.card { display: block; margin: 12px 16px 0; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.scroll.pad .card { margin: 0 0 12px; }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 800; }
.addr-card { display: flex; align-items: center; gap: 10px; }
.addr-card > svg { width: 20px; height: 20px; color: var(--navy); flex-shrink: 0; }
.addr-card div { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.addr-card span { font-size: 12.5px; color: var(--muted); }
.addr-card .eta { margin-left: auto; padding: 4px 8px; border-radius: 999px; background: #e6f6ec; color: #0f7a3d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cl { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.card-title + .cl { border-top: 0; }
.cl-img { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #fff4e5; font-size: 24px; }
.cl.reward .cl-img { background: var(--yellow-soft); }
.cl-body { flex: 1; min-width: 0; }
.cl-name { font-size: 14px; font-weight: 700; }
.cl-sub { font-size: 12.5px; color: var(--muted); }
.cl-price { display: flex; flex-direction: column; align-items: flex-end; }
.cl-price s { font-size: 12px; color: var(--muted); }
.cl-price b { font-size: 13px; color: var(--green); }
.add-more { margin-top: 6px; }

.stampbox { border: 2px solid #cfe6fa; background: linear-gradient(180deg, #f2f9ff 0%, #fff 45%); }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--navy); }
.sb-title .fork { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--navy); color: #fff; }
.sb-earn { padding: 4px 10px; border-radius: 999px; background: #eef2f8; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.sb-earn.on { background: var(--yellow); color: var(--navy); }
.sb-dots { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sb-dots .dots { flex: 1; max-width: 190px; }
.sb-dots span { font-size: 12px; color: var(--muted); }
.sb-dots span b { color: var(--navy); }
.sb-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: #e1e7f1; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--navy)); transition: width 0.4s; }
.sb-bar span { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nudge { margin-top: 12px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--yellow); background: #fff4cc; color: #5c4100; }
.nudge-text { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.45; }
.nudge-text svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--yellow-deep); }
.nudge-text b { color: #3d2b00; }
.nudge-unlock { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f2c94c; font-size: 12.5px; }
.nudge-unlock svg { width: 16px; height: 16px; flex-shrink: 0; }
.quick-row { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.qa {
  flex: 0 0 116px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px;
  border-radius: 14px; border: 1.5px solid var(--line); background: #fff; text-align: left; transition: transform 0.1s;
}
.qa:active { transform: scale(0.97); }
.qa.fit { border-color: #34b46a; background: #f3fbf6; }
.qa-emoji { font-size: 24px; line-height: 1.2; }
.qa-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; min-height: 2.5em; }
.qa-price { font-size: 12.5px; font-weight: 800; color: var(--navy); }
.qa-fit { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--green); }
.qa-fit svg { width: 12px; height: 12px; }
.qa-fit.muted { color: var(--muted); font-weight: 600; }
.sb-info { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eaf5fe; color: var(--navy); font-size: 13px; }
.sb-info svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--blue); }
.sb-basis { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

.vrow { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); text-align: left; }
.vrow > svg:first-child { width: 22px; height: 22px; flex-shrink: 0; color: var(--yellow-deep); }
.vrow > svg:last-child:not(:first-child) { width: 18px; height: 18px; color: var(--muted); }
.vrow div { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.vrow div span { font-size: 12px; color: var(--muted); }
.vrow.applied { border-color: var(--yellow); background: var(--yellow-soft); }
.vrow:disabled { opacity: 0.7; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13.5px; color: var(--text-2); }
.sum-row.disc span:last-child { color: var(--green); font-weight: 700; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 15px; }
.sum-total b { font-size: 17px; color: var(--navy); }
.pay-method { display: flex; align-items: center; gap: 12px; }
.pay-method > svg { width: 22px; height: 22px; color: var(--blue); }
.pay-method div { display: flex; flex-direction: column; font-size: 14px; }
.pay-method span { font-size: 12.5px; color: var(--muted); }
.ok-chip { margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; }
.ok-chip svg { width: 14px; height: 14px; stroke-width: 3; }
.paybar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 28px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(15, 27, 61, 0.06);
}
.pb-total { display: flex; flex-direction: column; }
.pb-total span { font-size: 12px; color: var(--muted); }
.pb-total b { font-size: 18px; color: var(--navy); }
.paybar .btn { min-width: 150px; }

.empty { padding: 48px 24px; text-align: center; }
.empty-emoji { font-size: 48px; }
.empty-img { width: 170px; height: auto; mix-blend-mode: multiply; }
.empty h3 { margin: 12px 0 6px; font-size: 17px; font-weight: 800; }
.empty p { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Vouchers & history ---------- */
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-bottom: 1px solid var(--line); }
.seg-tabs button { padding: 13px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg-tabs button.on { color: var(--navy); box-shadow: inset 0 -3px 0 var(--blue); }
.vcard { position: relative; display: flex; margin-bottom: 12px; border-radius: 18px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.vc-stub {
  position: relative; flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 14px 6px; border-radius: 17px 0 0 17px; border-right: 2px dashed rgba(11, 47, 122, 0.25);
  background: var(--yellow); color: var(--navy);
}
.vc-stub::before, .vc-stub::after { content: ''; position: absolute; right: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.vc-stub::before { top: -9px; }
.vc-stub::after { bottom: -9px; }
.vc-stub b { font-size: 24px; font-weight: 800; }
.vfm .vc-stub { background: linear-gradient(160deg, var(--blue), var(--navy)); color: #fff; border-right-color: rgba(255, 255, 255, 0.4); }
.vfm .vc-stub b { font-size: 17px; }
.vc-stub span { font-size: 11px; font-weight: 700; opacity: 0.85; }
.vc-body { flex: 1; min-width: 0; padding: 12px 14px; }
.vc-merchant { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.vc-title { margin: 6px 0 8px; font-size: 14.5px; font-weight: 800; line-height: 1.3; }
.vc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.vcard.used { opacity: 0.6; filter: grayscale(0.6); }
.used-chip { padding: 4px 8px; border-radius: 999px; background: #eef2f8; font-size: 11px; font-weight: 700; }
.order .o-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.order .o-head span { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.o-stamp { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #eef2f8; color: var(--muted); font-size: 12.5px; }
.o-stamp svg { width: 16px; height: 16px; flex-shrink: 0; }
.o-stamp.on { background: var(--blue-soft); color: var(--navy); font-weight: 700; }

/* ---------- Bottom sheet & toast ---------- */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(8, 20, 50, 0.45); animation: fade 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 86%; overflow-y: auto;
  padding: 8px 20px 30px; border-radius: 24px 24px 0 0; background: #fff;
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-grip { width: 40px; height: 5px; margin: 4px auto 14px; border-radius: 3px; background: #d5dce8; }
.sheet h3 { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
.rules { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 12px; }
.r-ico { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--navy); }
.r-ico svg { width: 20px; height: 20px; }
.r-ico.warn { background: #fff1e6; color: #c2570c; }
.r-ico.y { background: var(--yellow); color: var(--navy); }
.r-ico b { font-size: 12.5px; }
.rules li > div b { font-size: 14px; }
.rules p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.fine { margin: 16px 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.vpick { display: grid; gap: 10px; margin-bottom: 12px; }
.vpick-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); text-align: left; }
.vpick-item > span:nth-child(2) { display: flex; flex-direction: column; font-size: 14px; }
.vpick-item small { font-size: 12px; color: var(--muted); }
.vpick-item > svg { width: 18px; height: 18px; margin-left: auto; color: var(--muted); }
.vp-stub { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: var(--yellow); color: var(--navy); font-size: 15px; font-weight: 800; }
.vp-stub.vfm { background: var(--navy); color: #fff; font-size: 12px; }
.toast {
  position: absolute; left: 50%; bottom: 120px; z-index: 60; width: max-content; max-width: 86%;
  padding: 10px 16px; border-radius: 12px; background: rgba(15, 27, 61, 0.92); color: #fff;
  font-size: 13px; font-weight: 600; text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Payment + celebration overlay ---------- */
.overlay { position: absolute; inset: 0; z-index: 30; }
.processing {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(243, 246, 251, 0.94); backdrop-filter: blur(4px); animation: fade 0.2s;
}
.processing b { font-size: 16px; color: var(--navy); }
.processing span { font-size: 13px; color: var(--muted); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #d6e4f5; border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
.cele {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 58px 20px 30px; color: #fff;
  background: radial-gradient(120% 70% at 50% 30%, #1e5bc6 0%, #0b2f7a 55%, #071d4f 100%);
  animation: fade 0.35s ease-out;
}
.cele-skip { position: absolute; top: 56px; right: 16px; z-index: 6; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.9); font-size: 13px; font-weight: 700; }
.cele-top { text-align: center; }
.cele-check {
  width: 54px; height: 54px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%;
  background: #22c55e; color: #fff; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.22); animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.cele-check svg { width: 28px; height: 28px; stroke-width: 3; }
.cele-paid { font-size: 18px; font-weight: 800; }
.cele-amt { margin-top: 2px; font-size: 13px; opacity: 0.75; }
.cele-stage { position: relative; flex: 1; width: 100%; min-height: 300px; display: flex; align-items: center; justify-content: center; perspective: 800px; }
.cele-card { width: 100%; max-width: 340px; }
.cele-card.thump { animation: thump 0.28s ease-out; }
.stamper { position: absolute; top: 0; left: 0; z-index: 3; width: 80px; height: 100px; opacity: 0; pointer-events: none; transform-origin: 50% 100%; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.3)); }
.cele-msg { min-height: 66px; text-align: center; }
.cele-count { font-size: 22px; font-weight: 800; color: var(--yellow); }
.cele-sub { margin-top: 4px; font-size: 13.5px; line-height: 1.4; opacity: 0.88; }
.cele-actions { display: grid; gap: 10px; width: 100%; min-height: 106px; margin-top: 14px; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; }
.cele-actions.show { opacity: 1; transform: none; }
.cele .btn.primary { background: var(--yellow); color: var(--navy); }
.cele .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, 0.35); color: #fff; }

.gift-scene { position: relative; width: 280px; height: 330px; }
.rays {
  position: absolute; left: 50%; top: 42%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.12) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  opacity: 0; transition: opacity 0.6s;
}
.opened .rays { opacity: 1; animation: spin 14s linear infinite; }
.gift { position: absolute; left: 50%; bottom: 8px; z-index: 2; width: 150px; height: 140px; margin-left: -75px; }
.gift.shake { animation: wiggle 0.45s ease-in-out infinite; }
.gift-body {
  position: absolute; left: 10px; right: 10px; bottom: 0; height: 96px; border-radius: 0 0 14px 14px;
  border: 3px solid var(--navy); background: linear-gradient(#ffd34d, #f2a900);
}
.gift-body::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--blue); }
.gift-lid {
  position: absolute; left: 0; right: 0; top: 24px; z-index: 2; height: 36px; border-radius: 10px;
  border: 3px solid var(--navy); background: linear-gradient(#ffe07a, #ffc72c);
  transition: transform 0.6s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.5s 0.15s;
}
.gift-lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--blue); }
.bow { position: absolute; bottom: 100%; width: 36px; height: 26px; margin-bottom: -4px; border: 6px solid var(--blue); border-radius: 50%; }
.bow.l { right: 50%; transform: rotate(-22deg); transform-origin: right bottom; }
.bow.r { left: 50%; transform: rotate(22deg); transform-origin: left bottom; }
.opened .gift-lid { transform: translate(-50px, -150px) rotate(-38deg); opacity: 0; }
.reward-stack {
  position: absolute; left: 50%; bottom: 60px; z-index: 1; width: 260px; margin-left: -130px; display: grid; gap: 8px;
  opacity: 0; transform: translateY(30px) scale(0.4);
  transition: transform 0.75s 0.15s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.3s 0.15s;
}
.opened .reward-stack { opacity: 1; transform: translateY(-140px) scale(1); }
.rticket { display: flex; overflow: hidden; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
.rt-stub { flex: 0 0 70px; display: grid; place-items: center; background: var(--yellow); color: var(--navy); font-size: 20px; font-weight: 800; }
.rticket.vfm .rt-stub { background: linear-gradient(160deg, var(--blue), var(--navy)); color: #fff; font-size: 15px; }
.rt-body { display: flex; flex-direction: column; padding: 10px 12px; text-align: left; }
.rt-body b { font-size: 13.5px; line-height: 1.25; }
.rt-body span { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.confetti { position: absolute; top: 0; z-index: 4; border-radius: 2px; pointer-events: none; }

/* ---------- Demo panel ---------- */
.panel {
  position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow-y: auto;
  padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 20px 40px -24px rgba(11, 47, 122, 0.35); font-size: 13.5px;
}
.p-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.p-head img { width: 60px; height: auto; mix-blend-mode: multiply; }
.p-head b { display: block; font-size: 15px; }
.p-head span { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef2f8; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg button svg { width: 16px; height: 16px; flex-shrink: 0; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.seg.full { display: flex; }
.seg.full button { flex: 1; min-width: 0; padding: 8px 6px; font-size: 12.5px; }
.seg.sm button { padding: 5px 10px; font-size: 12px; }
.p-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.p-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.p-sec h4 .count { padding: 1px 7px; border-radius: 999px; background: #eef2f8; color: var(--navy); font-size: 11px; letter-spacing: 0; }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.p-btns { display: flex; gap: 6px; }
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 36px; height: 34px; padding: 0 10px;
  border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); font-size: 13px; font-weight: 700;
}
.pbtn:hover { border-color: #c5d3e8; background: #f7faff; }
.pbtn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pbtn svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--blue); }
.pbtn.wide { width: 100%; height: auto; margin-top: 8px; padding: 10px 12px; justify-content: flex-start; text-align: left; }
.pbtn.wide span { display: flex; flex-direction: column; }
.pbtn.wide small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.pbtn.danger, .pbtn.danger svg { color: #c4122f; }
.p-hint { margin: 0 0 6px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.toggle { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #cbd3e1; transition: background 0.2s; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.toggle.on { background: var(--green); }
.toggle.on i { transform: translateX(18px); }
.log-item { margin-bottom: 6px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); }
.log-item summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; cursor: pointer; list-style: none; }
.log-item summary::-webkit-details-marker { display: none; }
.log-item summary code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.log-item time { font-size: 11px; color: var(--muted); }
.lm { padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; }
.lm-post { background: #e6f6ec; color: #0f7a3d; }
.lm-call { background: #fff4cc; color: #7a5200; }
.log-item pre { margin: 0; max-height: 260px; overflow: auto; padding: 10px; background: #0f1b3d; color: #cfe3ff; font-family: var(--mono); font-size: 11px; line-height: 1.5; }

/* ---------- Merchant dashboard ---------- */
.dash { display: grid; gap: 20px; min-width: 0; }
.d-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.d-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.d-brand img { height: 26px; width: auto; mix-blend-mode: multiply; }
.d-top h2 { margin: 6px 0 4px; font-size: 26px; font-weight: 800; color: var(--navy); }
.d-top p { margin: 0; max-width: 560px; font-size: 14px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.kpi span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi b { display: block; margin: 6px 0 2px; font-size: 24px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); }
.d-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.dcard { min-width: 0; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.dcard h3 { margin: 0; font-size: 16px; font-weight: 800; }
.d-tablehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.d-tablehead .chips { display: flex; gap: 6px; }
.d-tablehead .btn { margin-left: auto; }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th { white-space: nowrap; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f9fc; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
td { padding: 11px 12px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.live td { background: #fffbea; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td code { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.live-pill { margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: var(--yellow); color: var(--navy); font-size: 10px; font-weight: 800; }
.rw, .st { padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.rw.v50 { background: var(--yellow-soft); color: #7a5200; }
.rw.vfm { background: var(--blue-soft); color: var(--navy); }
.st-wait { background: #fff1e6; color: #b45309; }
.st-sub { background: #e8f0ff; color: #1d4ed8; }
.st-done { background: #e6f6ec; color: #0f7a3d; }
.d-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13.5px; }
.econ { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 40px; align-items: center; }
.econ p { margin: 8px 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.econ p.fine { font-size: 12px; margin: 14px 0 0; }
.econ-bar { display: flex; gap: 2px; height: 14px; overflow: hidden; border-radius: 99px; }
.econ-bar i { min-width: 6px; }
.econ-bar .gmv, .sw.gmv { background: var(--navy); }
.econ-bar .v50, .sw.v50 { background: var(--yellow); }
.econ-bar .fm, .sw.fm { background: var(--blue); }
.econ-list { display: grid; gap: 8px; margin: 0; }
.econ-list div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.econ-list dt { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.econ-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.econ-list .tot { padding-top: 8px; border-top: 1px dashed var(--line); }
.econ-list .tot dt, .econ-list .tot dd { font-weight: 800; color: var(--navy); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Motion ---------- */
@keyframes pop { 0% { transform: scale(1.5); } 60% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes ink { 0% { opacity: 0.7; transform: scale(0.8); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes thump { 0% { transform: none; } 35% { transform: translateY(4px) scale(0.99); } 100% { transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg) translateY(-4px); } 75% { transform: rotate(7deg) translateY(-4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .econ { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; width: 100%; max-width: 560px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .app { padding: 0; gap: 16px; }
  .app[data-view='dashboard'] { padding: 16px; }
  .phone { width: 100%; height: 100vh; height: 100dvh; min-height: 0; padding: 0; border-radius: 0; box-shadow: none; }
  .phone-inner { border-radius: 0; }
  .island { display: none; }
  .panel { border-radius: 0; border-left: 0; border-right: 0; }
  .d-top h2 { font-size: 22px; }
}
