/* The wallet has no header row, so the balance card would sit flush against the
   top of the viewport (under Telegram's bar) — give it the same top breathing
   room the other screens get from their headers. */
.wallet-screen { padding-top: 16px; }

.wallet-screen .balance-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-3xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
}
.wallet-screen .balance-card .head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.wallet-screen .balance-card .amount {
  font-size: 28px;
  font-weight: 700;
  text-align: start;
}
.wallet-screen .balance-card .amount small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-inline-end: 4px;
}
.wallet-screen .balance-card .btns {
  display: flex;
  gap: 12px;
}
.wallet-screen .balance-card .btns button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
}
.wallet-screen .balance-card .btns .primary { background: var(--accent); color: var(--on-accent); }
.wallet-screen .balance-card .btns .secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
}
.tx-header .title { font-weight: 700; font-size: 16px; }
.tx-header .see-all { font-size: 12px; color: var(--accent); }

/* The recent-activity list + rows (transactions and recharge invoices alike)
   are styled by the shared css/activity.css (.activity-list / .activity-row). */

/* ============ Wallet recharge flow ============ */
/* --- bottom-sheet steps (amount -> method -> currency) --- */
.recharge { display: flex; flex-direction: column; gap: 16px; }
.recharge .title { font-size: 17px; font-weight: 700; text-align: center; }
.recharge .sub { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: -10px; }
.recharge .hint { font-size: 11px; color: var(--text-muted); text-align: center; }

.rc-balance {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 6px 14px;
  font-size: 12px; color: var(--text-secondary);
}
.rc-balance b { color: var(--text-primary); font-weight: 700; }

.rc-amount-field {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px 16px;
}
.rc-amount-field input {
  width: 100%; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--text-primary); font-family: inherit;
  font-size: 30px; font-weight: 800; text-align: center; direction: ltr;
}
.rc-amount-field input::placeholder { color: var(--text-muted); font-weight: 700; }
.rc-amount-field .unit { font-size: 14px; color: var(--text-secondary); font-weight: 600; flex-shrink: 0; }

.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rc-chips button {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 8px 14px;
  font-size: 12px; color: var(--text-primary); font-family: inherit;
}
.rc-chips button:hover { border-color: var(--accent); color: var(--accent); }

/* option cards reused for both method and currency choice */
.rc-option {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 14px;
  color: var(--text-primary); font-family: inherit; text-align: start;
  transition: border-color .15s ease, transform .08s ease;
}
.rc-option:hover { border-color: var(--accent); }
.rc-option:active { transform: scale(.99); }
.rc-option .ic {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
}
.rc-option .ic svg { width: 22px; height: 22px; }
.rc-option .ic.swap { background: rgba(255, 106, 0, .14); color: var(--accent); }
.rc-option .ic.crypto { background: rgba(56, 132, 255, .16); color: #5aa0ff; }
.rc-option .ic.voucher { background: rgba(34, 197, 94, .16); color: var(--success); }
.rc-option .ic.coin { background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 800; }
.rc-option .body { flex: 1; min-width: 0; }
.rc-option .body .t { display: block; font-size: 14px; font-weight: 600; }
.rc-option .body .d { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.rc-option .chev { color: var(--text-muted); flex-shrink: 0; }
.rc-option .chev svg { width: 16px; height: 16px; }
/* the 'back' glyph points left (correct "forward" in RTL); flip it for LTR */
[dir="ltr"] .rc-option .chev { transform: scaleX(-1); }

.rc-ghost {
  background: transparent; color: var(--text-secondary);
  padding: 10px; text-align: center; font-size: 13px; font-family: inherit;
}

/* --- full-screen invoice --- */
.invoice-screen {
  position: fixed; inset: 0; z-index: 120;
  background: radial-gradient(125% 55% at 50% 0%, #1a1410 0%, var(--bg) 58%);
  display: flex; justify-content: center;
  animation: sheet-fade .2s ease-out;
}
.invoice-screen .inv-col { width: 100%; max-width: 390px; height: 100%; display: flex; flex-direction: column; }

.inv-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.inv-header .title { font-size: 15px; font-weight: 700; }
.inv-back, .inv-header .spacer {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-primary);
}
.inv-header .spacer { background: transparent; border: 0; }
.inv-back svg { width: 18px; height: 18px; }

.inv-body {
  flex: 1; overflow-y: auto;
  padding: 4px 18px 18px;
  display: flex; flex-direction: column; gap: 16px;
}

.inv-status {
  align-self: center; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--warning);
  background: rgba(245, 158, 11, .12); border-radius: var(--radius-full); padding: 6px 13px;
}
.inv-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); animation: inv-pulse 1.4s infinite; }
@keyframes inv-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.inv-hero { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.inv-hero .amt { font-size: 34px; font-weight: 800; direction: ltr; letter-spacing: -.01em; }
.inv-hero .amt small { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-inline-start: 5px; }
.inv-hero .approx { font-size: 12px; color: var(--text-muted); direction: ltr; }

.inv-qr {
  background: #fff; border-radius: var(--radius-xl); padding: 12px;
  width: 188px; height: 188px; align-self: center;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.inv-qr svg { width: 100%; height: 100%; display: block; }

.inv-field { display: flex; flex-direction: column; gap: 6px; }
.inv-field .lbl { font-size: 11px; color: var(--text-muted); text-align: start; }
.inv-addr { display: flex; gap: 8px; align-items: stretch; }
.inv-addr code {
  flex: 1; font-family: monospace; font-size: 12px; word-break: break-all;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 11px 12px; color: var(--text-primary); direction: ltr; text-align: start;
}
.inv-addr button {
  flex-shrink: 0; width: 48px; background: var(--accent-soft);
  border: 1px solid transparent; border-radius: var(--radius-lg);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.inv-addr button svg { width: 18px; height: 18px; }

.inv-meta { display: flex; gap: 8px; }
.inv-chip {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px; text-align: center;
}
.inv-chip .k { font-size: 10px; color: var(--text-muted); }
.inv-chip .v { font-size: 13px; font-weight: 700; margin-top: 3px; }

.inv-memo {
  font-size: 12px; color: var(--warning);
  background: rgba(245, 158, 11, .1); border-radius: var(--radius-lg);
  padding: 10px 12px; text-align: center;
}

.inv-timer { display: flex; flex-direction: column; gap: 7px; }
.inv-timer .bar { height: 6px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.inv-timer .bar > span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-full); transition: width 1s linear;
}
.inv-timer.expired .bar > span { background: var(--danger); }
.inv-timer .lbl { font-size: 12px; color: var(--text-secondary); text-align: center; font-weight: 600; }

.inv-note { font-size: 11px; color: var(--text-muted); text-align: center; line-height: 1.7; }
.inv-tutorial { align-self: center; font-size: 12px; color: var(--accent); text-decoration: underline; }

.inv-actions { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.inv-ghost { background: transparent; color: var(--text-secondary); padding: 10px; text-align: center; font-size: 13px; font-family: inherit; }

/* paid success */
.inv-paid { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0; text-align: center; margin: auto 0; }
.inv-paid .check {
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(34, 197, 94, .15); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  animation: inv-pop .35s cubic-bezier(.34, 1.56, .64, 1);
}
.inv-paid .check svg { width: 38px; height: 38px; }
@keyframes inv-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.inv-paid .t { font-size: 19px; font-weight: 700; }
.inv-paid .d { font-size: 13px; color: var(--text-secondary); }
