:root{
  --sun:#FF7A1A;--sun-deep:#EF5F06;--gold:#FFB23E;
  --cream:#FFF8F2;--cream-2:#FFEFE2;--paper:#fff;
  --ink:#2A2016;--ink-2:#6E5C4C;--muted:#9A8b7c;--line:#F2E6D8;
  --clay:#C8692B;--clay-deep:#A9531F;--leaf:#1E9E6A;--leaf-soft:#E6F6EE;--red:#E5544B;
  --fd:'Mitr',sans-serif;--fb:'Prompt',sans-serif;--fn:'Space Grotesk',sans-serif;
  --sh:0 12px 34px -22px rgba(120,70,20,.5);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;overflow-x:hidden}
body{font-family:var(--fb);color:var(--ink);background:var(--cream);line-height:1.55;-webkit-font-smoothing:antialiased;padding-bottom:24px}
::-webkit-scrollbar{display:none}
button{font-family:inherit;cursor:pointer}
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ===== header ===== */
header{position:sticky;top:0;z-index:40;background:rgba(255,248,242,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.hd{display:flex;align-items:center;gap:10px;padding:11px 12px}
.ib{width:38px;height:38px;border:none;background:transparent;display:grid;place-items:center;color:var(--ink);flex:none}
.ib:focus-visible{outline:2px solid var(--sun);border-radius:10px}
.htitle{font-family:var(--fd);font-weight:600;font-size:17px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ===== summary bar ===== */
.sum{margin:14px 16px 2px;background:linear-gradient(135deg,#FFF3E7,var(--cream-2));border:1px solid var(--line);border-radius:20px;padding:14px 16px;display:flex;align-items:center;gap:14px;box-shadow:var(--sh)}
.sum .sic{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,var(--sun),var(--sun-deep));color:#fff;display:grid;place-items:center;flex:none;box-shadow:0 8px 20px -10px rgba(239,95,6,.7)}
.sum .sic svg{width:23px;height:23px}
.sum .sl{flex:1;min-width:0}
.sum .sl .k{font-size:12px;color:var(--ink-2)}
.sum .sl .v{font-family:var(--fd);font-weight:600;font-size:15px;color:var(--ink);margin-top:1px}
.sum .st{text-align:right;flex:none}
.sum .st .k{font-size:11px;color:var(--muted)}
.sum .st .v{font-family:var(--fn);font-weight:700;font-size:19px;color:var(--sun-deep);line-height:1.1}

/* ===== filter tabs ===== */
.tabs{display:flex;gap:8px;overflow-x:auto;padding:14px 16px 4px;scroll-behavior:smooth}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:none;display:inline-flex;align-items:center;gap:6px;border:1.5px solid var(--line);background:#fff;color:var(--ink-2);font-family:var(--fd);font-weight:500;font-size:13px;padding:8px 14px;border-radius:20px;white-space:nowrap}
.tab .tb{font-family:var(--fn);font-weight:600;font-size:11px;color:var(--ink-2);background:var(--cream-2);min-width:18px;height:18px;border-radius:10px;display:inline-grid;place-items:center;padding:0 5px}
.tab.on{border-color:var(--sun);background:linear-gradient(160deg,#FFF3E7,var(--cream-2));color:var(--sun-deep)}
.tab.on .tb{background:var(--sun-deep);color:#fff}
.tab:active{transform:translateY(1px)}

.wrap{padding:8px 16px 16px}
.list{display:flex;flex-direction:column;gap:14px}

/* ===== receipt card (uniform white/radius-20 like shared .card) ===== */
.rc{background:var(--paper);border:1px solid var(--line);border-radius:20px;box-shadow:var(--sh);padding:13px 14px;animation:fadeUp .34s ease both}
.rtop{display:flex;align-items:flex-start;gap:12px}
.ic{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;flex:none}
.ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ic.po{background:var(--cream-2);color:var(--sun-deep)}
.ic.im{background:#F7E9DC;color:var(--clay-deep)}
.ic.dl{background:#EAF1FF;color:#3B6FD8}
.ic.hp{background:var(--leaf-soft);color:var(--leaf)}
.ic.ex{background:#FFF1D9;color:#E9A417}
.ic.ct{background:#FBEAF6;color:#B83A86}
.rmain{flex:1;min-width:0}
.rno{font-family:var(--fn);font-weight:700;font-size:15px;color:var(--ink);letter-spacing:.2px}
.rtype{font-family:var(--fd);font-weight:500;font-size:12.5px;color:var(--ink-2);margin-top:2px}
.ramt{text-align:right;flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.ramt .a{font-family:var(--fn);font-weight:700;font-size:17px;color:var(--ink);line-height:1}
.chip{display:inline-flex;align-items:center;gap:4px;font-family:var(--fn);font-weight:600;font-size:11px;padding:4px 9px;border-radius:20px;white-space:nowrap;background:var(--leaf-soft);color:var(--leaf)}
.chip svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
/* status chip variants (additive · real bill.status → colour) */
.chip.done{background:var(--leaf-soft);color:var(--leaf)}
.chip.pay{background:var(--cream-2);color:var(--sun-deep)}
.chip.transit{background:#EAF1FF;color:#3B6FD8}

/* meta row */
.rmeta{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:12px;padding-top:11px;border-top:1px dashed var(--line);font-family:var(--fn);font-size:11.5px;color:var(--muted)}
.rmeta span{display:inline-flex;align-items:center;gap:5px}
.rmeta svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.rmeta .ref{color:var(--clay-deep);font-weight:600}
.rmeta .dt b{font-family:var(--fb);color:var(--ink-2);font-weight:500}

/* actions */
.ract{display:flex;gap:9px;margin-top:12px}
.btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:11px;font-family:var(--fd);font-weight:500;font-size:13px;padding:9px 10px;border:1px solid var(--line);background:#fff;color:var(--ink)}
.btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn.view{background:linear-gradient(135deg,var(--sun),var(--sun-deep));border-color:transparent;color:#fff;box-shadow:0 8px 18px -10px rgba(239,95,6,.7)}
.btn:active{transform:translateY(1px)}

/* empty state */
.empty{text-align:center;padding:50px 20px;animation:fadeUp .3s ease both}
.empty .ec{width:84px;height:84px;margin:0 auto 16px;border-radius:26px;background:linear-gradient(160deg,#FFF3E7,var(--cream-2));display:grid;place-items:center;color:var(--sun)}
.empty .ec svg{width:40px;height:40px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.empty h3{font-family:var(--fd);font-weight:600;font-size:16px;margin:0 0 6px;color:var(--ink)}
.empty p{font-size:13px;color:var(--muted);margin:0 auto;max-width:250px}

/* data-state helpers (loading / error) — used by receipts.js */
.state{padding:34px 18px;text-align:center;color:var(--muted);font-family:var(--fb);font-size:13.5px}
.state.err{color:var(--red)}
.state .rebtn{display:inline-flex;align-items:center;gap:6px;margin-top:12px;height:36px;padding:0 18px;border-radius:20px;border:1px solid var(--line);background:#fff;color:var(--ink-2);font-family:var(--fd);font-weight:500;font-size:13px}
.state .rebtn:active{transform:translateY(1px)}

.foot{font-size:11.5px;color:var(--muted);text-align:center;line-height:1.6;margin:18px 22px 0}

/* toast */
#toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(20px);background:#2A2016;color:#fff;font-size:13.5px;padding:11px 18px;border-radius:12px;opacity:0;pointer-events:none;transition:.28s;z-index:9995;display:flex;align-items:center;gap:8px;font-family:var(--fd);font-weight:500;max-width:88vw}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
#toast svg{color:var(--gold);flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}

/* empty-state illustration */
.empty-img{width:120px;height:120px;object-fit:contain;margin:0 auto 14px;display:block}
