:root {
  --ink: #221F20;
  --ink-2: #4A4546;
  --muted: #8A8283;
  --line: #EDE5D8;
  --bg: #FBF6EE;
  --bg-2: #F4ECDF;
  --card: #FFFFFF;
  --ok: #1F9D55;
  --ok-bg: #DCFCE7;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --bad: #D92D20;
  --bad-bg: #FDE2E1;
  --info: #1E40AF;
  --info-bg: #E0EAFF;
  --sweet: #9B4F95;
  --choco: #452813;
  --jeera: #D37699;
  --jaljira: #899547;
  --khatta: #BA9F72;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(34, 31, 32, .06), 0 8px 24px rgba(34, 31, 32, .06);
  --shadow-lg: 0 10px 40px rgba(34, 31, 32, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.num, h1, h2, .big { font-family: "Barlow Condensed", Barlow, sans-serif; letter-spacing: .01em; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; position: relative; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(251, 246, 238, .88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .back {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; font: 700 20px/1.1 "Barlow Condensed", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title small { color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand img { width: 38px; height: 38px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.brand b { font: 800 22px/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; }
.brand small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .02em; }

.sync-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
}
.sync-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync-chip.pending i { background: var(--warn); animation: pulse 1.2s infinite; }
.sync-chip.offline i { background: var(--muted); }
.sync-chip.auth i { background: var(--bad); }
.sync-chip.spinning svg { animation: spin 1s linear infinite; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--ink);
}

/* ---------- view + transitions ---------- */
.view { padding: 4px 16px calc(110px + var(--safe-b)); min-height: 70vh; }
.view.enter { animation: viewIn .38s var(--ease) backwards; }
.view.enter-back { animation: viewInBack .38s var(--ease) backwards; }
@keyframes viewIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes viewInBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(n+8) { animation-delay: .30s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.pop { animation: pop .35s var(--spring); }
.view.soft .stagger > *, .view.soft .qr-card, .view.soft .tile.filled > img, .view.soft .steps i.on::after { animation: none; }
.shake { animation: shake .4s; }

/* ---------- generic ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h3 { margin: 0; font: 700 18px/1 "Barlow Condensed", sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.section-title a, .section-title button { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 700; font-size: 16px;
  background: var(--ink); color: #fff; text-decoration: none; transition: transform .15s var(--ease), opacity .2s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(34, 31, 32, .22);
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .35; box-shadow: none; pointer-events: none; }
.btn.block { width: 100%; }
.btn.light { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn.ok { background: var(--ok); box-shadow: 0 6px 18px rgba(31, 157, 85, .3); }
.btn.wa { background: #25D366; color: #0B3D1F; box-shadow: 0 6px 18px rgba(37, 211, 102, .3); }
.btn.small { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.grey { background: var(--bg-2); color: var(--ink-2); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 16px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; font-size: 15px; transition: all .2s var(--ease); display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--ink); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(34, 31, 32, .25); }
.chip:active { transform: scale(.94); }

.field { display: block; margin: 14px 0; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 4px 6px; text-transform: uppercase; letter-spacing: .04em; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 16px; border: 2px solid transparent;
  background: var(--card); box-shadow: var(--shadow); outline: none; font-size: 17px; transition: border-color .2s;
}
textarea.input { height: 84px; padding: 14px 16px; resize: none; }
.input:focus { border-color: var(--ink); }
.input.err { border-color: var(--bad); }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); }
.input-wrap .input { padding-left: 52px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); z-index: 30;
  width: calc(100% - 24px); max-width: 536px; height: 68px; border-radius: 24px;
  background: rgba(34, 31, 32, .96); color: #fff; box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  backdrop-filter: blur(10px);
}
.tabbar a { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; text-decoration: none; opacity: .55; transition: opacity .2s; position: relative; }
.tabbar a.on { opacity: 1; }
.tabbar a.on::after { content: ""; position: absolute; bottom: -9px; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.tabbar .fab {
  justify-self: center; width: 60px; height: 60px; margin-top: -30px; border-radius: 20px; opacity: 1;
  background: #fff; color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 5px var(--bg);
  transition: transform .2s var(--spring);
}
.tabbar .fab:active { transform: scale(.9) rotate(-8deg); }
.tabbar .badge { position: absolute; top: -4px; right: calc(50% - 20px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-b)); text-align: center; overflow: hidden; position: relative;
}
.login .logo { width: 104px; height: 104px; border-radius: 30px; background: #fff; box-shadow: var(--shadow-lg); animation: logoIn .9s var(--spring) both; }
@keyframes logoIn { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.login h1 { font-size: 44px; margin: 22px 0 0; letter-spacing: .08em; animation: rise .6s .2s var(--ease) both; }
.login .tag { font-style: italic; color: var(--ink-2); margin: 4px 0 26px; animation: rise .6s .3s var(--ease) both; }
.login .bottles { display: flex; justify-content: center; gap: 4px; margin: 4px 0 28px; height: 160px; }
.login .bottles img { height: 160px; width: auto; border-radius: 16px; animation: bottleIn .8s var(--spring) both; mix-blend-mode: multiply; }
.login .bottles img:nth-child(1) { animation-delay: .35s; transform-origin: bottom; }
.login .bottles img:nth-child(2) { animation-delay: .43s; }
.login .bottles img:nth-child(3) { animation-delay: .51s; }
.login .bottles img:nth-child(4) { animation-delay: .59s; }
.login .bottles img:nth-child(5) { animation-delay: .67s; }
@keyframes bottleIn { from { transform: translateY(60px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.login .gbtn { min-height: 48px; display: flex; justify-content: center; animation: rise .6s .8s var(--ease) both; }
.login .note { font-size: 13px; color: var(--muted); max-width: 300px; margin: 18px auto 0; animation: rise .6s .9s var(--ease) both; }
.login .err { background: var(--bad-bg); color: var(--bad); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 14px; margin: 16px 0 0; max-width: 340px; }
.demo-banner { background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 12px; border-radius: 12px; margin: 0 0 10px; }

/* ---------- home ---------- */
.hello { margin: 6px 2px 14px; }
.hello small { color: var(--muted); font-weight: 600; }
.hello h2 { margin: 2px 0 0; font-size: 32px; line-height: 1.05; }
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #4A3B2F 0%, var(--ink) 55%);
  box-shadow: var(--shadow-lg);
}
.hero .label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.hero .big { font-size: 46px; font-weight: 800; line-height: 1; margin: 6px 0 4px; }
.hero .sub { opacity: .8; font-size: 14px; }
.hero .btn { margin-top: 16px; background: #fff; color: var(--ink); height: 44px; }
.hero .ring { position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, .06); }
.hero .ring.two { right: 40px; top: 90px; width: 90px; height: 90px; border-width: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 800 28px/1.1 "Barlow Condensed", sans-serif; margin-top: 4px; }
.stat .d { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.quick button {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 8px 12px;
  display: grid; justify-items: center; gap: 8px; font-weight: 700; font-size: 14px; transition: transform .15s;
}
.quick button:active { transform: scale(.94); }
.quick .ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; }

/* ---------- outlet rows ---------- */
.list { display: grid; gap: 10px; }
.orow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: transform .15s; text-decoration: none; }
.orow:active { transform: scale(.98); }
.oav {
  width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center;
  color: #fff; font: 800 18px/1 "Barlow Condensed", sans-serif; overflow: hidden;
}
.oav img { width: 100%; height: 100%; object-fit: cover; }
.orow .name { font-weight: 700; }
.orow .meta { font-size: 13px; color: var(--muted); }
.orow .amt { text-align: right; }
.orow .amt b { display: block; font: 700 18px/1.1 "Barlow Condensed", sans-serif; }
.search { position: relative; margin: 6px 0 10px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); opacity: .45; }
.search .input { padding-left: 46px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .ic { font-size: 40px; margin-bottom: 8px; }

/* ---------- outlet detail ---------- */
.ohead { text-align: center; padding: 20px 16px; }
.ohead .oav { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 10px; font-size: 30px; }
.ohead h2 { margin: 0; font-size: 30px; line-height: 1.05; }
.ohead .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.ohead .acts { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.balance { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; overflow: hidden; padding: 0; }
.balance > div { padding: 14px 16px; }
.balance > div + div { border-left: 1px solid var(--line); }
.balance .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.balance .v { font: 800 30px/1.1 "Barlow Condensed", sans-serif; }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin: 8px 0 2px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.timeline { display: grid; gap: 10px; }
.tl { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }
.tl .dot { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.tl .dot.d { background: var(--bg-2); }
.tl .dot.p { background: var(--ok-bg); color: var(--ok); }
.tl .t { font-weight: 700; }
.tl .s { font-size: 13px; color: var(--muted); }
.tl .r { text-align: right; }
.tl .r b { display: block; font: 700 18px/1.1 "Barlow Condensed", sans-serif; }
.mini-bottles { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mini-bottles span { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; color: #fff; }

/* ---------- steps ---------- */
.steps { display: flex; gap: 6px; margin: 2px 0 14px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.steps i.on::after { content: ""; position: absolute; inset: 0; background: var(--ink); animation: grow .5s var(--ease) both; }
.outlet-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; }
.outlet-chip .oav { width: 36px; height: 36px; border-radius: 12px; font-size: 15px; }

/* ---------- margin ---------- */
.margin-box { padding: 14px 14px 10px; }
.margin-box .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.margin-box .top b { font: 700 16px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.margin-box .chip { height: 36px; padding: 0 13px; font-size: 14px; box-shadow: none; background: var(--bg); }
.margin-box .chip.on { background: var(--ink); }
.custom-margin { display: flex; align-items: center; gap: 8px; margin-top: 8px; animation: rise .3s var(--ease) both; }
.custom-margin .input { height: 44px; width: 110px; text-align: center; font-weight: 700; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ---------- product cards (cart) ---------- */
.products { display: grid; gap: 12px; margin-top: 12px; }
.pcard {
  position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 0; overflow: hidden; padding: 0;
  transition: box-shadow .25s, transform .25s var(--spring);
}
.pcard.has { box-shadow: 0 0 0 2.5px var(--c), var(--shadow); }
.pcard .pimg { position: relative; height: 150px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 45%, #fff)); overflow: hidden; }
.pcard .pimg img { position: absolute; left: 50%; top: 8px; height: 150%; width: auto; transform: translateX(-50%); transition: transform .4s var(--spring); }
.pcard.has .pimg img { transform: translateX(-50%) translateY(-6px) rotate(-3deg) scale(1.03); }
.pcard .pbody { padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.pcard .pname { font: 800 22px/1 "Barlow Condensed", sans-serif; color: var(--c); text-transform: uppercase; }
.pcard .psub { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.pcard .price { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.pcard .price s { color: var(--muted); }
.pcard .price b { color: var(--ink); }
.pcard .pfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard .line { font: 700 17px/1 "Barlow Condensed", sans-serif; }
.add-btn {
  height: 44px; padding: 0 20px; border-radius: 14px; background: var(--c); color: #fff; font-weight: 800; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 6px; transition: transform .15s;
}
.add-btn:active { transform: scale(.92); }
.stepper {
  display: flex; align-items: center; height: 44px; border-radius: 14px; background: var(--c); color: #fff; overflow: hidden;
  animation: stepIn .3s var(--spring) both;
}
@keyframes stepIn { from { transform: scale(.7); opacity: 0; } }
.stepper button { width: 42px; height: 44px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 700; }
.stepper button:active { background: rgba(0, 0, 0, .15); }
.stepper input {
  width: 52px; height: 34px; border: 0; border-radius: 10px; text-align: center; font: 800 20px/1 "Barlow Condensed", sans-serif;
  background: rgba(255, 255, 255, .95); color: var(--ink); outline: none; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-add { display: flex; gap: 6px; margin-top: 8px; }
.quick-add button { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 800; background: var(--bg); color: var(--ink-2); }
.quick-add button:active { transform: scale(.9); }
.flyer { position: fixed; z-index: 60; pointer-events: none; height: 90px; width: auto; transition: transform .7s cubic-bezier(.5, -0.3, .7, .4), opacity .7s; }

/* ---------- cart bar ---------- */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(0); bottom: calc(12px + var(--safe-b)); z-index: 30;
  width: calc(100% - 24px); max-width: 536px; border-radius: 22px; background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; box-shadow: var(--shadow-lg);
  transition: transform .4s var(--spring);
}
.cartbar.hide { transform: translateX(-50%) translateY(140%); }
.cartbar .bag { position: relative; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; flex: none; }
.cartbar .bag em { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: var(--ink); font: 800 13px/22px Barlow, sans-serif; font-style: normal; text-align: center; padding: 0 5px; }
.cartbar .sum { flex: 1; min-width: 0; }
.cartbar .sum small { display: block; opacity: .65; font-size: 12px; }
.cartbar .sum b { font: 800 24px/1 "Barlow Condensed", sans-serif; }
.cartbar .btn { background: #fff; color: var(--ink); height: 48px; box-shadow: none; }
.bump { animation: pop .4s var(--spring); }

.summary { margin-top: 16px; }
.summary .ln { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15px; }
.summary .ln.total { border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 12px; font-weight: 700; }
.summary .ln.total b { font: 800 26px/1 "Barlow Condensed", sans-serif; }
.summary .ln .neg { color: var(--ok); font-weight: 700; }
.due-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: 14px; font-size: 14px; }
.due-line input { border: 0; background: transparent; font-weight: 700; text-align: right; outline: none; }

/* ---------- capture tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 22px; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; text-align: center; overflow: hidden; border: 2px dashed var(--line); transition: transform .2s;
}
.tile.wide { grid-column: span 2; aspect-ratio: 2.1; }
.tile-wrap > .tile { width: 100%; }
.tile:active { transform: scale(.96); }
.tile .ph { display: grid; justify-items: center; gap: 6px; padding: 10px; }
.tile .ph .ic { width: 52px; height: 52px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; }
.tile .ph b { font-size: 15px; }
.tile .ph small { font-size: 12px; color: var(--muted); }
.tile .req { position: absolute; top: 10px; right: 10px; }
.tile.filled { border: 0; }
.tile.filled > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: reveal .5s var(--ease) both; }
.tile.filled.sig > img { object-fit: contain; background: #fff; padding: 10px; }
@keyframes reveal { from { transform: scale(1.15); opacity: 0; } }
.tile .retake { position: absolute; bottom: 10px; left: 10px; right: 10px; height: 34px; border-radius: 12px; background: rgba(34, 31, 32, .75); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; backdrop-filter: blur(6px); }
.tile .done-badge { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: pop .4s var(--spring); }

.loc-card { padding: 0; overflow: hidden; }
.loc-card iframe { display: block; width: 100%; height: 170px; border: 0; pointer-events: none; }
.loc-card .info { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14px; }
.locating { height: 170px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 12px, var(--bg-2) 12px, var(--bg-2) 24px); }
.pin { width: 44px; height: 44px; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.suggest button { padding: 8px 12px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-weight: 700; font-size: 14px; animation: rise .3s var(--ease) both; }
.scanning { position: relative; overflow: hidden; }
.scanning::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(transparent, rgba(255, 255, 255, .7), transparent); animation: scan 1.2s linear infinite; }
@keyframes scan { to { top: 100%; } }

/* ---------- payment ---------- */
.payable { text-align: center; padding: 22px 16px; }
.payable small { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.payable .big { font-size: 54px; font-weight: 800; line-height: 1; margin-top: 6px; }
.payable .sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
  text-align: left; border: 2px solid transparent; transition: all .2s var(--ease);
}
.opt.on { border-color: var(--ink); transform: translateY(-1px); }
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; transition: border-color .2s; }
.opt.on .radio { border-color: var(--ink); }
.opt.on .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); animation: pop .3s var(--spring); }
.opt .t { font-weight: 700; }
.opt .s { font-size: 13px; color: var(--muted); }
.opt .amt { margin-left: auto; font: 800 20px/1 "Barlow Condensed", sans-serif; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode {
  padding: 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); display: grid; justify-items: center; gap: 6px;
  font-weight: 800; border: 2px solid transparent; transition: all .2s var(--ease);
}
.mode .ic { font-size: 30px; }
.mode.on { border-color: var(--ink); background: var(--ink); color: #fff; transform: translateY(-2px); }
.qr-card { text-align: center; padding: 18px; animation: rise .4s var(--ease) both; }
.qr-card .qr { width: 220px; height: 220px; margin: 6px auto 10px; border-radius: 16px; padding: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; }
.qr-card .qr svg, .qr-card .qr img { width: 100%; height: 100%; }
.qr-card .vpa { font-weight: 800; font-size: 18px; }
.qr-card .chips { justify-content: center; margin-top: 8px; }
.qr-card .chip { height: 32px; font-size: 13px; padding: 0 12px; box-shadow: none; background: var(--bg); }
.qr-card .chip.on { background: var(--ink); }

/* ---------- done ---------- */
.done { text-align: center; padding: 40px 8px 16px; }
.check { width: 110px; height: 110px; margin: 0 auto; }
.check circle { stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw .7s var(--ease) forwards; }
.check path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .45s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font-size: 36px; margin: 18px 0 4px; animation: rise .5s .6s var(--ease) both; }
.done p { color: var(--muted); margin: 0; animation: rise .5s .7s var(--ease) both; }
.receipt { text-align: left; margin-top: 22px; animation: rise .5s .8s var(--ease) both; }
.done-acts { display: grid; gap: 10px; margin-top: 18px; animation: rise .5s .9s var(--ease) both; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* ---------- dues ---------- */
.aging { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; height: 130px; margin: 8px 0 6px; }
.aging .col { display: grid; gap: 6px; justify-items: center; align-self: end; }
.aging .col i { width: 100%; max-width: 54px; border-radius: 12px 12px 6px 6px; display: block; transform-origin: bottom; animation: growY .8s var(--ease) both; }
@keyframes growY { from { transform: scaleY(0); } }
.aging .col b { font: 700 14px/1 "Barlow Condensed", sans-serif; }
.aging-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; }

/* ---------- sheet / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(34, 31, 32, .45); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 71; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); animation: sheetUp .4s var(--spring) both;
}
@keyframes sheetUp { from { transform: translateX(-50%) translateY(100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; font: 800 24px/1 "Barlow Condensed", sans-serif; }
.sig-pad { width: 100%; height: 260px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); touch-action: none; display: block; }
.sig-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); z-index: 90; opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px);
  box-shadow: var(--shadow-lg); transition: all .3s var(--spring); pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }

.skeleton { height: 70px; border-radius: 18px; background: linear-gradient(90deg, var(--bg-2) 25%, #fff 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
