/*
 * TrustMoni — app.css
 * One stylesheet for every page in /views.
 *
 *  1. Tokens            9. Pills, chips, segmented tabs
 *  2. Base             10. Notices and flash messages
 *  3. Page layout      11. Balance card and quick actions
 *  4. App bar          12. Coins and wallets
 *  5. Bottom tab bar   13. Transactions
 *  6. Buttons          14. Sheets, dialogs, PIN keypad, receipts
 *  7. Form fields      15. Loader, toast, empty states
 *  8. Cards and lists  16+ Page sections (auth, deposit, bills, …)
 */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --brand-800: #1e3a8a;
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-100: #dbeafe;
  --brand-50:  #eff6ff;

  --ink:    #0f172a;
  --ink-2:  #334155;
  --muted:  #64748b;
  --faint:  #94a3b8;
  --line:   #e5e9f0;
  --line-2: #f0f3f7;
  --canvas: #f3f5f9;
  --surface:#ffffff;
  --field:  #f8fafc;

  --ok:      #047857;  --ok-bg:      #ecfdf5;  --ok-line:      #a7f3d0;
  --warn:    #b45309;  --warn-bg:    #fffbeb;  --warn-line:    #fde68a;
  --bad:     #b91c1c;  --bad-bg:     #fef2f2;  --bad-line:     #fecaca;
  --violet:  #6d28d9;  --violet-bg:  #f5f3ff;  --violet-line:  #ddd6fe;
  --green:   #10b981;
  --red:     #ef4444;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-pop: 0 18px 50px rgba(15, 23, 42, .18);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
strong, b { font-weight: 600; }
a { color: var(--brand-600); text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* 3. Page layout ----------------------------------------------------------- */
.page { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
.page--tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 32px); }
.page > * + * { margin-top: 16px; }
.page > .section-head { margin-top: 28px; }
.page > .section-head:first-child { margin-top: 4px; }
.page > .section-head + * { margin-top: 10px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.section-link { font-size: 14px; font-weight: 500; }
.section-note { font-size: 13px; color: var(--muted); }

.stack > * + * { margin-top: 12px; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 14px; }
.mt-lg { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* 4. App bar --------------------------------------------------------------- */
.app-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 12px 0 8px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-bar-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.app-bar-title:first-child { padding-left: 8px; }
.app-bar--home { padding: 0 16px; }
.app-bar--home .app-bar-side { margin-left: auto; }

.brand { font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.brand span { color: var(--brand-600); }

.icon-btn {
  position: relative;
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 0; background: transparent;
  color: var(--ink-2); font-size: 16px; cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn--outlined { border: 1px solid var(--line); background: var(--surface); }
.dot-badge { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface); }
.count-badge {
  position: absolute; top: -3px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-600); color: #fff; font-size: 15px; font-weight: 600;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.help-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 13px; font-weight: 500;
}

/* 5. Bottom tab bar -------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 500;
}
.tabbar-item svg { width: 22px; height: 22px; }
.tabbar-item.is-active { color: var(--brand-600); }

/* 6. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; line-height: 1.2; text-align: center;
  cursor: pointer; transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--brand-700); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-secondary:not(:disabled):hover { border-color: var(--faint); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-violet { background: #7c3aed; color: #fff; }
.btn-violet:not(:disabled):hover { background: #6d28d9; }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-dark { background: var(--ink-2); color: #fff; }
.btn-link { background: none; border: 0; color: var(--brand-600); font-weight: 500; cursor: pointer; padding: 0; }

/* 7. Form fields ----------------------------------------------------------- */
.field + .field { margin-top: 16px; }
.label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.label-note { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--field); color: var(--ink);
  font-size: 16px; outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-500); background: var(--surface); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.input:disabled, .input[readonly] { color: var(--ink-2); background: var(--line-2); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}

.input-wrap { position: relative; }
.input-wrap .input-lead {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 14px; pointer-events: none;
}
.input-wrap.has-lead .input, .input-wrap.has-lead .select { padding-left: 40px; }
.input-wrap.has-trail .input { padding-right: 76px; }
.input-wrap.has-toggle .input { padding-right: 48px; }
.input-trail {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 34px; padding: 0 12px; border-radius: 9px; border: 0;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; border-radius: 10px;
  color: var(--faint); font-size: 16px; cursor: pointer;
}
.pw-toggle:hover { color: var(--brand-600); }

.hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.hint--lead { margin: 0 0 12px; }
.hint.is-ok, .is-ok { color: var(--ok); }
.hint.is-bad, .is-bad { color: var(--bad); }
.hint.is-warn, .is-warn { color: var(--warn); }
.hint.is-info, .is-info { color: var(--brand-600); }
.status-line { min-height: 20px; margin-top: 6px; font-size: 13px; }
.status-line i { margin-right: 4px; }

.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand-600); }

.form-actions { margin-top: 20px; }

