:root {
  --ink: #0f1f17;
  --muted: #5b6b62;
  --line: #e3e8e4;
  --bg: #f4f6f2;
  --card: #ffffff;
  --brand: #0b6b43;
  --brand-ink: #ffffff;
  --brand-soft: #e4f2ea;
  --gold: #e0a526;
  --gold-soft: #fdf3dc;
  --danger: #b4261b;
  --danger-soft: #fce9e7;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 31, 23, 0.06), 0 8px 24px rgba(15, 31, 23, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8efe9;
    --muted: #9db0a5;
    --line: #26352d;
    --bg: #0d1611;
    --card: #142019;
    --brand: #2fae74;
    --brand-ink: #06130c;
    --brand-soft: #173326;
    --gold: #f0bb4a;
    --gold-soft: #33290f;
    --danger: #ff7b6e;
    --danger-soft: #3a1a17;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.wrap { max-width: 440px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.wide { max-width: 760px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: var(--brand-ink); font-size: 15px; }
.logo-img { width: 32px; height: 32px; display: block; }
.secure { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.seller { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.item { font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.desc { color: var(--muted); font-size: 14px; margin: 0; }
.amount { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.amount small { font-size: 16px; font-weight: 700; color: var(--muted); margin-right: 6px; letter-spacing: 0; }

.banner { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.banner.test { background: var(--gold-soft); color: var(--ink); border: 1px solid var(--gold); }
.banner.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }

.methods { display: grid; gap: 10px; }
.method { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.method:hover { border-color: var(--brand); }
.method[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); }
.method .badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; }
.method .sub { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.b-ecocash { background: #1d4fa3; }
.b-onemoney { background: #e8731a; }
.b-innbucks { background: #6b2fa0; }
.b-web { background: #2d3a33; }

label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
input, select, textarea { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; margin-top: 14px; }
.check input { width: 20px; height: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 16px; border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; text-decoration: none; margin-top: 16px; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.wa { background: #1fa855; color: #fff; }
.btn.small { width: auto; padding: 9px 12px; font-size: 13px; margin: 0; }

.waiting { text-align: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); margin: 6px auto 14px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.code { font-size: 30px; font-weight: 800; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; padding: 12px; border-radius: 12px; background: var(--brand-soft); margin: 10px 0; }

.receipt { text-align: center; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 34px; margin: 4px auto 10px; }
.receipt h2 { font-size: 22px; margin: 0; }
.verified { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; margin-top: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; text-align: left; font-size: 14px; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 22px; }
.hidden { display: none !important; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { font-weight: 700; font-size: 14px; }
.list .m { font-size: 12px; color: var(--muted); }
.pill { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.pill.open { background: var(--gold-soft); color: var(--ink); }
.pill.paid { background: var(--brand-soft); color: var(--brand); }
.pill.cancelled { background: var(--line); color: var(--muted); }
.share { background: var(--brand-soft); border-radius: 12px; padding: 12px; margin-top: 12px; font-size: 14px; word-break: break-all; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr 1fr; } .stats .stat:last-child { grid-column: span 2; } }

/* direct wallet payments */
.subhead { font-size: 15px; margin: 20px 0 2px; }
.desc.small { font-size: 13px; margin-bottom: 10px; }
.paybox { text-align: left; border: 1.5px dashed var(--brand); border-radius: 14px; padding: 14px; margin: 14px 0 4px; background: var(--brand-soft); }
.pb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; font-size: 14px; }
.pb-row span { color: var(--muted); }
.pb-big { font-size: 22px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.b-direct { background: var(--brand); }
.b-omari { background: #1b8a3c; }

.setup { padding-left: 20px; font-size: 14px; color: var(--ink); }
.setup li { margin: 6px 0; }
code { background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; }
.pill.untrusted, .pill.unmatched { background: var(--gold-soft); color: var(--ink); }
.pill.ignored, .pill.duplicate { background: var(--line); color: var(--muted); }
.pill.matched { background: var(--brand-soft); color: var(--brand); }
.list .body { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* error pop-up */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 14, 0.55); }
.modal { width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 24px 20px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal-icon { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--danger); background: var(--danger-soft); }
.modal h2 { font-size: 18px; margin: 0 0 8px; }
.modal p { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

/* route labels and on/off switches */
.method .route { margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.method > span:nth-child(2) { flex: 1; min-width: 0; }
input.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
input.switch:checked { background: var(--brand); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* shop */
.shop-head { display: flex; gap: 16px; align-items: center; }
.shop-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; flex-shrink: 0; background: var(--brand-soft); }
.shop-initial { display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--brand); }
.shop-meta { min-width: 0; }
.shop-meta h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.02em; }
.shop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.product { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.product:hover { border-color: var(--brand); }
.product-img { aspect-ratio: 1 / 1; background: var(--brand-soft); }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-img.placeholder { display: grid; place-items: center; font-size: 40px; font-weight: 800; color: var(--brand); }
.product-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.product-desc { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.product-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.product-buy { font-size: 12px; font-weight: 800; color: var(--brand-ink); background: var(--brand); padding: 6px 12px; border-radius: 999px; }
@media (max-width: 420px) { .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* pay page: product photo and seller logo */
.item-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; display: block; }
.seller-row { display: flex; align-items: center; gap: 8px; }
.seller-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.photo-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--brand-soft); }
.list .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.list .with-thumb { display: flex; gap: 10px; align-items: center; min-width: 0; }

/* Account type picker and pay-me card */
.kind-pick { display: grid; gap: 8px; margin: 6px 0 4px; }
.kind-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; margin: 0; font-weight: 400; }
.kind-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.kind-opt input { width: auto; margin-top: 3px; }
.kind-opt b { display: block; }
.kind-opt small { display: block; color: var(--muted); font-size: 13px; }
.payme { border: 2px solid var(--brand); }
.w-order { display: inline-flex; flex-direction: column; gap: 4px; }
.w-order button { width: 34px; height: 30px; padding: 0; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; cursor: pointer; }
.w-order button:disabled { opacity: 0.3; cursor: default; }
.w-pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; margin-right: 6px; }
li.off { opacity: 0.55; }
