/* KaCheng: liquid glass - indigo river + gold (style.css v39, iOS-style glass).
   The public pay page keeps the light checkout: see the body[data-page="pay"] block. */
:root {
  --navy: #151287;          /* brand indigo (kept: QR ink, paybar) */
  --navy2: #221FA0;
  --gold: #FDAE15;
  --gold-ink: #1a1840;      /* text on gold buttons */
  --page: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.16) 0%, transparent 55%),
          radial-gradient(140% 90% at -20% 15%, rgba(64,84,206,.55) 0%, transparent 60%),
          linear-gradient(180deg, #3d47a0 0%, #232c6e 45%, #131c5e 75%, #0d167e 100%);
  --card: rgba(13, 20, 62, 0.55);        /* frosted glass cards */
  --card-soft: rgba(28, 39, 106, 0.45);  /* raised glass (inputs, panels) */
  --ink: #ffffff;
  --accent: #ffffff;        /* headings, key numbers */
  --muted: #a7b0e0;
  --line: rgba(255,255,255,.12);
  --chipbg: rgba(255,255,255,.10);
  --softbg: rgba(255,255,255,.055);      /* fee lines, slips */
  --ok: #34d399;
  --okbg: rgba(52,211,153,.14);
  --err: #f87171;
  --errbg: rgba(248,113,113,.14);
  --wait: #fbbf24;
  --waitbg: rgba(251,191,36,.14);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* nothing overrides the hidden attribute */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: var(--page);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100dvh;
}
.shell { max-width: 560px; margin: 0 auto; padding: 0 14px calc(104px + env(safe-area-inset-bottom)); }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 2px 10px; position: sticky; top: 0; z-index: 5;
  background: rgba(13, 22, 126, 0.35);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mark { width: 38px; height: 38px; display: block; }
.word-img { height: 17px; width: auto; display: block; }
.lockup { width: 210px; max-width: 80%; height: auto; display: block; margin: 2px auto 0; }
.logout { font-size: 12px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); padding: 5px 9px; border-radius: 999px; }

/* flash */
.flash { padding: 11px 14px; border-radius: 12px; font-size: 14px; margin: 4px 0 12px; }
.flash-ok  { background: var(--okbg); color: var(--ok); border: 1px solid rgba(52,211,153,.35); }
.flash-err { background: var(--errbg); color: var(--err); border: 1px solid rgba(248,113,113,.35); }

/* cards */
.card {
  background: var(--card); border: 1px solid rgba(255,255,255,.14); border-radius: 22px;
  padding: 18px 16px; margin-bottom: 14px;
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 10px 34px rgba(2, 6, 47, 0.42), inset 0 1px 0 rgba(255,255,255,.10);
}
.card h2 { font-size: 16px; color: var(--accent); margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13.5px; }
.muted.small, small { font-size: 12px; }
.center { text-align: center; }

/* balance */
.balance-card {
  background:
    radial-gradient(90% 120% at 85% -20%, rgba(253,174,21,.20) 0%, transparent 55%),
    linear-gradient(135deg, rgba(5,12,60,.72) 0%, rgba(16,26,110,.55) 100%);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff; border-radius: 24px; padding: 20px 18px; margin-bottom: 14px;
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 14px 40px rgba(2, 6, 47, 0.55), inset 0 1px 0 rgba(255,255,255,.14);
}
.bal-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.eye {
  background: none; border: none; cursor: pointer; color: #fff; opacity: .8;
  display: inline-flex; align-items: center; padding: 2px;
}
.eye svg { width: 19px; height: 19px; }
.bal-amount.masked span { letter-spacing: .12em; }
.bal-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; opacity: 0.85; }
.bal-amount { font-size: 40px; font-weight: 800; margin: 10px 0 14px; letter-spacing: -0.02em; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick .btn { flex: 1; min-width: 82px; }
.bal-note { margin-top: 12px; font-size: 12.5px; opacity: 0.75; }
.chip {
  display: inline-block; font-size: 10.5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 200, 0, 0.16); color: var(--yellow); border: 1px solid rgba(255, 200, 0, 0.4);
}
.chipline { margin: 8px 0; }
.whohead { font-size: 13px; font-weight: 700; margin: 14px 0 2px; }
.send-panel { display: none; }
.send-panel.show { display: block; }

/* buttons + forms */
.btn {
  display: inline-block; text-align: center; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--card-soft); color: var(--ink);
  font-weight: 700; font-size: 14px; padding: 11px 14px; border-radius: 12px;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink);
  box-shadow: 0 6px 20px rgba(253, 174, 21, 0.38), inset 0 1px 0 rgba(255,255,255,.45); }