/* Searchable bank picker */
.picker { position: relative; }
.picker-list {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 150;
  max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.picker-list.open { display: block; }
.picker-option { padding: 11px 14px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker-option:last-child { border-bottom: 0; }
.picker-option:hover, .picker-option.highlighted { background: var(--brand-50); color: var(--brand-700); }
.picker-option mark { background: none; color: var(--brand-700); font-weight: 600; }

/* 8. Cards and lists ------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-body { padding: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--muted); }
.card-head + .card-body { padding-top: 14px; }

.kv { padding: 2px 18px; }
.kv-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--muted); flex-shrink: 0; }
.kv-val { color: var(--ink); font-weight: 500; text-align: right; word-break: break-word; }

.link-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.link-row:last-child { border-bottom: 0; }
.link-row:hover { background: var(--field); }
.link-row .chev { margin-left: auto; color: var(--faint); font-size: 12px; }
.link-row-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600); font-size: 15px;
}
.link-row-title { font-size: 15px; font-weight: 500; }
.link-row-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.link-row-text { min-width: 0; flex: 1; }
.link-row-text > span, .cat-card .cat-name { display: block; }
.cat-card .chip i, .chip i { font-size: 13px; color: var(--brand-600); }
.link-row-text .link-row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 9. Pills, chips, segmented tabs ----------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.pill--ok      { background: var(--ok-bg);     color: var(--ok); }
.pill--pending { background: var(--warn-bg);   color: var(--warn); }
.pill--bad     { background: var(--bad-bg);    color: var(--bad); }
.pill--violet  { background: var(--violet-bg); color: var(--violet); }
.pill--info    { background: var(--brand-50);  color: var(--brand-700); }
.pill--neutral { background: var(--line-2);    color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip img { width: 16px; height: 16px; border-radius: 50%; }
.chip.is-active, .chip.sel { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }
.chip-divider { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); flex-shrink: 0; }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #e9edf3; }
.segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.segmented--icons button { flex-direction: column; gap: 3px; font-size: 12px; min-height: 56px; }
.segmented--icons button i { font-size: 16px; }
.segmented--icons button.active i { color: var(--brand-600); }

/* 10. Notices and flash messages ------------------------------------------ */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-md); border: 1px solid;
  font-size: 14px; line-height: 1.55;
}
.notice > i { margin-top: 3px; flex-shrink: 0; }
.notice-title { font-weight: 600; margin-bottom: 2px; }
.notice-body { flex: 1; min-width: 0; }
.notice-body ul { margin: 6px 0 0 18px; }
.notice-body li + li { margin-top: 4px; }
.notice-action { display: inline-block; margin-top: 8px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.notice--info    { background: var(--brand-50);  border-color: #bfdbfe;           color: #1e40af; }
.notice--warn    { background: var(--warn-bg);   border-color: var(--warn-line);  color: #92400e; }
.notice--bad     { background: var(--bad-bg);    border-color: var(--bad-line);   color: var(--bad); }
.notice--ok      { background: var(--ok-bg);     border-color: var(--ok-line);    color: var(--ok); }
.notice--neutral { background: var(--surface);   border-color: var(--line);       color: var(--ink-2); }

.flash { padding: 13px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; line-height: 1.5; }
.flash a { color: inherit; text-decoration: underline; }
.flash-error   { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.flash-success { background: var(--ok-bg);  border-color: var(--ok-line);  color: var(--ok); }
.flash-info    { background: var(--brand-50); border-color: #bfdbfe; color: #1e40af; }
.flash-warning { background: var(--warn-bg); border-color: var(--warn-line); color: #92400e; }

/* 11. Balance card and quick actions -------------------------------------- */
.balance-card {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: 22px; color: #fff;
  background: linear-gradient(140deg, var(--brand-800) 0%, var(--brand-600) 58%, var(--brand-500) 100%);
  box-shadow: 0 12px 32px rgba(37, 99, 235, .28);
}
.balance-card::before {
  content: ''; position: absolute; top: -70px; right: -60px;
  width: 210px; height: 210px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.balance-card > * { position: relative; }
.balance-greeting { font-size: 14px; color: rgba(255, 255, 255, .78); }
.balance-label-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.balance-amount { margin-top: 2px; font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.balance-amount.is-masked { font-size: 24px; letter-spacing: .2em; }
.balance-note { margin-top: 2px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.balance-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: 12px; color: rgba(255, 255, 255, .92);
}
.balance-actions { display: flex; gap: 10px; margin-top: 18px; }
.balance-actions .btn { flex: 1; min-height: 46px; border-radius: 12px; }
.btn-on-dark { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .26); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .22); }
.btn-light { background: #fff; color: var(--brand-700); }
.eye-btn {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 12px; cursor: pointer;
}
.balance-card--compact { padding: 16px 18px; border-radius: 18px; box-shadow: none; }
.balance-card--compact .balance-amount { font-size: 26px; }
.balance-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.balance-side { text-align: right; font-size: 12px; color: rgba(255, 255, 255, .75); }
.balance-side strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; color: #fff; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 4px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.quick-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.quick-icon--green  { background: var(--ok-bg);    color: #059669; }
.quick-icon--blue   { background: var(--brand-50); color: var(--brand-600); }
.quick-icon--amber  { background: var(--warn-bg);  color: #d97706; }
.quick-icon--violet { background: var(--violet-bg); color: #7c3aed; }

/* 12. Coins and wallets ---------------------------------------------------- */
.coin-icon { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.coin-icon--sm { width: 28px; height: 28px; }
.coin-icon--lg { width: 44px; height: 44px; }

.wallet-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.wallet-row::-webkit-scrollbar { display: none; }
.wallet-tile {
  position: relative; flex-shrink: 0; width: 116px;
  padding: 14px 12px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  text-align: left; cursor: pointer; color: var(--ink);
}
.wallet-tile .coin-icon { margin-bottom: 10px; }
.wallet-tile-name { font-size: 13px; font-weight: 600; }
.wallet-tile-bal { margin-top: 1px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.coin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.coin-option {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.coin-option.active { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-600); }

.is-soon { cursor: pointer; }
.is-soon .coin-icon { filter: grayscale(1); opacity: .45; }
.is-soon .wallet-tile-name, .is-soon .coin-option-name { color: var(--faint); }
.soon-tag {
  position: absolute; top: 8px; right: 8px;
  padding: 1px 7px; border-radius: 999px;
  background: var(--line-2); color: var(--muted);
  font-size: 10px; font-weight: 500;
}
.coin-option .soon-tag { top: 4px; right: 4px; font-size: 9px; padding: 0 5px; }

/* 13. Transactions --------------------------------------------------------- */
.tx-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tx {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.tx:last-child { border-bottom: 0; }
.tx:hover { background: var(--field); }
.tx--static { cursor: default; }
.tx--static:hover { background: none; }
.tx-icon {
  position: relative; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.tx-icon .coin-icon { width: 42px; height: 42px; }
.tx-icon--in       { background: var(--ok-bg);     color: #059669; }
.tx-icon--out      { background: var(--bad-bg);    color: var(--red); }
.tx-icon--bonus    { background: var(--violet-bg); color: #7c3aed; }
.tx-icon--transfer { background: var(--warn-bg);   color: #d97706; }
.tx-icon--bill     { background: var(--brand-50);  color: var(--brand-600); }
.tx-icon--bank     { background: var(--warn-bg);   color: #d97706; }
.tx-dir {
  position: absolute; right: -2px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; box-shadow: 0 0 0 2px var(--surface);
}
.tx-dir--in  { background: #d1fae5; color: var(--ok); }
.tx-dir--out { background: #fee2e2; color: var(--bad); }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.tx-side { text-align: right; flex-shrink: 0; }
.tx-amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amt--in     { color: var(--ok); }
.tx-amt--out    { color: var(--ink); }
.tx-amt--bonus  { color: var(--violet); }
.tx-amt--muted  { color: var(--faint); }
.tx-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.tx-side .pill { margin-top: 4px; }
.tx .tx-title, .tx .tx-amt, .tx .tx-sub, .tx .tx-meta { display: block; }
.tx .tx-meta { display: flex; }

.tx-day + .tx-day { margin-top: 20px; }
.tx-day-label { margin: 0 4px 8px; font-size: 13px; font-weight: 500; color: var(--muted); }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pager a {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.pager a.active { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }

/* 14. Sheets, dialogs, PIN keypad, receipts ------------------------------- */
.backdrop {
  position: fixed; inset: 0; z-index: 800;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.backdrop.open, .backdrop.show { display: flex; }
.backdrop--center { align-items: center; padding: 20px; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  padding: 10px 20px calc(24px + var(--safe-b));
  background: var(--surface); border-radius: 22px 22px 0 0;
  animation: sheet-in .26s ease-out;
}
.sheet-handle { width: 40px; height: 4px; margin: 4px auto 18px; border-radius: 2px; background: var(--line); cursor: pointer; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.dialog {
  width: 100%; max-width: 380px; max-height: 92vh; overflow-y: auto;
  padding: 26px 20px 20px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow-pop);
  animation: dialog-in .22s ease-out;
}
@keyframes dialog-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.pin-head { text-align: center; }
.pin-title { font-size: 18px; font-weight: 600; }
.pin-title i { color: var(--brand-600); margin-right: 6px; font-size: 15px; }
.pin-sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 24px 0 10px; }
.pin-dot, .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: transparent; transition: background-color .12s, border-color .12s; }
.pin-dot.filled, .dot.filled { background: var(--brand-600); border-color: var(--brand-600); }
.pin-dot.error, .dot.error { background: var(--red); border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pin-err { min-height: 22px; margin-bottom: 10px; text-align: center; font-size: 14px; font-weight: 500; color: var(--bad); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  height: 58px; border-radius: 14px; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--field); color: var(--ink);
  font-size: 22px; font-weight: 500; cursor: pointer; transition: background-color .1s;
}
.key:active { background: var(--brand-100); }
.key small { margin-top: 1px; font-size: 9px; font-weight: 500; letter-spacing: .12em; color: var(--faint); }
.key--fn { background: transparent; color: var(--muted); font-size: 18px; }
.key--blank { background: transparent; cursor: default; }

.receipt { text-align: center; }
.receipt-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ok-bg); color: #059669; font-size: 26px;
}
.receipt-title { font-size: 18px; font-weight: 600; }
.receipt-amount { margin: 6px 0 18px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.receipt-rows { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.receipt-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row span:first-child { color: var(--muted); flex-shrink: 0; }
.receipt-row span:last-child { font-weight: 500; text-align: right; word-break: break-all; }

.detail-head { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.detail-icon {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.detail-icon img { width: 34px; height: 34px; }
.detail-title { font-size: 17px; font-weight: 600; }
.detail-amount { margin-top: 4px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.detail-status { margin-top: 8px; }
.detail-rows { padding-top: 4px; }
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.detail-row:last-child { border-bottom: 0; }
.detail-key { color: var(--muted); flex-shrink: 0; }
.detail-val { font-weight: 500; text-align: right; word-break: break-all; }
.detail-val small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.detail-actions { margin-top: 16px; }

/* 15. Loader, toast, empty states ----------------------------------------- */
#tm-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(255, 255, 255, .94);
}
#tm-loader.on { display: flex; }
.loader-mark { position: relative; width: 64px; height: 64px; }
.loader-mark svg { position: absolute; inset: 0; }
.loader-mark span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--brand-600); }
.loader-text { font-size: 14px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 9000;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--line-2); color: var(--faint); font-size: 22px;
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.empty-text { margin-top: 4px; font-size: 14px; }
.empty .btn { margin-top: 18px; }

/* 16. Auth pages ----------------------------------------------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.auth-hero {
  padding: 52px 24px 56px; text-align: center; color: #fff;
  background: linear-gradient(160deg, var(--brand-700) 0%, var(--brand-500) 100%);
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  font-size: 14px; font-weight: 600; color: #fff;
}
.auth-hero-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); font-size: 22px;
}
.auth-title { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { margin-top: 6px; font-size: 15px; color: rgba(255, 255, 255, .8); line-height: 1.5; }
.auth-body {
  flex: 1; width: 100%; max-width: 480px; margin: -22px auto 0;
  padding: 28px 22px 40px; background: var(--surface); border-radius: 26px 26px 0 0;
}
.auth-body > * + * { margin-top: 18px; }
.auth-row-end { display: flex; justify-content: flex-end; margin-top: 10px; font-size: 14px; }
.auth-body .center-text { text-align: center; }
.auth-foot { text-align: center; font-size: 15px; color: var(--muted); }
.auth-foot a { font-weight: 500; }
.auth-back { display: block; text-align: center; font-size: 14px; color: var(--muted); }
.auth-back i { margin-right: 6px; font-size: 12px; }
.divider-text { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter .bar, .pw-meter .pw-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background-color .25s; }
.bar.weak { background: #ef4444; } .bar.fair { background: #f59e0b; } .bar.good { background: #10b981; } .bar.strong { background: #059669; }
.pw-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; }
.rule { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); }
.rule::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rule.met { color: var(--ok); }
.ref-input { text-transform: uppercase; letter-spacing: .08em; }
.ref-input::placeholder { text-transform: none; letter-spacing: 0; }
.ref-hint.valid { color: var(--ok); }
.ref-hint.invalid { color: var(--bad); }
.ref-status { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; }

/* Centered status pages (verify email, set PIN) */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #eef4ff, #f3f5f9); }
.center-card { width: 100%; max-width: 420px; padding: 36px 26px 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.center-card > * + * { margin-top: 14px; }
.status-icon {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.status-icon--ok   { background: var(--ok-bg);    color: #059669; }
.status-icon--info { background: var(--brand-50); color: var(--brand-600); }
.status-icon--bad  { background: var(--bad-bg);   color: var(--red); }
.center-title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.center-text { font-size: 15px; color: var(--muted); line-height: 1.6; }
.steps-list { list-style: none; padding: 16px; border-radius: 14px; background: var(--field); text-align: left; counter-reset: s; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); counter-increment: s; }
.steps-list li + li { margin-top: 12px; }
.steps-list li::before {
  content: counter(s); flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 600;
}

/* Set PIN boxes */
.pin-label { font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left; }
.pin-row { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.pin-box {
  width: 58px; height: 64px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--field);
  text-align: center; font-size: 26px; font-weight: 500; color: var(--ink);
  outline: none; -webkit-text-security: disc;
}
.pin-box:focus { border-color: var(--brand-500); background: var(--surface); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.pin-box.filled { border-color: var(--brand-500); background: var(--brand-50); }

/* Verify PIN (lock screen) */
.lock { height: 100vh; display: flex; flex-direction: column; background: var(--surface); overflow: hidden; }
.lock-top {
  padding: 56px 24px 46px; text-align: center; color: #fff;
  background: linear-gradient(160deg, var(--brand-700) 0%, var(--brand-500) 100%);
}
.lock-top .brand-mark { width: 48px; height: 48px; margin-bottom: 14px; }
.lock-hello { font-size: 14px; color: rgba(255, 255, 255, .8); }
.lock-title { margin-top: 2px; font-size: 22px; font-weight: 600; }
.lock-flash { margin: 14px auto 0; max-width: 360px; padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, .16); font-size: 14px; }
.lock-mid { margin-top: -20px; padding: 28px 24px 20px; border-radius: 24px 24px 0 0; background: var(--surface); text-align: center; position: relative; }
.lock-mid .pin-dots { margin: 0 0 10px; }
.lock-hint { min-height: 20px; font-size: 14px; color: var(--muted); }
.lock-hint.is-bad { color: var(--bad); }
.lock-pad { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--field); border-top: 1px solid var(--line); }
.lock-pad .keypad { max-width: 360px; width: 100%; margin: 0 auto; }
.lock-pad .key { background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.lock-pad .key--fn, .lock-pad .key--blank { background: transparent; box-shadow: none; }
.lock-out { display: block; padding-top: 12px; text-align: center; font-size: 14px; color: var(--muted); }

/* 17. Dashboard ------------------------------------------------------------ */
.notif-panel {
  display: none;
  position: fixed; top: 64px; left: 50%; z-index: 500;
  width: calc(100vw - 32px); max-width: 340px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.notif-panel.show { display: block; }
.notif-head { padding: 13px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line-2); }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.notif-item .tx-icon { width: 34px; height: 34px; font-size: 12px; }
.notif-title { font-size: 14px; font-weight: 500; }
.notif-time { font-size: 12px; color: var(--muted); }
.notif-empty { padding: 26px 16px; text-align: center; font-size: 14px; color: var(--muted); }
.notif-foot { display: block; padding: 12px; text-align: center; font-size: 14px; font-weight: 500; background: var(--field); }

/* 18. Deposit -------------------------------------------------------------- */
.address-card { overflow: hidden; }
.address-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.address-coin { font-size: 16px; font-weight: 600; }
.address-net { font-size: 13px; color: var(--muted); }
.address-body { padding: 20px 18px; text-align: center; }
.qr { display: inline-block; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.qr img, .qr canvas { display: block; }
.address-label { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: left; }
.address-box { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 12px 12px 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); text-align: left; }
.address-box .mono { flex: 1; line-height: 1.5; color: var(--ink); }
.copy-btn { flex-shrink: 0; }
.copy-btn.copied { background: var(--ok); color: #fff; }

/* 19. Withdraw ------------------------------------------------------------- */
.saved-bank {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--brand-50); border: 1px solid #bfdbfe;
}
.saved-bank-name { font-size: 15px; font-weight: 500; color: var(--brand-700); }
.saved-bank-sub { margin-top: 1px; font-size: 13px; color: #3b6fd6; }
.recipient-box { display: none; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--violet-bg); border: 1px solid var(--violet-line); }
.recipient-name { font-size: 15px; font-weight: 500; color: var(--violet); }
.recipient-email { font-size: 13px; color: #7c3aed; }
.step-label { margin: 22px 2px 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.step-label:first-child { margin-top: 0; }

/* 20. Bills ---------------------------------------------------------------- */
.provider-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.provider-grid--3 { grid-template-columns: repeat(3, 1fr); }
.provider {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 4px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.provider img { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; }
.provider.sel { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-600); }
.provider .net-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-btn {
  padding: 11px 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.plan-name { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.plan-price { margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.plan-btn.sel { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }
.plan-loading { display: none; padding: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.ok-badge { display: none; padding: 11px 14px; border-radius: 12px; background: var(--ok-bg); border: 1px solid var(--ok-line); font-size: 14px; color: var(--ok); }
.ok-badge.show { display: block; }

/* 21. Profile -------------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  width: 68px; height: 68px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .18); border: 2px solid rgba(255, 255, 255, .35);
  font-size: 26px; font-weight: 600; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px;
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--brand-600); font-size: 10px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .2);
}
.profile-name { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-email { font-size: 14px; color: rgba(255, 255, 255, .8); overflow-wrap: anywhere; }
.profile-info { flex: 1; min-width: 0; }
.profile-info .balance-tag { margin-top: 8px; }

.promo-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
}
.promo-card .chev { margin-left: auto; opacity: .7; }
.promo-title { font-size: 15px; font-weight: 600; }
.promo-sub { margin-top: 1px; font-size: 13px; color: rgba(255, 255, 255, .8); }
.promo-code { display: inline-block; margin-top: 8px; padding: 3px 11px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 13px; font-weight: 500; letter-spacing: .08em; }
.promo-note { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, .8); }

/* 22. KYC ------------------------------------------------------------------ */
.nin-input { text-align: center; font-size: 22px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.nin-counter { margin-top: 6px; text-align: center; font-size: 13px; color: var(--faint); }
.camera-status { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot.off { background: var(--faint); }
.status-dot.live { background: var(--green); animation: pulse 1.5s infinite; }
.status-dot.captured { background: var(--brand-600); }
@keyframes pulse { 50% { opacity: .35; } }
.camera-wrap, .preview-wrap { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 400px; border-radius: 16px; overflow: hidden; background: var(--ink); }
.camera-wrap, .preview-wrap { display: none; }
#cameraVideo, #previewImg { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
#cameraCanvas { display: none; }
.camera-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.face-guide { width: 180px; height: 220px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .75); box-shadow: 0 0 0 2000px rgba(0, 0, 0, .4); }
.camera-hint { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 14px; color: #fff; }
.retake-badge { position: absolute; top: 12px; right: 12px; padding: 7px 12px; border: 0; border-radius: 9px; background: rgba(15, 23, 42, .65); color: #fff; font-size: 13px; cursor: pointer; }
.camera-controls { display: flex; gap: 10px; margin-top: 12px; }
.camera-controls .btn { flex: 1; padding: 0 12px; white-space: nowrap; }
.captured-badge { display: none; align-items: center; gap: 8px; margin-top: 10px; padding: 11px 14px; border-radius: 12px; background: var(--ok-bg); border: 1px solid var(--ok-line); font-size: 14px; color: var(--ok); }
.secure-note { text-align: center; font-size: 13px; color: var(--muted); }
.secure-note i { color: var(--green); margin-right: 5px; }

/* 23. Referral ------------------------------------------------------------- */
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 12px 12px 12px 16px; border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12);
}
.code-text { font-size: 22px; font-weight: 600; letter-spacing: .14em; }
.share-row { display: flex; gap: 10px; margin-top: 12px; }
.share-row .btn { flex: 1; min-height: 44px; font-size: 14px; }
.btn-whatsapp { background: #22c55e; color: #fff; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.stat-val { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-lbl { margin-top: 2px; font-size: 13px; color: var(--muted); }
.stat-val.is-ok { color: var(--ok); }
.stat-val.is-warn { color: var(--warn); }
.how { list-style: none; counter-reset: h; padding: 6px 18px; }
.how li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); counter-increment: h; }
.how li:last-child { border-bottom: 0; }
.how li::before {
  content: counter(h); flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-700); font-size: 13px; font-weight: 600;
}
.how-title { font-size: 15px; font-weight: 500; }
.how-text { margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* 24. Help center ---------------------------------------------------------- */
.help-hero { padding: 22px 18px; border-radius: 20px; color: #fff; background: linear-gradient(140deg, var(--brand-800), var(--brand-600)); }
.help-hero h2 { font-size: 20px; }
.help-hero p { margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.search { position: relative; margin-top: 16px; }
.search .input { padding-left: 42px; padding-right: 42px; background: #fff; border-color: transparent; }
.search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; width: 38px; height: 38px; border: 0; background: none; color: var(--faint); cursor: pointer; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.cat-card .link-row-icon { width: 36px; height: 36px; }
.cat-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.cat-count { font-size: 12px; color: var(--muted); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumb i { font-size: 9px; color: var(--faint); }
.article-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--line-2); }
.article-title { margin-top: 8px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.article-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.article-body { padding: 18px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.article-body > * + * { margin-top: 12px; }
.article-body h2, .article-body h3, .article-body h4 { color: var(--ink); margin-top: 20px; }
.article-body h2 { font-size: 18px; } .article-body h3 { font-size: 16px; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li + li { margin-top: 6px; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body img { border-radius: 12px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-body th, .article-body td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.helpful { padding: 18px; border-top: 1px solid var(--line-2); text-align: center; }
.helpful-title { font-size: 15px; font-weight: 500; }
.helpful-btns { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.helpful-thanks { display: none; font-size: 15px; color: var(--ok); }
.support-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.support-card .link-row-icon { width: 44px; height: 44px; font-size: 18px; }
.online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); }
.online::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* 25. Support chat --------------------------------------------------------- */
.chat { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); }
.chat-bar { flex-shrink: 0; }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-600); color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.chat-who { flex: 1; min-width: 0; }
.chat-name { font-size: 15px; font-weight: 600; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg-u { align-self: flex-end; align-items: flex-end; }
.msg-a, .msg-s { align-self: flex-start; }
.msg-s { align-self: center; max-width: 92%; align-items: center; }
.bub { padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; word-wrap: break-word; }
.msg-u .bub { background: var(--brand-600); color: #fff; border-bottom-right-radius: 6px; }
.msg-a .bub { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-s .bub { background: var(--brand-50); color: #1e40af; font-size: 14px; text-align: center; }
.msg-meta { margin-top: 3px; font-size: 11px; color: var(--faint); }
.agent-name { margin-bottom: 3px; font-size: 12px; font-weight: 500; color: var(--brand-700); }
.chat-input { flex-shrink: 0; padding: 10px 12px calc(10px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.chat-row { display: flex; align-items: flex-end; gap: 8px; max-width: 760px; margin: 0 auto; }
.chat-row .textarea { min-height: 46px; max-height: 110px; padding: 11px 14px; border-radius: 22px; resize: none; }
.send-btn { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 16px; cursor: pointer; }
.send-btn:disabled { opacity: .5; }
.chat-closed { text-align: center; font-size: 14px; color: var(--muted); }
.chat-closed strong { color: var(--ink); }
.chat-closed .btn { margin-top: 12px; }
.rating-card { align-self: center; width: 100%; max-width: 320px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.rating-title { font-size: 15px; font-weight: 600; }
.rating-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.stars { display: flex; justify-content: center; gap: 6px; margin: 12px 0; }
.star { border: 0; background: none; font-size: 28px; color: var(--line); cursor: pointer; }
.star.on { color: #f59e0b; }
.rate-done { font-size: 14px; color: var(--ok); }

/* 26. Legal pages (terms, privacy) ---------------------------------------- */
.legal { background: var(--canvas); line-height: 1.7; }
.legal .header { padding: 44px 22px 40px; text-align: center; color: #fff; background: linear-gradient(140deg, var(--brand-800), var(--brand-600) 60%, var(--brand-500)); }
.legal .header-logo { margin-bottom: 14px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.legal .header-logo span { color: #bfdbfe; }
.legal .header h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.legal .header p { margin-top: 6px; font-size: 15px; color: rgba(255, 255, 255, .82); }
.legal .container { max-width: 760px; margin: 0 auto; padding: 32px 20px 72px; }
.legal .last-updated { margin-bottom: 28px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal .section { margin-bottom: 32px; }
.legal h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 19px; font-weight: 600; }
.legal h2 .num { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-700); font-size: 13px; font-weight: 600; }
.legal h3 { margin: 18px 0 8px; font-size: 16px; font-weight: 600; }
.legal p { margin-bottom: 12px; font-size: 15px; color: var(--ink-2); }
.legal ul, .legal ol { margin-bottom: 12px; padding-left: 22px; }
.legal li { margin-bottom: 6px; font-size: 15px; color: var(--ink-2); }
.legal a { color: var(--brand-600); }
.legal .highlight, .legal .warning, .legal .data-kept { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid; }
.legal .highlight { background: var(--brand-50); border-color: #bfdbfe; }
.legal .highlight p { margin: 0; color: #1e40af; }
.legal .warning { background: var(--bad-bg); border-color: var(--bad-line); }
.legal .warning p { margin: 0; color: var(--bad); }
.legal .data-kept { background: var(--warn-bg); border-color: var(--warn-line); }
.legal .data-kept p, .legal .data-kept li { margin-bottom: 4px; color: #92400e; font-size: 14px; }
.legal .data-kept ul { margin: 8px 0 0; }
.legal .data-table { width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.legal .data-table th { padding: 10px 14px; background: var(--field); color: var(--ink); font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); }
.legal .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
.legal .data-table tr:last-child td { border-bottom: 0; }
.legal .rights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.legal .right-item { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.legal .right-icon { margin-bottom: 6px; font-size: 18px; }
.legal .right-title { font-size: 14px; font-weight: 600; }
.legal .right-desc { margin-top: 2px; font-size: 13px; color: var(--muted); }
.legal .contact-box { margin-top: 24px; padding: 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.legal .contact-box h3 { margin-top: 0; }
.legal .contact-box p { margin-bottom: 4px; }
.legal .deletion-card { margin-top: 18px; padding: 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.legal .deletion-steps { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.legal .deletion-step { display: flex; align-items: flex-start; gap: 14px; }
.legal .step-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-600); color: #fff; font-size: 13px; font-weight: 600; }
.legal .step-title { font-size: 15px; font-weight: 600; }
.legal .step-desc { font-size: 14px; color: var(--muted); line-height: 1.55; }
.legal .deletion-form { margin-top: 18px; padding: 20px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.legal .deletion-form h3 { margin: 0 0 14px; }
.legal .form-group { margin-bottom: 14px; }
.legal .form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.legal .form-input, .legal .form-select, .legal .form-textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; color: var(--ink); outline: none; }
.legal .form-input:focus, .legal .form-select:focus, .legal .form-textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.legal .form-textarea { min-height: 96px; resize: vertical; }
.legal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.legal .submit-btn { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--brand-600); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; }
.legal .submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.legal .success-msg { display: none; margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--ok-bg); border: 1px solid var(--ok-line); text-align: center; }
.legal .success-msg.show { display: block; }
.legal .success-msg h4 { color: var(--ok); font-size: 15px; font-weight: 600; }
.legal .success-msg p { margin: 4px 0 0; color: var(--ok); font-size: 14px; }
.legal .check-row label { cursor: pointer; }
.legal footer { padding: 24px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--muted); }
.legal .note-small { margin-top: 12px; font-size: 14px; color: var(--muted); }
.legal .note-small strong { color: var(--ink-2); }
.legal .warning a { color: inherit; font-weight: 500; }
.legal .gap-top { margin-top: 20px; }
.legal .tight-list { margin: 10px 0 16px; }
.legal .data-kept .note-small { margin: 8px 0 0; color: #92400e; font-size: 13px; }
.legal .check-row { margin-bottom: 16px; }
.legal footer a { text-decoration: none; }
@media (max-width: 480px) {
  .legal .rights-grid, .legal .form-row { grid-template-columns: 1fr; }
}

/* 27. Small screens -------------------------------------------------------- */
@media (max-width: 360px) {
  .coin-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-item { font-size: 12px; }
  .balance-amount { font-size: 28px; }
}

/* 28. Welcome page (root index.php) --------------------------------------- */
.welcome {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(520px 420px at 100% 0%, rgba(37, 99, 235, .10), transparent 70%),
    radial-gradient(360px 300px at 0% 100%, rgba(37, 99, 235, .06), transparent 70%),
    var(--surface);
}
.welcome-top { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 24px 0; }
.brand-mark--solid { background: var(--brand-600); border-color: var(--brand-600); }
.welcome-main {
  flex: 1; width: 100%; max-width: 420px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.welcome-tag {
  align-self: center; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: 13px; font-weight: 500;
}
.welcome-title {
  margin-top: 22px; font-size: clamp(32px, 9vw, 44px); font-weight: 600;
  line-height: 1.1; letter-spacing: -.035em; color: var(--ink);
}
.welcome-title span { color: var(--brand-600); }
.welcome-sub { margin: 14px auto 0; max-width: 320px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.welcome-coins { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; }
.welcome-coins li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.welcome-coins img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.welcome-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.welcome-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.welcome-stats div { display: flex; flex-direction: column-reverse; padding: 12px 6px; }
.welcome-stats div + div { border-left: 1px solid var(--line); }
.welcome-stats dd { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.welcome-stats dt { margin-top: 1px; font-size: 12px; color: var(--muted); }
.welcome-foot {
  display: flex; justify-content: center; gap: 20px;
  padding: 0 24px calc(18px + var(--safe-b));
  font-size: 13px;
}
.welcome-foot a { color: var(--muted); }

/* 29. Email verification code ---------------------------------------------- */
.code-input {
  height: 64px; text-align: center;
  font-size: 30px; font-weight: 500; letter-spacing: .5em; text-indent: .5em;
  font-variant-numeric: tabular-nums;
}
.code-input::placeholder { letter-spacing: .5em; color: var(--line); }
.resend-row { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 15px; }
.btn-link:disabled { color: var(--faint); cursor: default; }
.auth-sub strong { color: #fff; font-weight: 600; }

/* 30. iPhone "Add to Home Screen" guide ------------------------------------ */
.a2hs {
  position: fixed; z-index: 9500; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  max-width: 480px; margin: 0 auto; padding: 18px 18px 16px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
  transform: translateY(24px); opacity: 0; transition: transform .35s ease, opacity .35s ease;
}
.a2hs.show { transform: none; opacity: 1; }
.a2hs-x { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.a2hs-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 26px; }
.a2hs-head img { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.a2hs-title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.a2hs-sub { margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.a2hs-steps { list-style: none; margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: var(--field); }
.a2hs-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.a2hs-steps li + li { margin-top: 10px; }
.a2hs-steps b { font-weight: 600; color: var(--ink); }
.a2hs-n { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 600; margin-top: 0; }
.a2hs-ico { display: inline-flex; vertical-align: -3px; color: var(--brand-600); }
@media (prefers-reduced-motion: reduce) { .a2hs { transition: none; } }

/* 31. Withdrawal charges breakdown ---------------------------------------- */
#chargeHint { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.charge-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.charge-line + .charge-line { margin-top: 4px; }
.charge-total { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.sent-box { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: start; margin: 0 18px 18px; padding: 16px; border-radius: 14px; background: var(--brand-50); border: 1px solid #bfdbfe; text-align: left; }
.sent-icon { grid-row: span 1; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-600); color: #fff; font-size: 16px; }
.sent-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.sent-text { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.sent-btn { grid-column: 1 / -1; margin-top: 12px; min-height: 46px; }

/* 32. Password boxes that browsers don't offer to save or fill ---------------- */
.pw-mask { -webkit-text-security: disc; text-security: disc; }
.pw-mask.pw-shown { -webkit-text-security: none; text-security: none; }
.net-chip { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 600; vertical-align: 1px; }

/* 33. USDT network tabs ------------------------------------------------------ */
.net-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.net-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; text-align: center; }
.net-tab span { font-size: 12px; font-weight: 500; color: var(--muted); }
.net-tab.active { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); box-shadow: 0 0 0 1px var(--brand-600) inset; }
.net-tab.active span { color: var(--brand-600); }