/* ═══ WALLET SCREENS (canvas "Wallet (new design)", Ren 2026-10-30) ═══
   Full screens for all transactions, details, limits, top up and
   withdraw (wallet.js), plus the wallet home additions. Colours come
   from the --ag-* tokens in agreements.css, so dark mode follows. */

/* ── Wallet home ── */
.wl-stats { display: none; }
@media (max-width: 900px) {
  #walletView .wl-stats { display: flex; gap: 10px; margin: 0 0 12px; }
  #walletView .wl-stat { flex: 1; min-width: 0; background: var(--ag-card); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
  #walletView .wl-stat span { font-size: 12px; font-weight: 700; color: var(--ag-label); }
  #walletView .wl-stat b { font-size: 18px; font-weight: 800; white-space: nowrap; }
  #walletView .wl-stat-wd b { color: var(--ag-blue-ink); }
  #walletView .wl-stat-held b { color: var(--ag-orange-ink); }
  #walletView .wallet-action-btn.wl-dim { opacity: .55; }

  /* row tiles, same colours as the canvas */
  .wtx-k-topup  { background: var(--ag-green-bg) !important; color: var(--ag-green-ink) !important; }
  .wtx-k-escrow { background: var(--ag-orange-bg) !important; color: var(--ag-orange-ink) !important; }
  .wtx-k-earn   { background: var(--ag-teal-bg) !important; color: var(--ag-teal-ink) !important; }
  .wtx-k-payout { background: var(--ag-blue-bg) !important; color: var(--ag-blue-ink) !important; }
  .wtx-k-refund { background: var(--ag-purple-bg) !important; color: var(--ag-purple) !important; }
  .wtx-k-fee    { background: var(--ag-soft) !important; color: var(--ag-label) !important; }
  #walletTransactionsList .wallet-tx-amountcol { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

  /* theme tokens so the phone wallet follows dark mode */
  #walletTxCard .wallet-card-title { color: var(--ag-ink) !important; }
  #walletTransactionsList { background: var(--ag-card) !important; border-color: var(--ag-line) !important; }
  #walletTransactionsList .wallet-tx-row { border-bottom-color: var(--ag-line) !important; }
  #walletTransactionsList .wallet-tx-label { color: var(--ag-ink) !important; }
  #walletTransactionsList .wallet-tx-meta { color: var(--ag-label) !important; }
  #walletTransactionsList .wallet-tx-amount.out { color: var(--ag-ink) !important; }
  #walletTransactionsList .wallet-tx-amount.in { color: var(--ag-green-ink) !important; }
  #walletView .wallet-action-primary { background: var(--ag-green-bg) !important; }
  #walletView .wallet-action-secondary { background: var(--ag-blue-bg) !important; }
  #walletView .wallet-action-label { color: var(--ag-ink) !important; }
  #walletView .wallet-action-sub { color: var(--ag-label) !important; }
  #walletView .wallet-action-icon { background: var(--ag-card) !important; }
  #walletView .wl-fees-row { background: var(--ag-card) !important; border-color: var(--ag-line) !important; }
  #walletView .wl-fees-txt b { color: var(--ag-ink) !important; }
  #walletView .wl-fees-txt small { color: var(--ag-label) !important; }
  #walletView .wl-fees-ico { background: var(--ag-soft) !important; color: var(--ag-label) !important; }

  /* empty state */
  #walletTransactionsList .wallet-tx-empty { padding: 18px 16px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
  #walletTransactionsList .wallet-tx-empty-icon { width: 60px; height: 60px; border-radius: 18px; background: var(--ag-green-bg); color: var(--ag-green-ink); display: flex; align-items: center; justify-content: center; }
  #walletTransactionsList .wallet-tx-empty-icon .lucide-ico { width: 26px; height: 26px; }
  #walletTransactionsList .wallet-tx-empty-title { margin: 4px 0 0; font-size: 16px; font-weight: 800; color: var(--ag-ink); }
  #walletTransactionsList .wallet-tx-empty-body { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ag-muted); max-width: 290px; }
  #walletTransactionsList .wl-empty-btn { width: 100%; margin-top: 6px; }
}
#walletView .wl-empty-btn { display: none; }
@media (max-width: 900px) { #walletView .wl-empty-btn { display: flex; } }

/* status pill (rows, lists, details) */
.wtx-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.wtx-pill.p-orange { background: var(--ag-orange-bg); color: var(--ag-orange-ink); }
.wtx-pill.p-blue   { background: var(--ag-blue-bg); color: var(--ag-blue-ink); }
.wtx-pill.p-green  { background: var(--ag-green-bg); color: var(--ag-green-ink); }
.wtx-pill.p-red    { background: var(--ag-pink-bg); color: var(--ag-pink-ink); }
.wtx-pill.p-purple { background: var(--ag-purple-bg); color: var(--ag-purple); }
.wtx-pill.p-grey   { background: var(--ag-soft); color: var(--ag-label); }
@media (min-width: 901px) { #walletTransactionsList .wtx-pill { display: none; } }

/* ── Full screens ── */
body.wls-lock { overflow: hidden; }
.wls {
  position: fixed; inset: 0; z-index: 10004; display: flex; justify-content: center;
  background: var(--ag-page); color: var(--ag-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wls-in { width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; background: var(--ag-page); position: relative; }
@media (min-width: 901px) {
  .wls { background: rgba(10, 20, 14, .5); align-items: center; }
  .wls-in { height: min(860px, 92vh); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
}
.wls-top { height: 60px; padding: 0 12px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wls-top b { flex: 1; font-size: 18px; font-weight: 800; }
.wls-back { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--ag-card); color: var(--ag-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.wls-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.wls-body.center { padding: 56px 22px 20px; align-items: center; text-align: center; gap: 16px; }
.wls-foot { padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; background: var(--ag-card); border-radius: 22px 22px 0 0; }
.wls-foot.plain { background: transparent; }
.wls svg { flex-shrink: 0; }

.wls-btn { height: 52px; border: 0; border-radius: 14px; background: var(--ag-green); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; width: 100%; padding: 0 14px; text-decoration: none; }
.wls-btn:disabled { background: var(--ag-track); color: var(--ag-label); cursor: not-allowed; }
.wls-btn.ghost { background: var(--ag-card); color: var(--ag-green-ink); border: 2px solid var(--ag-green); }
.wls-btn.link { height: 40px; background: transparent; color: var(--ag-label); }
.wls-btn.link.green { color: var(--ag-green); }

.wls-card { background: var(--ag-card); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.wls-card > .h { font-size: 15px; font-weight: 800; }
.wls-sec { font-size: 15px; font-weight: 800; margin: 2px 2px 0; }
.wls-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.wls-line span { color: var(--ag-label); font-weight: 600; }
.wls-line b { font-weight: 600; white-space: nowrap; color: var(--ag-ink); }
.wls-line.out b { color: var(--ag-pink-ink); }
.wls-line.in b { color: var(--ag-green-ink); }
.wls-line.note b { color: var(--ag-label); font-weight: 600; }
.wls-line.total { border-top: 1.5px solid var(--ag-line); padding-top: 12px; margin-top: 2px; }
.wls-line.total span, .wls-line.total b { color: var(--ag-ink); font-weight: 800; }
.wls-line.total b { font-size: 17px; }
.wls-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 2px 0; }
.wls-kv span { color: var(--ag-text); }
.wls-kv b { font-weight: 800; text-align: right; }
.wls-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.wls-meta span { color: var(--ag-label); flex-shrink: 0; }
.wls-meta b { font-weight: 700; text-align: right; word-break: break-word; }
.wls-small { font-size: 12px; color: var(--ag-label); line-height: 1.45; }

.wls-note { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px; font-size: 13px; line-height: 1.45; font-weight: 600; text-align: left; }
.wls-note.blue { background: var(--ag-blue-bg); color: var(--ag-blue-ink); }
.wls-note.grey { background: var(--ag-soft); color: var(--ag-label); }
.wls-note.orange { background: var(--ag-orange-bg); color: var(--ag-orange-ink); }
.wls-note.red { background: var(--ag-pink-bg); color: var(--ag-pink-ink); }

.wls-tile { border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wls-tile.green { background: var(--ag-green-bg); color: var(--ag-green-ink); }
.wls-tile.blue { background: var(--ag-blue-bg); color: var(--ag-blue-ink); }
.wls-tile.orange { background: var(--ag-orange-bg); color: var(--ag-orange-ink); }
.wls-tile.teal { background: var(--ag-teal-bg); color: var(--ag-teal-ink); }
.wls-tile.purple { background: var(--ag-purple-bg); color: var(--ag-purple); }
.wls-tile.grey { background: var(--ag-soft); color: var(--ag-label); }
.wls-tile.red { background: var(--ag-pink-bg); color: var(--ag-pink-ink); }
.wls-hero { width: 96px; height: 96px; border-radius: 50%; }
.wls-h1 { margin: 0; font-size: 24px; font-weight: 800; }
.wls-p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ag-muted); max-width: 330px; }

/* chips */
.wls-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; padding: 0 14px 2px; }
.wls-chips::-webkit-scrollbar { display: none; }
.wls-chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ag-track); background: var(--ag-card); color: var(--ag-ink); font-family: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.wls-chip.on { background: var(--ag-green); border-color: var(--ag-green); color: #fff; }

/* transaction rows */
.wls-tx { display: flex; gap: 12px; align-items: center; padding: 8px 0; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; color: inherit; }
.wls-tx .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wls-tx .t b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wls-tx .t span { font-size: 12px; color: var(--ag-label); }
.wls-tx .a { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wls-tx .a b { font-size: 14px; font-weight: 800; white-space: nowrap; }
.wls-tx .a b.in { color: var(--ag-green-ink); }
.wls-group { font-size: 12px; font-weight: 800; color: var(--ag-label); letter-spacing: .6px; padding-top: 6px; }
.wls-sum { display: flex; gap: 10px; padding: 10px 14px 4px; flex-shrink: 0; }
.wls-sum > span { flex: 1; background: var(--ag-card); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.wls-sum small { font-size: 11px; font-weight: 700; color: var(--ag-label); }
.wls-sum b { font-size: 16px; font-weight: 800; }

/* amount entry */
.wls-amt { display: flex; align-items: center; gap: 2px; border-bottom: 2px solid var(--ag-green); padding-bottom: 6px; }
.wls-amt span { font-size: 36px; font-weight: 800; }
.wls-amt input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ag-ink); font-family: inherit; font-size: 40px; font-weight: 800; padding: 0; -moz-appearance: textfield; }
.wls-amt input::-webkit-outer-spin-button, .wls-amt input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wls-amt input::placeholder { color: var(--ag-track); }
.wls-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.wls-quick button { height: 44px; border-radius: 12px; border: 1.5px solid var(--ag-track); background: var(--ag-card); color: var(--ag-ink); font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer; padding: 0; }
.wls-quick button.on { background: var(--ag-green); border-color: var(--ag-green); color: #fff; }
.wls-err { font-size: 12px; font-weight: 700; color: var(--ag-pink-ink); min-height: 16px; }
.wls-method { display: flex; gap: 12px; align-items: center; border: 2px solid var(--ag-green); border-radius: 16px; padding: 12px; background: var(--ag-card); }
.wls-method .t { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.wls-method .t b { font-size: 15px; font-weight: 800; }
.wls-method .t span { font-size: 12px; color: var(--ag-label); }
.wls-tick { width: 22px; height: 22px; border-radius: 50%; background: var(--ag-green); color: #fff; display: flex; align-items: center; justify-content: center; }
.wls-field { display: flex; flex-direction: column; gap: 6px; }
.wls-field > span { font-size: 13px; font-weight: 700; color: var(--ag-text); }
.wls-field input { height: 50px; border-radius: 14px; border: 1.5px solid var(--ag-track); background: var(--ag-card); color: var(--ag-ink); padding: 0 14px; font-family: inherit; font-size: 16px; font-weight: 600; outline: 0; box-sizing: border-box; width: 100%; }
.wls-field input:focus { border-color: var(--ag-green); }
.wls-field small { font-size: 12px; color: var(--ag-label); }
.wls-can { background: var(--ag-blue-bg); color: var(--ag-blue-ink); border-radius: 16px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wls-can small { font-size: 12px; font-weight: 700; display: block; }
.wls-can b { font-size: 20px; font-weight: 800; }
.wls-can em { font-style: normal; font-size: 12px; font-weight: 700; text-align: right; max-width: 140px; line-height: 1.35; }
.wls-linkbtn { white-space: nowrap; flex-shrink: 0; border: 0; background: none; color: var(--ag-green); font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; padding: 0; }
.wls-acct { display: flex; gap: 12px; align-items: center; }
.wls-acct .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wls-acct .t b { font-size: 15px; font-weight: 800; }
.wls-acct .t span { font-size: 13px; color: var(--ag-label); }

/* timeline */
.wls-tl { display: flex; flex-direction: column; text-align: left; }
.wls-tl-row { display: flex; gap: 12px; }
.wls-tl-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wls-tl-dot i { width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ag-soft); color: var(--ag-label); }
.wls-tl-dot i.done { background: var(--ag-green); color: #fff; }
.wls-tl-dot i.now { background: var(--ag-orange-bg); border: 2px solid var(--ag-orange); }
.wls-tl-dot i.bad { background: var(--ag-pink-bg); color: var(--ag-pink-ink); }
.wls-tl-dot em { width: 2px; flex: 1; min-height: 20px; background: var(--ag-track); }
.wls-tl-dot em.done { background: var(--ag-green); }
.wls-tl-t { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.wls-tl-t b { font-size: 14px; font-weight: 800; }
.wls-tl-t span { font-size: 12px; color: var(--ag-label); }
.wls-tl-row.todo .wls-tl-t b { color: var(--ag-label); }
.wls-bul { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ag-text); }
.wls-bul::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ag-orange-ink); margin-top: 6px; flex-shrink: 0; }

/* unused top-up row (refund to GCash, Ren 2026-10-30) */
.wl-unused { display: none; }
@media (max-width: 900px) {
  #walletView .wl-unused.on { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--ag-purple-bg); color: var(--ag-purple); font-family: inherit; text-align: left; cursor: pointer; }
  #walletView .wl-unused .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  #walletView .wl-unused b { font-size: 14px; font-weight: 800; color: var(--ag-ink); }
  #walletView .wl-unused em { font-style: normal; color: var(--ag-purple); }
  #walletView .wl-unused small { font-size: 12px; color: var(--ag-label); }
  #walletView .wl-unused .go { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ag-card); color: var(--ag-purple); font-size: 13px; font-weight: 800; display: flex; align-items: center; flex-shrink: 0; }
}
body.dark-mode #walletView, body.dark-mode .wls { --ag-purple: #c4b2f0; }

/* Withdraw: pick top-up back or job earnings (Ren 2026-10-30) */
.wls-pick { width: 100%; border: 0; font-family: inherit; color: inherit; cursor: pointer; padding: 14px 16px; }
.wls-pick .wls-acct { width: 100%; }
.wls-pick-amt { font-size: 16px; font-weight: 800; white-space: nowrap; }
.wls-pick.off { opacity: .55; }

/* Dispute charge owed (Ren 2026-11-08), phone and PC */
#walletView .wl-debt { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: #fdeceb; color: #9b2c22; }
#walletView .wl-debt[hidden] { display: none; }
#walletView .wl-debt .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#walletView .wl-debt b { font-size: 14px; font-weight: 800; color: #5c1a14; }
#walletView .wl-debt em { font-style: normal; color: #c0392b; }
#walletView .wl-debt small { font-size: 12px; color: #8a4a44; line-height: 1.4; }
#walletView .wl-debt .go { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: #c0392b; color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
body.dark-mode #walletView .wl-debt { background: #3a1d1a; color: #f3b5ae; }
body.dark-mode #walletView .wl-debt b { color: #fde2df; }
body.dark-mode #walletView .wl-debt small { color: #e2a29b; }