.btn.primary:hover { background: #fecb40; border-color: #fecb40; }
.btn.ghost { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.25); color: #fff; }
.btn.block { display: block; width: 100%; }
.btn.tiny { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy); margin: 12px 0 4px; }
input, select {
  width: 100%; padding: 11px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 13px; background: var(--card-soft); color: var(--ink); margin-top: 4px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
input:focus, select:focus { outline: 2px solid rgba(253, 174, 21, 0.35); border-color: var(--gold); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--accent); margin: 12px 0 4px; }
input::placeholder { color: rgba(167,176,224,.6); }
.moneyform button { margin-top: 14px; }
.walletline { font-size: 13px; color: var(--muted); margin: 8px 0 2px; }
.feeline {
  margin-top: 12px; font-size: 13px; color: var(--ink);
  background: var(--softbg); border: 1px dashed var(--line); border-radius: 10px; padding: 9px 11px;
}
fieldset { border: none; margin-top: 8px; }
legend { font-size: 12.5px; font-weight: 600; color: var(--accent); padding-bottom: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin: 7px 0; }
.check input { width: auto; margin: 0; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; }
.inline-form label { flex: 1; margin: 10px 0 0; }
.inline-form button { white-space: nowrap; margin-top: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.kpi small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.kpi b { font-size: 19px; color: var(--accent); letter-spacing: -0.01em; }

/* key-value lists */
.kv { list-style: none; margin: 10px 0; }
.kv li { display: flex; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv li span { color: var(--muted); }
.kv li b { font-weight: 700; }
.kv li b.hl, .kv li.total b { color: var(--accent); }
.kv li.total { border-bottom: none; border-top: 2px solid var(--gold); margin-top: 2px; padding-top: 10px; }
.kv.wide li b { font-variant-numeric: tabular-nums; }

/* transactions list */
.txlist { list-style: none; }
.txlist li { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.txlist li:last-child { border-bottom: none; }
.tx-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 15px; background: var(--chipbg); color: var(--gold);
}
.tx-ico.cash_in, .tx-ico.topup { background: var(--okbg); color: var(--ok); }
.tx-ico.cash_out, .tx-ico.bank_send { background: var(--errbg); color: var(--err); }
.tx-main { flex: 1; min-width: 0; }
.tx-main b { display: block; font-size: 13.5px; }
.tx-main small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-date { opacity: 0.75; }
.tx-amt { text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.tx-amt small { display: block; color: var(--muted); font-weight: 500; }
.tx-amt.pos { color: var(--ok); }
.tx-amt.neg { color: var(--ink); }

/* pots */
.potlist { list-style: none; }
.potlist li { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.potlist li:last-child { border-bottom: none; }
.potlist a { text-decoration: none; flex: 1; min-width: 0; }
.pot-name { display: block; font-weight: 700; color: var(--accent); font-size: 14px; }
.pot-sub { display: block; color: var(--muted); font-size: 12px; }
.pot-amt { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.memberlist { list-style: none; margin: 10px 0 14px; }
.memberlist li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.memberlist li.done { color: var(--ok); }
.memberlist li .tick { width: 22px; text-align: center; font-weight: 800; }
.m-share { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.memberlist li.done .m-share { color: var(--ok); }

/* gazata bill code */
.billcode-card { text-align: center; background: var(--softbg); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 10px; margin: 12px 0; }
.billcode-card small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.billcode { font-size: 34px; font-weight: 800; letter-spacing: .18em; color: var(--gold); font-variant-numeric: tabular-nums; margin: 4px 0; }

/* slip */
.slip { border: 2px dashed var(--gold); }
.slip-code {
  font-size: 30px; font-weight: 800; letter-spacing: 0.06em; text-align: center;
  color: var(--gold); background: var(--softbg); border-radius: 12px; padding: 18px 8px; margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
.code-input { text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; }

/* tables */
.tablewrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td small { display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status.completed, .status.settled, .status.paid_out { background: var(--okbg); color: var(--ok); }
.status.pending { background: var(--waitbg); color: var(--wait); }
.status.cancelled { background: var(--errbg); color: var(--err); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
a.chip { text-decoration: none; color: var(--muted); background: var(--card); cursor: pointer; }
.chip.ok { background: var(--okbg); color: var(--ok); border-color: rgba(52,211,153,.4); }

/* fee book */
.feetable td { white-space: normal; }
.feeform { display: inline; }
.feeedit { display: flex; align-items: center; gap: 6px; }
.feeedit input { width: 84px; padding: 7px 8px; font-size: 13.5px; margin-top: 0; }
.feeedit .unit { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.example b { color: var(--gold); }

/* beneficiaries */
.benelist { list-style: none; }
.benelist li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.benelist li:last-child { border-bottom: none; }
.benelist li.wait { background: var(--softbg); border-radius: 10px; padding: 9px 8px; margin-top: 6px; border-bottom: none; }
.bene-ico { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 13px; background: var(--okbg); color: var(--ok); }
.bene-ico.on { background: var(--okbg); color: var(--ok); }
.benelist li.wait .bene-ico { background: var(--waitbg); color: var(--wait); }
.bene-main { flex: 1; min-width: 0; }
.bene-main b { display: block; font-size: 14px; color: var(--accent); }
.bene-main small { display: block; color: var(--muted); }
.bene-del { display: inline; }
.lookup-line { font-size: 13.5px; }

/* QR + invite modals */
.qrbox { display: flex; justify-content: center; }
.qrbox canvas { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* invite modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(11, 8, 124, 0.55); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-card { background: rgba(16, 26, 110, 0.88); border: 1px solid rgba(255,255,255,.16); border-radius: 22px; padding: 20px 18px; width: 100%; max-width: 400px; display: grid; gap: 9px; -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); box-shadow: 0 18px 50px rgba(2, 6, 47, 0.6), inset 0 1px 0 rgba(255,255,255,.12); }
.modal-card h3 { font-size: 16px; color: var(--accent); }
.invlink { font-size: 11.5px; word-break: break-all; background: var(--softbg); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.check.off { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); background: var(--softbg); border-radius: 10px; padding: 7px 10px; margin: 6px 0; }

/* login */
.login-wrap { min-height: 82dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding-top: 30px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 30px 24px; width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { font-size: 21px; color: var(--accent); margin: 14px 0 2px; }
.login-card form { text-align: left; margin-top: 10px; }
.login-card button { margin-top: 16px; }
.login-foot { max-width: 340px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* bottom nav */
.bottomnav {
  position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 10; width: min(92vw, 430px);
  background: rgba(13, 22, 126, 0.55); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  display: flex; justify-content: center; gap: 4px;
  padding: 7px 10px;
  box-shadow: 0 14px 38px rgba(2, 6, 47, 0.55), inset 0 1px 0 rgba(255,255,255,.12);
}
.bn-item {
  flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 3px 2px;
  border-radius: 10px;
}
.bn-item svg { width: 21px; height: 21px; }
.bn-item.on { color: var(--gold); background: rgba(253,174,21,.12); }
@media (min-width: 620px) {
  .bottomnav { width: 430px; }
}

/* ============ v7: public pay page (hosted checkout) ============ */
body[data-page="pay"] .shell { padding: 0 14px calc(128px + env(safe-area-inset-bottom)); }
.paypage { max-width: 460px; margin: 0 auto; }

.pp-head { text-align: center; padding: 6px 0 14px; }
.pp-head .brand { justify-content: center; margin: 0 auto 14px; display: flex; }
.pp-paying { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pp-invoice {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--chipbg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.pp-invoice svg { width: 12px; height: 12px; }
.pp-amount { font-size: 44px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; margin: 10px 0 2px; }
.pp-to { font-size: 14px; color: var(--muted); }
.pp-to b { color: var(--ink); }

.pp-who { display: flex; align-items: center; gap: 12px; }
.pp-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
}
.pp-id { flex: 1; min-width: 0; }
.pp-id b { display: block; font-size: 15px; color: var(--ink); }
.pp-id small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pp-verified { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 11.5px; font-weight: 700; }
.pp-verified svg { width: 15px; height: 15px; }

.pp-services h3, .pp-choose { font-size: 13px; color: var(--navy); text-transform: uppercase; letter-spacing: .4px; margin: 4px 0 8px; }
.pp-choose { margin: 18px 0 10px; }
.svc { list-style: none; }
.svc li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.svc li:last-child { border-bottom: none; }
.svc-ico { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--chipbg); color: var(--gold); }
.svc-ico svg { width: 15px; height: 15px; }
.svc-label { flex: 1; min-width: 0; }
.svc-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.svc li.svc-total { border-top: 2px solid var(--navy); border-bottom: none; margin-top: 2px; padding-top: 12px; }
.svc-total .svc-label { font-weight: 800; color: var(--navy); }
.svc-total .svc-amt { font-weight: 800; color: var(--navy); font-size: 16px; }

.paymethod {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  cursor: pointer; border: 1px solid rgba(255,255,255,.14); background: var(--card); color: var(--ink);
  border-radius: 18px; padding: 14px; margin-bottom: 10px; font: inherit;
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 10px 34px rgba(2, 6, 47, 0.42), inset 0 1px 0 rgba(255,255,255,.10);
}
.paymethod > svg { width: 24px; height: 24px; flex: none; color: var(--navy); }
.paymethod.wallet { background: #fecb40; border-color: #e9b62e; }
.paymethod.wallet > svg { color: #14213d; }
.pm-main { flex: 1; min-width: 0; }
.pm-main b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pm-main small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.paymethod.wallet .pm-main small { color: #6b5a10; }
.pm-chevron { flex: none; transition: transform .15s ease; }
.pm-chevron svg { width: 20px; height: 20px; display: block; color: var(--muted); }
.paymethod.open .pm-chevron { transform: rotate(180deg); }
.paymethod.off { opacity: 0.55; cursor: default; }
.paymethod.off .chip { background: #fdf3d7; color: #8a6d00; border-color: #ecd98a; }

.paypanel { background: var(--card-soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.paypanel .btn { margin-top: 12px; }

.pp-scan { display: flex; align-items: center; gap: 14px; }
.scanqr { flex: none; }
.scanqr canvas { width: 148px; height: 148px; border: 1px solid var(--line); border-radius: 12px; display: block; background: #fff; }
.scan-txt b { display: block; font-size: 13px; letter-spacing: .08em; color: var(--navy); }
.scan-txt > small { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.scan-txt p { font-size: 12.5px; color: var(--ink); margin-bottom: 8px; }
.scan-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--gold); background: var(--chipbg); border-radius: 999px; padding: 5px 10px; }
.scan-phone svg { width: 14px; height: 14px; }

.pp-state { display: flex; gap: 12px; align-items: flex-start; }
.pp-state svg { width: 34px; height: 34px; flex: none; color: var(--muted); }
.pp-state b { display: block; font-size: 15px; }
.pp-state small { display: block; color: var(--muted); margin-top: 3px; }
.pp-state.done svg { color: var(--ok); }
.pp-state .btn { margin-top: 12px; }

.pp-foot { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 22px 0 6px; color: var(--muted); }
.pp-foot svg { width: 20px; height: 20px; flex: none; }
.pp-foot b { display: block; font-size: 12.5px; }
.pp-foot small { display: block; font-size: 11.5px; }
.pp-disclaimer { text-align: center; color: var(--muted); font-size: 11px; max-width: 340px; margin: 0 auto; }

.paybar {
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 10; width: min(92vw, 430px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(21,18,135,.10); border-radius: 24px;
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  padding: 10px 16px;
  box-shadow: 0 14px 38px rgba(21, 18, 135, 0.18), inset 0 1px 0 rgba(255,255,255,.9);
}
.paybar-total small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.paybar-total b { font-size: 22px; color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.paybar-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--navy); color: #fff; border: none; border-radius: 16px;
  font: inherit; font-weight: 800; font-size: 16px; padding: 15px 26px;
}
.paybar-btn:active { background: var(--navy2); }
.paybar-btn svg { width: 19px; height: 19px; }

/* invoice line repeater (Send screen) */
.invitems { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px 12px; margin-top: 14px; background: var(--softbg); }
.invitems legend { color: var(--muted); font-weight: 700; }
.itemrow { display: grid; grid-template-columns: 1fr 104px auto; gap: 8px; align-items: center; margin: 8px 0; }
.itemrow input { margin-top: 0; }
.itemrow .btn { padding: 9px 10px; }
[data-itemadd] { margin-top: 4px; }


/* ============ v8: Spend tab (airtime chips + billers) ============ */
.chiprow { display: flex; gap: 8px; margin: 10px 0 2px; }
.chip.amt {
  flex: 1; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
  background: var(--card-soft); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 4px; text-align: center;
}
.chip.amt.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.billerlist { list-style: none; }
.billerlist li { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.billerlist li:last-child { border-bottom: none; }
.biller-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--chipbg); color: var(--gold);
}
.biller-ico svg { width: 17px; height: 17px; }

/* ============ v9: light mode (dark stays the default) ============ */
body[data-theme="light"] {
  --page: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.14) 0%, transparent 55%),
          radial-gradient(140% 90% at -20% 10%, rgba(21,18,135,.07) 0%, transparent 60%),
          #f7f4ec;
  --card: rgba(255, 255, 255, 0.74);
  --card-soft: rgba(255, 255, 255, 0.92);
  --ink: #14213d;
  --accent: #151287;
  --muted: #6b7a90;
  --line: #e5e0d2;
  --chipbg: rgba(238, 242, 247, 0.8);
  --softbg: rgba(250, 247, 239, 0.8);
  --ok: #1a7f4b; --okbg: #e3f4ea;
  --err: #b3261e; --errbg: #fbe9e7;
  --wait: #8a6d00; --waitbg: #fdf3d7;
}
body[data-theme="light"] .topbar {
  background: linear-gradient(rgba(247,244,236,.9) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
body[data-theme="light"] .bottomnav {
  background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(21,18,135,.10);
  box-shadow: 0 14px 38px rgba(21, 18, 135, 0.16), inset 0 1px 0 rgba(255,255,255,.9);
}
body[data-theme="light"] .bn-item.on { color: #151287; background: #eef2f7; }
body[data-theme="light"] .btn { background: rgba(255,255,255,.85); color: #151287; border-color: rgba(21,18,135,.14); }
body[data-theme="light"] .btn.primary { background: #151287; border-color: #151287; color: #fff;
  box-shadow: 0 6px 18px rgba(21, 18, 135, 0.30), inset 0 1px 0 rgba(255,255,255,.18); }
body[data-theme="light"] .btn.primary:hover { background: #221FA0; border-color: #221FA0; }
body[data-theme="light"] .balance-card {
  background:
    radial-gradient(90% 120% at 85% -20%, rgba(253,174,21,.28) 0%, transparent 55%),
    linear-gradient(135deg, #151287 0%, #221FA0 100%);
  border-color: rgba(21, 18, 135, 0.30);
  box-shadow: 0 14px 34px rgba(21, 18, 135, 0.30), inset 0 1px 0 rgba(255,255,255,.16);
}
body[data-theme="light"] .card {
  border-color: rgba(21, 18, 135, 0.10);
  box-shadow: 0 8px 26px rgba(21, 18, 135, 0.10), inset 0 1px 0 rgba(255,255,255,.9);
}
body[data-theme="light"] .paymethod { box-shadow: 0 1px 2px rgba(11, 37, 69, 0.05); }
body[data-theme="light"] .paypanel { background: #f7f8ff; border-color: #dfe3f5; }
body[data-theme="light"] .modal-card { background: rgba(255,255,255,.94); box-shadow: 0 18px 50px rgba(11, 8, 124, 0.25); }
body[data-theme="light"] .tx-ico { color: #151287; }
body[data-theme="light"] .biller-ico,
body[data-theme="light"] .svc-ico { color: #151287; }
body[data-theme="light"] .scan-phone { color: #151287; }
body[data-theme="light"] .billcode,
body[data-theme="light"] .slip-code,
body[data-theme="light"] .pot-amt { color: #151287; }
body[data-theme="light"] .slip { border-color: #151287; }
body[data-theme="light"] .kv li.total { border-top-color: #151287; }
body[data-theme="light"] .chip.on { background: #151287; color: #fff; border-color: #151287; }
body[data-theme="light"] .chip.amt.on { background: #FDAE15; color: #1a1840; border-color: #FDAE15; }
body[data-theme="light"] input:focus,
body[data-theme="light"] select:focus { outline: 2px solid rgba(21, 18, 135, 0.25); border-color: #151287; }

/* theme toggle in the top bar */
.theme-btn {
  flex: none; cursor: pointer; color: var(--ink);
  background: var(--chipbg); border: 1px solid var(--line); border-radius: 999px;
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
}
.theme-btn svg { width: 17px; height: 17px; display: block; }
.topbar .theme-btn { margin-left: auto; }

/* ============ v8: the public pay page keeps its light checkout ============ */
body[data-page="pay"] {
  background: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.16) 0%, transparent 55%),
              radial-gradient(140% 90% at -20% 10%, rgba(21,18,135,.08) 0%, transparent 60%),
              #f7f4ec;
  background-attachment: fixed;
  --card: rgba(255, 255, 255, 0.80);
  --card-soft: rgba(255, 255, 255, 0.94);
  --ink: #14213d;
  --accent: #151287;
  --muted: #6b7a90;
  --line: #e5e0d2;
  --chipbg: #eef2f7;
  --softbg: #faf7ef;
  --ok: #1a7f4b;
  --okbg: #e3f4ea;
  --err: #b3261e;
  --errbg: #fbe9e7;
  --wait: #8a6d00;
  --waitbg: #fdf3d7;
}
body[data-page="pay"] .topbar {
  background: linear-gradient(#f7f4ec 82%, transparent);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body[data-page="pay"] .card {
  border-color: rgba(21, 18, 135, 0.10);
  box-shadow: 0 8px 26px rgba(21, 18, 135, 0.10), inset 0 1px 0 rgba(255,255,255,.9);
}
body[data-page="pay"] .btn { background: #fff; color: #151287; }
body[data-page="pay"] .btn.primary { background: #151287; border-color: #151287; color: #fff; }
body[data-page="pay"] .btn.primary:hover { background: #221FA0; border-color: #221FA0; }
body[data-page="pay"] .paymethod { box-shadow: 0 1px 2px rgba(11, 37, 69, 0.05); }
body[data-page="pay"] .paypanel { background: rgba(247, 248, 255, 0.85); border-color: rgba(21,18,135,.12); }
body[data-page="pay"] .svc-ico { color: #151287; }
body[data-page="pay"] .pp-invoice { color: #151287; }
body[data-page="pay"] .scan-phone { color: #151287; }
body[data-page="pay"] .eye { color: #14213d; }


/* ============ v11: iOS 27 pass - match the mockup picture.
   Darker night-indigo scene, milkier frost, thin large numerals,
   capsule buttons, circular badges, hairline rows, tint-only tab bar. ============ */
:root {
  --page: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.12) 0%, transparent 55%),
          radial-gradient(140% 90% at -20% 15%, rgba(74,90,220,.10) 0%, transparent 55%),
          linear-gradient(180deg, #10143a 0%, #0a0d28 45%, #080b24 78%, #05081c 100%);
  --card: rgba(120, 132, 215, 0.44);
  --card-soft: rgba(140, 152, 230, 0.34);
  --line: rgba(255,255,255,.13);
  --navbg: rgba(14, 19, 62, 0.66);
  --inputbg: rgba(255, 255, 255, 0.09);
}
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif; }
.topbar { background: rgba(10, 14, 50, 0.55); }

/* cards: deeper frost */
.card {
  border-radius: 26px; padding: 20px 17px; border-color: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 16px 44px rgba(2, 4, 30, 0.55), inset 0 1px 0 rgba(255,255,255,.14);
}
.card h2 { font-size: 19px; font-weight: 750; letter-spacing: -0.35px; margin-bottom: 8px; }

/* hero balance: thin large numerals, iOS eyebrow */
.balance-card {
  background:
    radial-gradient(90% 120% at 85% -20%, rgba(253,174,21,.22) 0%, transparent 55%),
    linear-gradient(135deg, rgba(88,102,215,.52) 0%, rgba(120,134,235,.40) 100%);
  border-radius: 30px; padding: 22px 20px;
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 0 18px 50px rgba(2, 4, 30, 0.62), inset 0 1px 0 rgba(255,255,255,.18);
}
.bal-top { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .8px; opacity: .85; }
.bal-label { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; opacity: .6; }
.bal-amount { font-size: 46px; font-weight: 300; letter-spacing: -0.5px; margin: 12px 0 18px; font-variant-numeric: tabular-nums; }

/* capsule buttons */
.btn {
  border-radius: 999px; padding: 13px 24px; font-weight: 650; font-size: 14.5px;
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn.primary { box-shadow: 0 8px 26px rgba(253, 174, 21, 0.45), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.tiny { padding: 7px 14px; border-radius: 999px; }
.quick .btn { padding: 13px 10px; min-width: 0; }

/* glass inputs */
input, select { background: var(--inputbg); border-radius: 14px; padding: 12px 14px; }

/* activity rows: circular badges + hairlines */
.txlist li { padding: 13px 2px; min-height: 54px; border-bottom-color: rgba(255,255,255,.09); }
.tx-ico { width: 40px; height: 40px; border-radius: 999px; font-size: 16px; background: rgba(255,255,255,.10); }
.tx-main b { font-size: 15px; font-weight: 650; }
.tx-amt { font-size: 15px; font-weight: 650; }

/* floating tab bar: glyph-first, tint-only active (iOS style) */
.bottomnav {
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--navbg); border-color: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  padding: 8px 12px;
  box-shadow: 0 18px 44px rgba(2, 4, 30, 0.65), inset 0 1px 0 rgba(255,255,255,.14);
}
.bn-item { gap: 3px; color: rgba(255,255,255,.60); font-size: 10px; font-weight: 650; letter-spacing: .3px; }
.bn-item svg { width: 23px; height: 23px; }
.bn-item.on { color: var(--gold); background: none; }

/* modals + misc glass */
.modal-card { border-radius: 26px; -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.login-card { border-radius: 28px; }
.flash { border-radius: 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.paymethod { border-radius: 20px; }

/* light + pay variants of the new tokens */
body[data-theme="light"] { --navbg: rgba(255, 255, 255, 0.72); --inputbg: rgba(255, 255, 255, 0.92); }
body[data-theme="light"] .bn-item { color: rgba(20, 33, 61, 0.55); }
body[data-theme="light"] .bn-item.on { background: none; }
body[data-page="pay"] { --inputbg: rgba(255, 255, 255, 0.94); }

/* pay page: thin big amount, capsule pay button */
.pp-amount { font-size: 48px; font-weight: 300; letter-spacing: -0.5px; }
.paybar { border-radius: 26px; }
.paybar-btn { border-radius: 999px; padding: 14px 26px; }


/* ============ v12: Liquid Glass UI Kit pass - glowing borders.
   Dark: indigo-violet luminous rims + halos; hero and primary glow gold.
   Light + pay page: warm cream scene, gold luminous rims + halos. ============ */
.card { position: relative; border-color: rgba(128, 141, 255, 0.20);
  box-shadow: 0 0 30px rgba(90, 105, 255, 0.16), 0 16px 44px rgba(2, 4, 30, 0.55), inset 0 1px 0 rgba(255,255,255,.14); }
.balance-card { position: relative; border-color: rgba(253, 190, 64, 0.28);
  box-shadow: 0 0 38px rgba(253, 174, 21, 0.20), 0 18px 50px rgba(2, 4, 30, 0.62), inset 0 1px 0 rgba(255,255,255,.18); }
.login-card, .modal-card { position: relative; border-color: rgba(128, 141, 255, 0.24);
  box-shadow: 0 0 30px rgba(90, 105, 255, 0.18), 0 18px 50px rgba(2, 4, 30, 0.60), inset 0 1px 0 rgba(255,255,255,.12); }
.bottomnav { border-color: rgba(128, 141, 255, 0.20);
  box-shadow: 0 0 32px rgba(90, 105, 255, 0.20), 0 18px 44px rgba(2, 4, 30, 0.65), inset 0 1px 0 rgba(255,255,255,.14); }
.btn { border-color: rgba(128, 141, 255, 0.28); box-shadow: 0 0 16px rgba(90, 105, 255, 0.10); }
.btn.primary { border-color: rgba(255, 205, 90, 0.65);
  box-shadow: 0 0 26px rgba(253, 174, 21, 0.42), 0 8px 26px rgba(253, 174, 21, 0.30), inset 0 1px 0 rgba(255,255,255,.5); }

/* the luminous rim itself: a masked 1.5px gradient ring hugging each glass edge */
.card::after, .balance-card::after, .login-card::after, .modal-card::after,
.bottomnav::after, .paybar::after, .paymethod::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(135deg, rgba(140, 152, 255, 0.85) 0%, rgba(96, 112, 255, 0.14) 45%, rgba(140, 152, 255, 0.45) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.balance-card::after {
  background: linear-gradient(135deg, rgba(255, 216, 110, 0.95) 0%, rgba(253, 174, 21, 0.18) 45%, rgba(255, 205, 90, 0.55) 100%);
}

/* light mode + pay page: gold glowing borders on a warmer cream scene */
body[data-theme="light"] {
  --page: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.16) 0%, transparent 55%),
          radial-gradient(140% 90% at -20% 10%, rgba(21,18,135,.06) 0%, transparent 60%),
          #f5eedd;
}
body[data-theme="light"] .topbar { background: linear-gradient(rgba(245,238,221,.92) 82%, transparent); }
body[data-theme="light"] .card,
body[data-page="pay"] .card { border-color: rgba(226, 181, 74, 0.32);
  box-shadow: 0 0 26px rgba(240, 192, 80, 0.26), 0 8px 26px rgba(21, 18, 135, 0.10), inset 0 1px 0 rgba(255,255,255,.95); }
body[data-theme="light"] .card::after, body[data-page="pay"] .card::after,
body[data-theme="light"] .login-card::after, body[data-page="pay"] .login-card::after,
body[data-theme="light"] .modal-card::after {
  background: linear-gradient(135deg, rgba(246, 203, 128, 0.90) 0%, rgba(240, 192, 80, 0.16) 45%, rgba(246, 203, 128, 0.50) 100%);
}
body[data-theme="light"] .balance-card,
body[data-page="pay"] .balance-card { border-color: rgba(226, 181, 74, 0.45);
  box-shadow: 0 0 36px rgba(240, 192, 80, 0.34), 0 14px 34px rgba(21, 18, 135, 0.30), inset 0 1px 0 rgba(255,255,255,.16); }
body[data-theme="light"] .balance-card::after {
  background: linear-gradient(135deg, rgba(250, 213, 130, 0.95) 0%, rgba(240, 192, 80, 0.20) 45%, rgba(250, 213, 130, 0.55) 100%);
}
body[data-theme="light"] .bottomnav { border-color: rgba(226, 181, 74, 0.32);
  box-shadow: 0 0 28px rgba(240, 192, 80, 0.28), 0 14px 38px rgba(21, 18, 135, 0.16), inset 0 1px 0 rgba(255,255,255,.9); }
body[data-theme="light"] .bottomnav::after {
  background: linear-gradient(135deg, rgba(246, 203, 128, 0.85) 0%, rgba(240, 192, 80, 0.14) 45%, rgba(246, 203, 128, 0.45) 100%);
}
body[data-page="pay"] {
  background: radial-gradient(120% 70% at 85% -10%, rgba(253,174,21,.18) 0%, transparent 55%),
              radial-gradient(140% 90% at -20% 10%, rgba(21,18,135,.07) 0%, transparent 60%),
              #f5eedd;
  background-attachment: fixed;
}
body[data-page="pay"] .topbar { background: linear-gradient(#f5eedd 82%, transparent); }
body[data-page="pay"] .paybar { border-color: rgba(226, 181, 74, 0.35);
  box-shadow: 0 0 30px rgba(240, 192, 80, 0.30), 0 14px 38px rgba(21, 18, 135, 0.18), inset 0 1px 0 rgba(255,255,255,.9); }
body[data-page="pay"] .paybar::after {
  background: linear-gradient(135deg, rgba(246, 203, 128, 0.90) 0%, rgba(240, 192, 80, 0.16) 45%, rgba(246, 203, 128, 0.50) 100%);
}
body[data-page="pay"] .paymethod { position: relative;
  box-shadow: 0 0 22px rgba(240, 192, 80, 0.18), 0 10px 34px rgba(21, 18, 135, 0.08), inset 0 1px 0 rgba(255,255,255,.9); }
body[data-page="pay"] .paymethod::after {
  background: linear-gradient(135deg, rgba(246, 203, 128, 0.80) 0%, rgba(240, 192, 80, 0.12) 45%, rgba(246, 203, 128, 0.42) 100%);
}

/* ============ v13: night logo. The navy wordmark sinks into the night glass,
   so dark mode shows white logo variants; light mode and the always-light
   public pay page keep the navy + gold originals. ============ */
.logo-d { display: none; }
body[data-theme="dark"] .logo-d { display: block; }
body[data-theme="dark"] .logo-l { display: none; }
body[data-page="pay"] .logo-d { display: none; }
body[data-page="pay"] .logo-l { display: block; }

/* ============ v14: profile pictures + required ID/passport (FICA-lite) ============ */
.avatar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-lg {
  width: 76px; height: 76px; border-radius: 999px; object-fit: cover; flex: none;
  border: 2px solid rgba(255,255,255,.30);
  box-shadow: 0 0 22px rgba(90, 105, 255, 0.28);
}
.avatar-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar-pick { position: relative; cursor: pointer; }
.idline { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.idline b { letter-spacing: .06em; font-variant-numeric: tabular-nums; }
details.id-change { margin-top: 10px; }
details.id-change summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
details.send-slip { margin-top: 10px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; background: var(--softbg); }
details.send-slip summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
details.send-slip[open] summary { margin-bottom: 4px; }
.pp-avatar { overflow: hidden; }
.pp-avatar img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; display: block; }
body[data-theme="light"] .avatar-lg,
body[data-page="pay"] .avatar-lg {
  box-shadow: 0 0 22px rgba(240, 192, 80, 0.35);
  border-color: rgba(226, 181, 74, .40);
}

/* ============ v15: notifications bell + profile picture on the balance card ============ */
.bell {
  position: relative; flex: none; cursor: pointer; color: var(--ink);
  background: var(--chipbg); border: 1px solid var(--line); border-radius: 999px;
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
}
.bell svg { width: 17px; height: 17px; display: block; }
.bell.open { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.bell-badge {
  position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1;
}
.bellwrap { position: relative; }
.notif-pop {
  position: absolute; top: calc(100% + 10px); right: 0; width: 300px; max-height: 62vh; overflow: auto; z-index: 70;
  background: rgba(16, 26, 110, 0.88); border: 1px solid rgba(255,255,255,.16); border-radius: 18px;
  -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: 0 18px 50px rgba(2, 6, 47, 0.6), inset 0 1px 0 rgba(255,255,255,.12); padding: 6px;
}
.notif-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 8px 10px 6px; }
.notif-empty { margin: 0; padding: 6px 10px 14px; color: var(--muted); font-size: 12.5px; }
.notif-item { display: flex; gap: 9px; padding: 9px 10px; border-radius: 12px; }
.notif-item + .notif-item { border-top: 1px solid rgba(255,255,255,.08); }
.notif-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--gold); flex: none; margin-top: 5px; opacity: 0; }
.notif-item.unread .notif-dot { opacity: 1; }
.notif-main b { display: block; font-size: 13px; }
.notif-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.notif-main .notif-when { font-size: 11px; opacity: .75; }
.notif-item.unread b { color: var(--accent); }
.bal-mid { display: flex; align-items: center; gap: 14px; }
.bal-info { flex: 1; min-width: 0; }
.bal-avatar {
  flex: none; width: 64px; height: 64px; border-radius: 999px; overflow: hidden;
  display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  border: 2px solid rgba(255,255,255,.30);
}
.bal-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
body[data-theme="light"] .notif-pop { background: rgba(255,255,255,.94); box-shadow: 0 18px 50px rgba(11, 8, 124, 0.25); }
body[data-theme="light"] .notif-item + .notif-item { border-top-color: rgba(21, 18, 135, .08); }
body[data-theme="light"] .notif-item.unread b { color: var(--navy); }
body[data-theme="light"] .bal-avatar { border-color: rgba(21, 18, 135, .18); }
body[data-page="pay"] .bal-avatar { border-color: rgba(226, 181, 74, .40); }

/* ============ v16: gazata dropdown picker ============ */
.gz-add { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.gz-add select { flex: 1; }
.gz-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--softbg); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; margin: 6px 0; font-size: 13.5px; font-weight: 700;
}
.gz-row span { flex: 1; min-width: 0; }

/* ============ v17: admin toggle switch ============ */
.togglerow { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toggle-label b { display: block; font-size: 14px; }
.toggle-label small { display: block; margin-top: 2px; }
.switch {
  flex: none; position: relative; cursor: pointer; width: 52px; height: 31px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--chipbg);
  padding: 0; transition: background .18s ease, border-color .18s ease;
}
.switch i {
  position: absolute; top: 2px; left: 3px; width: 25px; height: 25px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 6px rgba(2, 6, 47, .45); transition: left .18s ease;
}
.switch.on { background: var(--gold); border-color: var(--gold); }
.switch.on i { left: 22px; }
body[data-theme="light"] .switch { background: #e4e0f0; }
body[data-theme="light"] .switch i { box-shadow: 0 2px 6px rgba(11, 8, 124, .3); }
body[data-theme="light"] .switch.on { background: #151287; border-color: #151287; }

/* ============ v18: beneficiary search + filter ============ */
.bene-tools { display: flex; gap: 8px; margin: 10px 0 8px; }
.bene-tools input { flex: 1; min-width: 0; }
.bene-tools select { flex: none; width: auto; }
ul.benelist { max-height: 348px; overflow: auto; }

/* ============ v19: receipt / proof of payment ============ */
.backlink { display: inline-block; font-size: 12.5px; color: var(--muted); text-decoration: none; margin: 2px 0 8px; }
.receipt-paper {
  background: #fffdf6; color: #1c1c2e; border: 1px dashed #b9b39a; border-radius: 14px;
  padding: 18px 16px; margin-bottom: 14px;
  box-shadow: 0 14px 34px rgba(2, 6, 47, 0.35);
}
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; }
.receipt-logo { font-weight: 800; font-size: 17px; color: #151287; }
.receipt-ref { font-size: 11.5px; color: #6a6a80; font-weight: 700; letter-spacing: .5px; }
.receipt-type { margin-top: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: #6a6a80; }
.receipt-amount { font-size: 38px; font-weight: 800; margin: 2px 0 2px; letter-spacing: -0.02em; }
.receipt-amount.neg { color: #1c1c2e; }
.receipt-amount.pos { color: #0e7a4f; }
.receipt-fee { font-size: 12.5px; color: #6a6a80; margin-bottom: 10px; }
.receipt-kv { list-style: none; border-top: 1px dashed #b9b39a; padding-top: 10px; }
.receipt-kv li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.receipt-kv span { color: #6a6a80; }
.receipt-qr { display: block; width: 132px; height: 132px; margin: 14px auto 4px; }
.receipt-foot { margin-top: 8px; font-size: 10.5px; color: #8a8a9a; text-align: center; }

/* ============ v20: public landing page ============ */
.land-hero { display: flex; flex-direction: column; gap: 18px; padding: 26px 20px 22px; }
.land-hero h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; margin: 4px 0 10px; }
.land-sub { font-size: 15px; color: var(--muted); max-width: 34ch; }
.land-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.land-hero-card { max-width: 360px; }
.land-mock { margin: 0; }
.land-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.feat { padding: 14px 13px; }
.feat svg { width: 22px; height: 22px; color: var(--gold); }
.feat b { display: block; margin: 8px 0 4px; font-size: 14px; }
.feat p { margin: 0; font-size: 12.5px; color: var(--muted); }
.land-how { margin-top: 14px; }
.land-steps { list-style: none; display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0 6px; }
.land-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 4px 0 18px; }
@media (max-width: 560px) {
  .land-grid { grid-template-columns: 1fr; }
  .land-steps { grid-template-columns: 1fr; }
}
body[data-theme="light"] .land-hero h1 { color: var(--navy); }

/* ============ v21: desktop and tablet layout ============ */
.topnav { display: none; }
@media (min-width: 880px) {
  .shell { max-width: 1080px; padding: 0 24px 44px; }
  .topbar { gap: 10px; }
  .topnav { display: flex; align-items: center; gap: 2px; margin-left: 16px; }
  .bottomnav { display: none; }
  body[data-page="pay"] .shell { padding-bottom: 44px; }
  .tn-item {
    text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700;
    padding: 7px 12px; border-radius: 999px;
  }
  .tn-item:hover { color: var(--ink); background: var(--chipbg); }
  .tn-item.on { color: var(--gold-ink); background: var(--gold); }
  body[data-theme="light"] .tn-item.on { background: #151287; color: #fff; }
  body:not([data-page="pay"]):not([data-page="receipt"]):not([data-page="login"]):not([data-page="signup"]):not([data-page="landing"]):not([data-page="history"]):not([data-page="chat"]) .content {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start;
  }
  .content > .kpis, .content > section.card:has(.tablewrap) { grid-column: 1 / -1; }
  .paypage { max-width: 520px; }
  body[data-page="receipt"] .content { max-width: 560px; margin: 0 auto; }
  /* landing page on desktop */
  .land-hero { flex-direction: row; align-items: center; gap: 26px; padding: 34px 26px; }
  .land-hero-main { flex: 1; }
  .land-hero h1 { font-size: 44px; }
  .land-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* ============ v22: a fuller Home ============ */
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 4px 11px;
  background: var(--softbg); border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 700;
}
.qa svg { width: 22px; height: 22px; color: var(--gold); }
.qa:hover { border-color: var(--gold); }
.slipwait { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-color: rgba(253, 190, 64, 0.35); }
.slipwait b { display: block; font-size: 14px; }
.slipwait small { display: block; margin-top: 2px; }
.pp-row { display: flex; gap: 14px; flex-wrap: wrap; }
.pp-person { display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; color: var(--ink); font-size: 11.5px; font-weight: 600; }
.pp-ava {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  border: 1.5px solid rgba(255,255,255,.30);
}
.pp-person:hover .pp-ava { border-color: var(--gold); }
.land-all { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted); text-decoration: none; font-weight: 700; }
.land-all:hover { color: var(--gold); }
body[data-theme="light"] .qa:hover { border-color: #151287; }
body[data-theme="light"] .pp-person:hover .pp-ava { border-color: #151287; }
@media (min-width: 880px) {
  .qa-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ============ v23: how it works, as a journey ============ */
.land-steps li {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  background: var(--softbg); border: 1px solid var(--line); border-radius: 16px; padding: 15px 15px 13px;
}
.ls-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
  background: rgba(253,174,21,.13); border: 1px solid rgba(253,174,21,.35);
}
.ls-ico svg { width: 22px; height: 22px; color: var(--gold); }
.ls-step { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .9px; color: var(--gold); }
.land-steps b { font-size: 15px; }
.land-steps small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.land-steps li:not(:last-child)::after {
  content: ''; position: absolute; left: 36px; top: 62px; bottom: -13px;
  border-left: 2px dashed rgba(253,174,21,.4);
}
@media (min-width: 880px) {
  .land-steps { grid-template-columns: repeat(3, 1fr); gap: 26px; }
  .land-steps li:not(:last-child)::after {
    left: auto; right: -22px; top: 34px; bottom: auto; width: 18px; height: 0;
    border-left: none; border-top: 2px dashed rgba(253,174,21,.4);
  }
  .land-steps li:hover { border-color: rgba(253,174,21,.45); }
}
body[data-theme="light"] .ls-ico { background: rgba(21,18,135,.08); border-color: rgba(21,18,135,.25); }
body[data-theme="light"] .ls-ico svg { color: #151287; }
body[data-theme="light"] .ls-step { color: #151287; }
body[data-theme="light"] .land-steps li:not(:last-child)::after { border-color: rgba(21,18,135,.3); }

/* ============ v24: shop applications in the console ============ */
.shop-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shop-row:last-child { border-bottom: none; }
.shop-main { flex: 1; min-width: 200px; }
.shop-main b { display: block; font-size: 14px; }
.shop-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.shop-act { display: flex; gap: 6px; align-items: center; }
.shop-rej input { width: 130px; }
ul.shop-on { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
ul.shop-on li b { font-size: 13px; }
ul.shop-on li small { display: block; color: var(--muted); font-size: 11.5px; }

/* ============ v25: profile switching + signup choice ============ */
.switchpill { flex: none; }
.switchpill button {
  cursor: pointer; color: var(--ink); background: var(--chipbg); border: 1px solid var(--line);
  border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
}
.switchpill svg { width: 17px; height: 17px; display: block; color: var(--gold); }
.switchpill button:hover { border-color: var(--gold); }
.switchbar { margin: 2px 0 12px; }

/* ============ v29: networks, electricity, chat ============ */
.chip.net { flex: 1; padding: 10px 6px; font-size: 14px; }
.chip.net.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.navbadge { position: relative; top: -6px; margin-left: 6px; display: inline-block; }

/* chat list */
.chatlist { list-style: none; margin: 0; padding: 0; }
.chatlist li + li { border-top: 1px solid var(--line); }
.chatrow { display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-decoration: none; color: var(--ink); }
.chatrow .chatmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chatrow .chatmain small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow.unread .chatmain b { color: var(--ink); }
.chatrow .chatside { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chatbadge { position: static; }
.chatava { width: 42px; height: 42px; border-radius: 50%; flex: none; object-fit: cover; background: var(--chipbg); }
.chatempty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 18px 2px; }

/* one thread */
.chatpage { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chathead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chathead .chatmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chatback { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); }
.chatback svg { width: 20px; height: 20px; }
.chatlog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 52vh; min-height: 220px; background: var(--softbg); }
.chatday { text-align: center; margin: 0; font-size: 12px; }
.chatline { display: flex; }
.chatline.mine { justify-content: flex-end; }
.chatbubble { max-width: 78%; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--card); border: 1px solid var(--line); font-size: 15px; word-wrap: break-word; }
.chatline.mine .chatbubble { border-radius: 16px 16px 4px 16px; background: var(--navy2); color: #ffffff; border-color: var(--navy2); }
body[data-theme="light"] .chatline.mine .chatbubble { background: #151287; color: #ffffff; }
.chatline.pay .chatbubble { border-radius: 14px; background: rgba(253, 174, 21, .16); border: 1px dashed var(--gold); color: var(--ink); }
.chatline.pay.mine .chatbubble { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); border-style: solid; }
.chatpay { display: flex; flex-direction: column; gap: 4px; }
.chatreceipt { font-size: 12.5px; color: var(--gold); font-weight: 600; }
.chatline.pay.mine .chatreceipt { color: var(--gold-ink); text-decoration: underline; }

/* quick send + text bar */
.chatquick { border-top: 1px solid var(--line); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.chatquick .chiprow { margin: 0; }
.chatown { display: flex; gap: 8px; }
.chatown input { flex: 1; }
.chatconfirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 12px; background: rgba(253, 174, 21, .12); margin: 0; }
.chatsend { display: flex; gap: 8px; margin: 0; }
.chatsend input { flex: 1; }
.chatsend button { flex: none; width: 46px; padding: 0; display: grid; place-items: center; }
.chatsend svg { width: 18px; height: 18px; }
[data-wallet-line] { font-size: 12px; }

/* token flash on the spend page */
.tokenflash { font-variant-numeric: tabular-nums; letter-spacing: 1px; font-weight: 700; }

/* ============ v30: chat upgrades - requests, voice, reactions, ticks ============ */
.chatmodes { display: flex; gap: 8px; }
.chip.mode { flex: 1; }
.chip.mode.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.chatnew { align-self: center; text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
           color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 3px 12px; }
.chatline { position: relative; }
.chatmeta { display: inline-flex; align-items: center; gap: 3px; margin: 0 6px; align-self: flex-end; }
.chattime { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ticks svg { width: 15px; height: 15px; display: block; color: var(--muted); }
.ticks.on svg { color: var(--gold); }

/* money requests: loud, impossible to mistake for a payment */
.chatbubble.chatreq { border: 2px dashed #f59e0b; background: rgba(245, 158, 11, .13); border-radius: 14px; min-width: 148px; }
.reqtag { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
          color: #b45309; background: rgba(245, 158, 11, .25); border-radius: 4px; padding: 1px 6px; align-self: flex-start; }
.reqamt { font-size: 20px; letter-spacing: .5px; }
.chatbubble.chatreq small { color: var(--muted); }
.reqactions { display: flex; gap: 8px; margin-top: 6px; }
.reqchip { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.reqchip.paid { color: var(--gold-ink); background: var(--gold); }
.reqchip.declined { color: var(--muted); background: var(--softbg); }
.reqchip.waiting { color: var(--wait); background: var(--waitbg); }
.reqpayconfirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
                 border: 1px solid var(--gold); border-radius: 12px; background: rgba(253, 174, 21, .12);
                 margin: 4px 0 10px; align-self: flex-end; }

/* voice notes */
.chatvoice { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.vplay { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
         background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; padding: 0; flex: none; }
.vplay svg { width: 16px; height: 16px; }
.vplay.playing { background: var(--ink); color: var(--gold); }
.vbar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; display: block; }
.vbar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s linear; }
.vdur { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* recording bar */
.chatrecord { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; flex: none; animation: recpulse 1.1s infinite; }
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.rectime { font-weight: 700; font-variant-numeric: tabular-nums; }
.chatmic { width: 46px; flex: none; border: 1px solid var(--line); background: var(--chipbg); color: var(--ink);
           border-radius: 12px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.chatmic svg { width: 19px; height: 19px; }

/* reactions */
.chatreacts { display: flex; gap: 5px; margin: -4px 4px 6px; }
.chatreacts.mine { justify-content: flex-end; }
.reactchip { border: 1px solid var(--line); background: var(--chipbg); border-radius: 999px; cursor: pointer;
             font-size: 13px; padding: 2px 8px; line-height: 1.4; }
.reactchip.mine { border-color: var(--gold); background: rgba(253, 174, 21, .18); }
.reactpicker { position: absolute; z-index: 60; display: flex; gap: 2px; padding: 5px 6px; border-radius: 999px;
               background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
               -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.reactpicker button { border: none; background: none; font-size: 19px; cursor: pointer; padding: 3px 4px; border-radius: 8px; }
.reactpicker button:hover { background: var(--chipbg); }
.reactpicker .rm { font-size: 13px; color: var(--muted); }
[data-reactable] { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* group chat bits */
.groupava { display: grid; place-items: center; background: rgba(253, 174, 21, .18); color: var(--gold); }
.groupava svg { width: 22px; height: 22px; }
.grouptag { font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
            color: var(--gold-ink); background: var(--gold); border-radius: 4px; padding: 1px 5px; vertical-align: 2px; }
.chatlog .chatday { font-size: 12px; }

/* ============ v31: the chat thread, WhatsApp-style ============ */
.shell.chatfull { max-width: 680px; padding: 0; }
.chatwa {
  --wa-bg: #efeae2; --wa-head: #f0f2f5; --wa-bub-c: #ffffff; --wa-mine-c: #d9fdd3;
  --wa-ink: #111b21; --wa-sub: #667781; --wa-tick: #667781; --wa-read: #53bdeb;
  --wa-dock: #f0f2f5; --wa-input: #ffffff; --wa-accent: #008069; --wa-fab: #54656f;
  --wa-sysbg: #ffffff; --wa-sysink: #54656f; --wa-line: rgba(11, 20, 26, .1);
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--wa-head); color: var(--wa-ink);
  border-left: 1px solid var(--wa-line); border-right: 1px solid var(--wa-line);
  margin: 0 auto;
}
body[data-theme="dark"] .chatwa {
  --wa-bg: #0b141a; --wa-head: #202c33; --wa-bub-c: #202c33; --wa-mine-c: #005c4b;
  --wa-ink: #e9edef; --wa-sub: #8696a0; --wa-tick: #8696a0; --wa-read: #53bdeb;
  --wa-dock: #202c33; --wa-input: #2a3942; --wa-accent: #00a884; --wa-fab: #aebac1;
  --wa-sysbg: #182229; --wa-sysink: #8696a0; --wa-line: rgba(255, 255, 255, .08);
}

/* header */
.wa-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
           background: var(--wa-head); border-bottom: 1px solid var(--wa-line); flex: none; }
.wa-back { width: 34px; height: 34px; display: grid; place-items: center; color: var(--wa-ink); text-decoration: none; }
.wa-back svg { width: 21px; height: 21px; }
.wa-ava { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: var(--wa-input); }
.wa-ava.groupava { display: grid; place-items: center; color: var(--wa-fab); }
.wa-ava.groupava svg { width: 21px; height: 21px; }
.wa-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wa-id b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-id small { color: var(--wa-sub); font-size: 12px; }
.wa-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--wa-fab); text-decoration: none; border-radius: 50%; }
.wa-icon:hover { background: rgba(11, 20, 26, .06); }
.wa-icon svg { width: 20px; height: 20px; }

/* the wallpaper + the log */
.chatwa .chatlog {
  flex: 1; min-height: 0; max-height: none; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px; padding: 12px 10px 14px;
  background-color: var(--wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.05' stroke-width='2'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M92 18l9 15H83z'/%3E%3Crect x='140' y='24' width='16' height='16' rx='4'/%3E%3Ccircle cx='24' cy='112' r='6'/%3E%3Cpath d='M78 100h24M90 88v24'/%3E%3Ccircle cx='150' cy='118' r='9'/%3E%3Cpath d='M36 158q12-16 24 0'/%3E%3Crect x='100' y='148' width='15' height='15' rx='7.5'/%3E%3Cpath d='M160 170l6 10h-12z'/%3E%3Cpath d='M8 178h16'/%3E%3C/g%3E%3C/svg%3E");
}
body[data-theme="dark"] .chatwa .chatlog {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.045' stroke-width='2'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M92 18l9 15H83z'/%3E%3Crect x='140' y='24' width='16' height='16' rx='4'/%3E%3Ccircle cx='24' cy='112' r='6'/%3E%3Cpath d='M78 100h24M90 88v24'/%3E%3Ccircle cx='150' cy='118' r='9'/%3E%3Cpath d='M36 158q12-16 24 0'/%3E%3Crect x='100' y='148' width='15' height='15' rx='7.5'/%3E%3Cpath d='M160 170l6 10h-12z'/%3E%3Cpath d='M8 178h16'/%3E%3C/g%3E%3C/svg%3E");
}
.chatwa .chatlog::-webkit-scrollbar { width: 6px; }
.chatwa .chatlog::-webkit-scrollbar-thumb { background: rgba(134, 150, 160, .4); border-radius: 3px; }
.wa-day, .wa-sys, .chatnew { align-self: center; text-align: center; font-size: 11.5px; font-weight: 600;
  color: var(--wa-sysink); background: var(--wa-sysbg); border-radius: 8px; padding: 5px 12px;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13); margin: 6px 0; }
.wa-sys { font-weight: 500; }
.chatwa .chatnew { color: #fff; background: var(--wa-accent); font-weight: 700; letter-spacing: .3px; }

/* bubbles with tails */
.chatwa .wa-line { display: flex; margin: 1px 0; }
.chatwa .wa-line.mine { justify-content: flex-end; }
.wa-bub { position: relative; max-width: 82%; background: var(--wa-bub-c); color: var(--wa-ink);
  border-radius: 8px; padding: 6px 9px 7px 10px; font-size: 15px; line-height: 1.38;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .16); min-height: 34px; }
.wa-line:not(.mine) .wa-bub::before { content: ''; position: absolute; top: 0; left: -7px;
  border: 4px solid transparent; border-top-color: var(--wa-bub-c); border-right-color: var(--wa-bub-c); }
.wa-line.mine .wa-bub { background: var(--wa-mine-c); }
.wa-line.mine .wa-bub::before { content: ''; position: absolute; top: 0; right: -7px; left: auto;
  border: 4px solid transparent; border-top-color: var(--wa-mine-c); border-left-color: var(--wa-mine-c); }
.wa-name { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 1px; }
.wa-text a { color: var(--wa-accent); }

/* time + ticks float inside the bubble, WhatsApp-style */
.wa-meta { float: right; margin: 8px -3px -5px 9px; display: inline-flex; align-items: center; gap: 3px; }
.wa-time { font-size: 11px; color: var(--wa-sub); white-space: nowrap; }
body[data-theme="dark"] .wa-time { color: #ffffff87; }
.wa-line.mine .wa-time { color: rgba(17, 27, 33, .55); }
body[data-theme="dark"] .wa-line.mine .wa-time { color: rgba(233, 237, 239, .6); }
.chatwa .ticks svg { width: 16px; height: 16px; display: block; color: var(--wa-tick); }
.chatwa .ticks.on svg { color: var(--wa-read); }
.wa-line.mine .ticks svg { color: rgba(17, 27, 33, .55); }
.wa-line.mine .ticks.on svg { color: var(--wa-read); }

/* money bubbles */
.chatwa .chatreceipt { font-size: 12.5px; font-weight: 700; color: var(--wa-accent); text-decoration: none; display: inline-block; margin-top: 2px; }
.reqwrap { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.reqwrap small { color: var(--wa-sub); font-size: 12.5px; }
.reqtag { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
          color: #b45309; background: rgba(245, 158, 11, .3); border-radius: 4px; padding: 1px 6px; align-self: flex-start; }
.reqamt { font-size: 20px; letter-spacing: .5px; }
.wa-bub.k-request { border: 2px dashed #e3a008; background: rgba(245, 158, 11, .12); }
.wa-line.mine .wa-bub.k-request { background: rgba(245, 158, 11, .2); }
.wa-bub.k-request::before, .wa-line.mine .wa-bub.k-request::before { border-top-color: #e3a008; }
.reqactions { display: flex; gap: 8px; margin-top: 6px; }
.wa-btn { border: none; cursor: pointer; background: var(--wa-accent); color: #fff; font-weight: 700;
          font-size: 13px; border-radius: 999px; padding: 7px 14px; font-family: inherit; }
.wa-btn.ghost { background: transparent; color: var(--wa-sub); border: 1px solid var(--wa-line); }
.reqchip { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.reqchip.paid { color: #fff; background: var(--wa-accent); }
.reqchip.declined { color: var(--wa-sub); background: rgba(134, 150, 160, .18); }
.reqchip.waiting { color: #9a6700; background: rgba(245, 158, 11, .22); }
.reqpayconfirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px;
                 background: rgba(255, 255, 255, .55); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
body[data-theme="dark"] .reqpayconfirm { background: rgba(11, 20, 26, .4); }

/* voice bubbles */
.voicewrap { display: flex; align-items: center; gap: 9px; min-width: 175px; }
.vplay { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; flex: none; padding: 0;
         background: var(--wa-accent); color: #fff; display: grid; place-items: center; }
.vplay svg { width: 16px; height: 16px; }
.vwave { display: flex; align-items: center; gap: 2px; height: 24px; }
.vwave i { display: block; width: 2.5px; border-radius: 2px; background: var(--wa-sub); opacity: .55; }
.vdur { font-size: 11.5px; color: var(--wa-sub); font-variant-numeric: tabular-nums; }

/* reactions pinned to the bubble edge */
.wa-reacts { position: absolute; bottom: -11px; left: 10px; display: flex; gap: 4px; }
.wa-line.mine .wa-reacts { left: auto; right: 10px; }
.chatwa .reactchip { border: 1px solid var(--wa-line); background: var(--wa-sysbg); border-radius: 999px;
                     cursor: pointer; font-size: 12.5px; padding: 1px 7px; line-height: 1.5;
                     box-shadow: 0 1px 1px rgba(11, 20, 26, .18); }
.chatwa .reactchip.mine { border-color: var(--wa-accent); }
.chatwa .wa-line { position: relative; margin-bottom: 7px; }

/* the dock: money sheet + input row + record bar */
.wa-dock { flex: none; background: var(--wa-dock); border-top: 1px solid var(--wa-line);
           padding: 7px 10px calc(9px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.wa-sheet { background: var(--wa-sysbg); border: 1px solid var(--wa-line); border-radius: 14px;
            padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chatwa .chip.mode.on { background: var(--wa-accent); color: #fff; border-color: var(--wa-accent); }
.chatwa .chatown input { flex: 1; background: var(--wa-input); }
.chatwa .chatconfirm { border-color: var(--wa-accent); background: rgba(0, 128, 105, .08); }
.wa-row { display: flex; gap: 8px; align-items: center; }
.wa-fab { width: 42px; height: 42px; flex: none; border: none; background: none; cursor: pointer;
          color: var(--wa-fab); display: grid; place-items: center; border-radius: 50%; transition: transform .18s; }
.wa-fab svg { width: 26px; height: 26px; }
.wa-fab.open { transform: rotate(45deg); }
.chatwa .chatsend { display: flex; gap: 6px; flex: 1; margin: 0; align-items: center; }
.chatwa .chatsend input { flex: 1; background: var(--wa-input); border: 1px solid var(--wa-line);
                          border-radius: 21px; padding: 10px 16px; font-size: 15px; min-width: 0; }
.chatwa .chatsend button { width: 40px; height: 40px; flex: none; border-radius: 50%; border: none; cursor: pointer;
                           background: none; color: var(--wa-fab); display: none; place-items: center; padding: 0; }
.chatwa .chatsend button svg { width: 21px; height: 21px; }
.chatwa .chatsend .chatmic { display: grid; }
.chatwa .chatsend .wa-send { background: var(--wa-accent); color: #fff; }
.wa-row.typing .chatmic { display: none; }
.wa-row.typing .wa-send { display: grid; }
.chatwa .chatrecord { display: flex; align-items: center; gap: 10px; background: var(--wa-input);
                      border-radius: 21px; padding: 9px 14px; }
.chatwa .rectime { font-weight: 700; color: #ef4444; }
.chatwa .reactpicker { background: var(--wa-sysbg); border: 1px solid var(--wa-line); }

/* ============ v32: KaCheng colours + desktop two-pane chat ============ */
/* The thread keeps its WhatsApp bones but wears the brand: cream + indigo */
/* in the day, deep indigo + gold at night. Money bubbles are gold.       */
.chatwa {
  --wa-bg: #f2ead9; --wa-head: #f8f3e7; --wa-dock: #f8f3e7;
  --wa-bub-c: #ffffff; --wa-mine-c: #221FA0;
  --wa-ink: #14213d; --wa-sub: #6a6e8f; --wa-tick: #98a0c9; --wa-read: #FDAE15;
  --wa-input: #ffffff; --wa-accent: #151287; --wa-fab: #14213d;
  --wa-sysbg: #ffffff; --wa-sysink: #5a5e7d; --wa-line: rgba(20, 33, 61, .13);
}
body[data-theme="dark"] .chatwa {
  --wa-bg: #141b55; --wa-head: #181f57; --wa-dock: #181f57;
  --wa-bub-c: #1d2665; --wa-mine-c: #3a45b8;
  --wa-ink: #ffffff; --wa-sub: #a7b0e0; --wa-tick: #a7b0e0; --wa-read: #FDAE15;
  --wa-input: #232b6e; --wa-accent: #FDAE15; --wa-fab: #a7b0e0;
  --wa-sysbg: #1a2154; --wa-sysink: #a7b0e0; --wa-line: rgba(255, 255, 255, .12);
}
/* wallpaper doodles, indigo on cream by day, gold on indigo at night */
.chatwa .chatlog {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cg fill='none' stroke='%23151287' stroke-opacity='.055' stroke-width='2'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M92 18l9 15H83z'/%3E%3Crect x='140' y='24' width='16' height='16' rx='4'/%3E%3Ccircle cx='24' cy='112' r='6'/%3E%3Cpath d='M78 100h24M90 88v24'/%3E%3Ccircle cx='150' cy='118' r='9'/%3E%3Cpath d='M36 158q12-16 24 0'/%3E%3Crect x='100' y='148' width='15' height='15' rx='7.5'/%3E%3Cpath d='M160 170l6 10h-12z'/%3E%3Cpath d='M8 178h16'/%3E%3C/g%3E%3C/svg%3E");
}
body[data-theme="dark"] .chatwa .chatlog {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190'%3E%3Cg fill='none' stroke='%23FDAE15' stroke-opacity='.05' stroke-width='2'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3Cpath d='M92 18l9 15H83z'/%3E%3Crect x='140' y='24' width='16' height='16' rx='4'/%3E%3Ccircle cx='24' cy='112' r='6'/%3E%3Cpath d='M78 100h24M90 88v24'/%3E%3Ccircle cx='150' cy='118' r='9'/%3E%3Cpath d='M36 158q12-16 24 0'/%3E%3Crect x='100' y='148' width='15' height='15' rx='7.5'/%3E%3Cpath d='M160 170l6 10h-12z'/%3E%3Cpath d='M8 178h16'/%3E%3C/g%3E%3C/svg%3E");
}
/* brand buttons + accents */
.chatwa .wa-btn { background: #FDAE15; color: #1a1840; }
.chatwa .wa-btn:hover { background: #f0a300; }
.chatwa .wa-btn.ghost { background: transparent; color: var(--wa-sub); border: 1px solid var(--wa-line); }
.chatwa .chatnew { background: #FDAE15; color: #1a1840; }
.chatwa .vplay { background: #FDAE15; color: #1a1840; }
.chatwa .chip.mode.on { background: #FDAE15; color: #1a1840; border-color: #FDAE15; }
.chatwa .reqchip.paid { background: #FDAE15; color: #1a1840; }
.chatwa .reactchip.mine { border-color: #FDAE15; }
.chatwa .wa-send { background: #FDAE15; color: #1a1840; }
.wa-line.mine .ticks svg { color: rgba(255, 255, 255, .62); }
.wa-line.mine .ticks.on svg { color: #FDAE15; }
/* money bubbles are gold: money always reads as money in KaCheng */
.chatwa .wa-bub.k-payment { background: rgba(253, 174, 21, .30); border: 1.5px solid #e3a008; }
.chatwa .wa-line.mine .wa-bub.k-payment { background: #FDAE15; color: #1a1840; border-color: #e3a008; }
.chatwa .wa-bub.k-payment::before { border-top-color: #ecc24a; border-right-color: #ecc24a; }
.chatwa .wa-line.mine .wa-bub.k-payment::before { border-top-color: #FDAE15; border-left-color: #FDAE15; }
.chatwa .wa-bub.k-payment .chatreceipt { color: #151287; font-weight: 800; }
body[data-theme="dark"] .chatwa .wa-bub.k-payment .chatreceipt { color: #1a1840; }
.chatwa .wa-line.mine .wa-bub.k-payment .chatreceipt { color: #1a1840; text-decoration: underline; }
.chatwa .wa-line.mine .wa-bub.k-payment .wa-time { color: rgba(26, 24, 64, .65); }
.chatwa .wa-line.mine .wa-bub.k-payment .ticks svg { color: rgba(26, 24, 64, .65); }
.chatwa .wa-line.mine .wa-bub.k-payment .ticks.on svg { color: #151287; }
.chatwa .chatconfirm { border-color: #FDAE15; background: rgba(253, 174, 21, .12); }
.chatwa .reqpayconfirm { border: 1px solid #FDAE15; background: rgba(253, 174, 21, .12); }

/* ---------- desktop: the chats list and the thread, side by side ---------- */
.chatdesk { display: block; }
.chatpane { display: none; }
@media (min-width: 900px) {
  .shell.chatfull { max-width: min(96vw, 1380px); padding: 0 10px; }
  body[data-page="chat"] .shell.chatfull .chatdesk {
              display: grid; grid-template-columns: 300px minmax(0, 1fr);
              flex: 1; min-height: 0; margin: 0 auto; }
  .chatpane {
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-right: none;
    border-radius: 16px 0 0 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .chatpane-head { display: flex; align-items: center; justify-content: space-between;
                   padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex: none; }
  .chatpane-head b { font-size: 17px; }
  .chatpane .chatlist { flex: 1; overflow-y: auto; padding: 6px 8px; margin: 0; }
  .chatpane .chatlist li + li { border-top: none; }
  .chatpane .chatrow { border-radius: 12px; padding: 10px 10px; }
  .chatpane .chatrow:hover { background: var(--chipbg); }
  .chatpane .chatrow.on { background: rgba(253, 174, 21, .18); box-shadow: inset 3px 0 0 #FDAE15; }
  .chatpane .chatempty { padding: 22px 14px; }
  .chatwa { margin: 0; border-radius: 0 16px 16px 0; height: 100%; }
  .chatwa .wa-bub { max-width: 78%; }
}

/* ============ v33: softer "mine" bubbles - indigo tint, not solid blocks ============ */
.chatwa { --wa-mine-c: #e4e6f7; }
body[data-theme="dark"] .chatwa { --wa-mine-c: #2e3a9e; }
.chatwa .wa-line.mine .wa-bub { border: 1px solid rgba(21, 18, 135, .10); }
body[data-theme="dark"] .chatwa .wa-line.mine .wa-bub { border-color: rgba(255, 255, 255, .07); }
.chatwa .wa-line.mine .wa-time { color: rgba(20, 33, 61, .55); }
body[data-theme="dark"] .chatwa .wa-line.mine .wa-time { color: rgba(233, 237, 239, .62); }
.chatwa .wa-line.mine .ticks svg { color: #8a92c4; }
.chatwa .wa-line.mine .ticks.on svg { color: #c98f00; }
body[data-theme="dark"] .chatwa .wa-line.mine .ticks svg { color: rgba(233, 237, 239, .62); }
body[data-theme="dark"] .chatwa .wa-line.mine .ticks.on svg { color: #FDAE15; }

/* ---- v35: web push switch + iPhone Home Screen nudge ---- */
.pushrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 2px;
}
.pushrow strong { display: block; }
.pushrow small { display: block; margin-top: 3px; color: var(--ink-soft, #5b628f); }
.pushrow .pushhint { color: var(--ink-soft, #5b628f); }
.kcswitch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: rgba(21, 18, 135, .14);
  position: relative;
  transition: background .18s ease;
  cursor: pointer;
  border: none;
  margin: 0;
}
.kcswitch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(10, 10, 40, .25);
  transition: transform .18s ease;
}
.kcswitch:checked { background: #151287; }
.kcswitch:checked::after { transform: translateX(20px); }
.kcswitch:disabled { opacity: .45; cursor: not-allowed; }
.pushstatus { margin: 10px 0 0; font-size: .9rem; }
.pushstatus[data-state="on"] { color: #0d7a3f; }
.pushstatus[data-state="blocked"] { color: #b3261e; }
.pushstatus[data-state="busy"] { color: var(--ink-soft, #5b628f); }
body[data-theme="dark"] .pushstatus[data-state="on"] { color: #7fd6a2; }
body[data-theme="dark"] .pushrow small,
body[data-theme="dark"] .pushrow .pushhint { color: rgba(233, 237, 239, .68); }

.iosnudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px auto 0;
  max-width: 720px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(253, 174, 21, .16);
  border: 1px solid rgba(253, 174, 21, .45);
  color: inherit;
  font-size: .9rem;
  line-height: 1.35;
}
.iosnudge .nudge-x {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

/* ---- v36: presence + typing ---- */
.dot-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .18);
  vertical-align: middle;
  margin-left: 2px;
}
.chatwa .wa-id small[data-presence] { transition: color .2s ease; }
.chatwa .wa-id small.online { color: #0d7a3f; }
body[data-theme="dark"] .chatwa .wa-id small.online { color: #7fd6a2; }
.chatwa .wa-id small.istyping { color: #0d7a3f; animation: kctyping 1.4s ease-in-out infinite; }
body[data-theme="dark"] .chatwa .wa-id small.istyping { color: #7fd6a2; }
@keyframes kctyping {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.push-test { margin-top: 10px; }

/* ---- v37: the chat page is a locked frame - only the conversation scrolls ---- */
body[data-page="chat"] { height: 100dvh; overflow: hidden; }
body[data-page="chat"] .shell.chatfull { display: flex; flex-direction: column; height: 100dvh; }
body[data-page="chat"] .shell.chatfull .content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body[data-page="chat"] .chatdesk { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body[data-page="chat"] .chatwa { flex: 1; min-height: 0; }
body[data-page="chat"] .iosnudge { position: absolute; top: 74px; left: 12px; right: 12px;
                                   max-width: 660px; margin: 0 auto; z-index: 9; }

/* ---- v38: landing live member counter ---- */
.land-counter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(21, 18, 135, .06);
  border: 1px solid rgba(21, 18, 135, .14);
}
.land-counter b { font-size: 20px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.lc-label { font-size: 13.5px; color: var(--ink-soft, #5b628f); }
.lc-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: none;
          animation: kcpulse 2s infinite; }
@keyframes kcpulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
  70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.lc-live { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
           color: #0d7a3f; background: rgba(34, 197, 94, .16); border-radius: 4px; padding: 2px 6px; }
.land-counter.ticked b { color: #b8860b; }
.land-counter.ticked { animation: kcflash 1.8s ease; }
@keyframes kcflash {
  0%   { background: rgba(253, 174, 21, .30); border-color: #FDAE15; }
  100% { background: rgba(21, 18, 135, .06); border-color: rgba(21, 18, 135, .14); }
}
body[data-theme="dark"] .land-counter { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
body[data-theme="dark"] .lc-live { color: #7fd6a2; }

/* ---- v39: super admin panel ---- */
.tblava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--chipbg); vertical-align: middle; }
.chip.role-customer { background: rgba(21, 18, 135, .10); color: var(--ink, #14213d); }
.chip.role-agent { background: rgba(253, 174, 21, .18); color: #8a5b00; }
.chip.role-merchant { background: rgba(34, 197, 94, .14); color: #0d7a3f; }
.chip.role-admin { background: #151287; color: #fff; }
.dangerbtn { border-color: rgba(248, 113, 113, .55); color: #b3261e; }
.rowlocked td { opacity: .62; }
.rowlocked td:first-child { position: relative; }
.searchbar { display: flex; gap: 8px; margin: 10px 0; }
.searchbar input { flex: 1; }
.adminhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.adminhead-main { flex: 1; min-width: 220px; }
.adminhead-main h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adminhead-actions { display: flex; gap: 8px; align-items: center; }
.kpidim { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
body[data-theme="dark"] .chip.role-customer { color: #dfe3ff; }
body[data-theme="dark"] .dangerbtn { color: #ff8f88; }
