*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --text: #1c1917;
  --text-secondary: #78716c;
  --muted: #a8a29e;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --border: #e7e5e4;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --header-bg: rgba(255,255,255,0.85);
  --header-bg-solid: #ffffff;
  --radius: 22px;
  --radius-sm: 14px;
  /* Safe area insets for notched devices */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #1e1b4b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --border: #334155;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.3);
  --header-bg: rgba(15,23,42,0.92);
  --header-bg-solid: #0f172a;
}

[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%239ca3af'/%3E%3C/svg%3E");
}

[data-theme="dark"] .tx-icon.withdraw,
[data-theme="dark"] .pending-badge {
  background: #422006;
  color: var(--warning);
}

[data-theme="dark"] .tx-icon.send {
  background: #450a0a;
  color: var(--danger);
}

/* Facebook sign-in button — removed */

[data-theme="dark"] .detail-label {
  background: #334155;
}

[data-theme="dark"] .btn-install:hover {
  background: #1e293b;
}

[data-theme="dark"] .pin-icon {
  background: #3d2e0a;
}

[data-theme="dark"] .detail-status.success {
  background: #052e16;
}

[data-theme="dark"] .detail-status.error {
  background: #450a0a;
}

[data-theme="dark"] .detail-status.pending {
  background: #422006;
  color: var(--warning);
}

[data-theme="dark"] .tx-result code {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .tx-result.success {
  background: #052e16;
  color: var(--success);
}

[data-theme="dark"] .tx-result.error {
  background: #450a0a;
  color: var(--danger);
}

html {
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  width: 100%;
  /* Prevent pull-to-refresh on mobile */
  overscroll-behavior-y: contain;
}

/* ── App Loader (splash screen) ── */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.3s ease;
}
#app-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
#app-loader.fade-out-done {
  display: none;
}
.app-loader-icon {
  width: 72px;
  height: 72px;
}
.app-loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Prevent iOS zoom on input focus */
input, textarea, select {
  font-size: 16px !important;
}

/* Prevent double-tap zoom on iOS */
a, button, input, select, textarea, [tabindex] {
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* Prevent text size adjustment on orientation change */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  /* Prevent tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
  /* Ensure proper touch behavior */
  touch-action: manipulation;
}

.hidden { display: none !important; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  /* Safe area padding for notched devices */
  padding-bottom: var(--safe-bottom);
  /* Prevent overflow */
  overflow-x: hidden;
  width: 100%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 12px calc(16px + var(--safe-left));
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  min-height: calc(44px + var(--safe-top));
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.app-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Minimum 44x44 touch target */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  /* Prevent text selection */
  -webkit-user-select: none;
  user-select: none;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h2 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* Balance Card */
.balance-card {
  position: relative;
  margin: 16px;
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px var(--border);
}

.balance-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 4px;
}

.balance-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-currency {
  font-size: 14px;
  opacity: 0.6;
  font-weight: 500;
  margin-top: 2px;
}

.balance-user {
  font-size: 13px;
  opacity: 0.7;
}

.balance-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: fit-content;
  max-width: 100%;
}

.balance-user-row:hover,
.balance-user-row:focus-visible {
  opacity: 1;
}

.balance-user-row:hover .balance-user,
.balance-user-row:focus-visible .balance-user {
  opacity: 1;
}

.balance-qr-icon {
  flex-shrink: 0;
  opacity: 0.65;
}

.balance-user-row:hover .balance-qr-icon {
  opacity: 1;
}

.balance-eye-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.balance-eye-btn:hover {
  background: var(--border);
}
.balance-add-btn {
  position: absolute;
  top: 16px;
  right: 58px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--primary-light);
  border-radius: 50%;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
}
.balance-add-btn:hover {
  filter: brightness(0.94);
}
.balance-hidden {
  filter: blur(9px);
  user-select: none;
  transition: filter 0.15s ease;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 24px;
}

.action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease-out;
  -webkit-user-select: none;
  user-select: none;
}

.action-btn:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.action-btn span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Transactions */
.transactions {
  padding: 0 16px 100px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease-out;
}

.tx-item:hover {
  border-color: var(--border);
}

.tx-item:active {
  transform: scale(0.99);
}

.tx-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

/* Settlement status dot (top-left of icon) */
.tx-icon::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--success);
}
.tx-icon[data-status="pending"]::after { background: #f59e0b; }
.tx-icon[data-status="failed"]::after,
.tx-icon[data-status="compensation_failed"]::after { background: var(--danger); }
/* No dot for tx without settlement status */
.tx-icon:not([data-status])::after,
.tx-icon[data-status=""]::after { display: none; }

.tx-icon.send { background: #fef2f2; color: var(--danger); }
.tx-icon.receive { background: #ecfdf5; color: var(--success); }
.tx-icon.fund { background: #eef2ff; color: var(--primary); }
.tx-icon.withdraw { background: #fffbeb; color: var(--warning); }

.tx-icon svg { width: 18px; height: 18px; }

.tx-details {
  flex: 1;
  min-width: 0;
}

.tx-type {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.tx-amount.positive { color: var(--success); }
.tx-amount.pending { color: #f59e0b; }
.tx-amount.negative { color: var(--danger); }

.tx-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 16px 0 8px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: contain;
}

.confirm-modal-content {
  background: var(--card);
  border-radius: 16px;
  padding: 24px 20px 20px;
  width: calc(100% - 48px);
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 95vh;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slideUp 0.2s ease-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-height: 600px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    max-height: 90vh;
    border-radius: var(--radius);
    margin: 20px;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  padding-bottom: 8px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field input,
.field select {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  transition: all 0.2s ease-out;
  outline: none;
  appearance: none;
  width: 100%;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* The .field input rule sets appearance:none, which leaves a checkbox with no
   visible control or checked state. This one must keep the native widget. */
#tx-fee-included {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  flex: 0 0 auto;
  accent-color: var(--primary);
  cursor: pointer;
}

.phone-input {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  transition: all 0.2s ease-out;
}

.phone-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.phone-prefix {
  padding: 14px 12px 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.phone-input input {
  border: none;
  border-radius: 0;
  flex: 1;
  box-shadow: none;
}

/* Inset email input with QR scan button (same pattern as phone-input) */
.email-input-qr {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  transition: all 0.2s ease-out;
}
.email-input-qr:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.email-input-qr input {
  border: none;
  border-radius: 0;
  flex: 1;
  box-shadow: none;
  background: var(--card);
  font-size: 16px;
  padding: 14px 12px;
  outline: none;
  min-width: 0;
  font-family: inherit;
}
.email-input-qr-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: background 0.2s;
  margin-right: 6px;
  border-radius: 8px;
}
.email-input-qr-btn:hover {
  background: var(--primary-light);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease-out;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Theme selector buttons */
.theme-opt {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-transform: capitalize;
}
.theme-opt:hover { border-color: var(--primary); color: var(--primary); }
.theme-sel {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.theme-sel:hover { color: #fff; }

/* Result */
.tx-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

.tx-result.success {
  background: #ecfdf5;
  color: #065f46;
}

.tx-result.error {
  background: #fef2f2;
  color: #991b1b;
}

.tx-result code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.tx-result.full {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.tx-detail {
  background: transparent;
}

.tx-detail.error {
  background: transparent;
}

.tx-detail .detail-header {
  text-align: center;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
}

.detail-amount {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail-amount.negative {
  color: var(--danger);
}

.detail-amount.positive {
  color: var(--success);
}

.detail-status {
  font-size: 16px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.detail-status.success {
  background: #ecfdf5;
  color: var(--success);
}

.detail-status.error {
  background: #fef2f2;
  color: var(--danger);
}

.detail-status.pending {
  background: #fffbeb;
  color: var(--warning);
}

.pending-badge {
  color: var(--warning);
}

.detail-settled-success {
  color: var(--success);
}

.detail-settled-pending {
  color: var(--warning);
}

.detail-settled-failed {
  color: var(--danger);
}

.detail-settled-compensation_failed {
  color: var(--danger);
}

.detail-currency {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.detail-fields {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.detail-field:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f0f1f4;
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.detail-value {
  font-size: 14px;
  overflow-wrap: break-word;
}

.detail-value.code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.spinner {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.notif-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  box-sizing: border-box;
}

.notif-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card);
  border-left: 4px solid var(--success);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  cursor: pointer;
  animation: notifSlideIn 0.3s ease-out;
}

.notif-toast-out {
  animation: notifSlideOut 0.3s ease-in forwards;
}

.notif-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-toast-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.notif-toast-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.notif-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  margin-left: 12px;
  flex-shrink: 0;
}

.notif-toast-close:hover {
  background: var(--bg);
  color: var(--text);
}

@keyframes notifSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notifSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Install Banner */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.install-banner.hidden {
  display: none;
}

.install-banner strong {
  font-weight: 600;
}

.btn-install {
  background: var(--card);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-install:hover {
  background: #f0f0f5;
}

/* View All Button */
.btn-view-all {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-view-all:hover {
  background: var(--primary-light);
}

/* Transactions Full Page */
#transactions-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

.tx-page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: calc(12px + var(--safe-top)) 16px 12px 16px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  min-height: calc(44px + var(--safe-top));
}

.tx-page-header h3 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: flex-end;
}

.tx-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tx-filter-group:first-child {
  flex: 1 1 50%;
  max-width: calc(50% - 4px);
}

.tx-filter-group:last-of-type {
  flex: 1 1 50%;
  max-width: calc(50% - 4px);
}

.tx-filter-group label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-filters input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.tx-filters input[type="date"]:focus {
  border-color: var(--primary);
}

.tx-filters select {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  outline: none;
  transition: border-color 0.15s;
  color: var(--text);
}

.tx-filters select option.merchant-option {
  font-weight: 700;
  color: var(--accent);
}

.tx-summary {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0 2px;
  min-height: 18px;
}

.tx-filters select:focus {
  border-color: var(--primary);
}

.tx-filters + .tx-list {
  padding: 12px 16px 100px;
}

.tx-filter-group {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tx-filter-group label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tx-filters input[type="date"] {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.tx-filters input[type="date"]:focus {
  border-color: var(--primary);
}

.tx-filters select {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  outline: none;
  transition: border-color 0.15s;
  color: var(--text);
}

.tx-filters select:focus {
  border-color: var(--primary);
}

.tx-filters + .tx-list {
  padding: 12px 16px 100px;
}

.btn-load-more {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px;
  padding: 12px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-load-more:hover {
  background: var(--primary-light);
}

.btn-load-more.hidden {
  display: none;
}

/* Profile Page */
#profile-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

#tx-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

#invoice-page,
#invoice-complete-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

.invoice-doc {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.invoice-doc-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.invoice-doc-qr {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}
.invoice-doc-hint {
  font-size: 12px;
  color: var(--muted);
}

.tx-page-content {
  padding: 20px 16px calc(32px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.profile-content {
  padding: 32px 16px calc(100px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Prevent horizontal overflow */
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.profile-info-list {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-value {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.profile-actions {
  width: 100%;
}

.profile-actions .profile-info-row {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-bottom: none;
  margin-bottom: 16px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 28px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--card);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}


.btn-logout {
  width: 100%;
  /* Minimum 44px height for touch target */
  padding: 16px;
  min-height: 48px;
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--danger);
  /* 16px prevents iOS zoom */
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s;
  /* Prevent text selection */
  -webkit-user-select: none;
  user-select: none;
}

.btn-logout:hover {
  background: #fef2f2;
}

/* API keys (merchant) */
.api-keys-section {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-sizing: border-box;
}
.api-keys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.api-keys-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.api-key-generate {
  border: 1.5px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
}
.api-key-generate:disabled { opacity: 0.5; cursor: default; }
.api-keys-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.api-key-new {
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  background: var(--bg);
}
.api-key-new-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.api-key-new-label {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 0 0 52px;
}
.api-key-new-value {
  flex: 1;
  font-size: 12px;
  word-break: break-all;
  padding: 6px 8px;
  background: var(--card);
  border-radius: 6px;
  color: var(--text);
}
.api-key-copy {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  flex: 0 0 auto;
}
.api-key-warn {
  font-size: 11px;
  color: var(--danger);
  margin: 0;
}
.api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.api-key-row:last-child { border-bottom: none; }
.api-key-info { min-width: 0; }
.api-key-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.api-key-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.api-key-revoke {
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  flex: 0 0 auto;
  margin-left: 10px;
}
.api-keys-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

/* Auth Page */
#auth-page {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

.auth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Prevent horizontal overflow */
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
}

.auth-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
}

.auth-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

/* Method Tiles */
.auth-tiles {
  display: flex;
  gap: 12px;
  width: 100%;
}

.auth-tile {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tile:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.auth-tile.hidden {
  display: none;
}

.auth-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-tile-icon svg {
  width: 28px;
  height: 28px;
}

.bio-icon {
  background: #eff6ff;
  color: var(--primary);
}

.pin-icon {
  background: #fefce8;
  color: var(--warning);
}

.auth-tile-label {
  font-size: 14px;
  font-weight: 600;
}

.auth-tile-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Lock Screen */
.auth-lock-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Minimum 44px height for touch target */
  padding: 16px;
  min-height: 48px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  /* 16px prevents iOS zoom */
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background 0.15s;
  /* Prevent text selection */
  -webkit-user-select: none;
  user-select: none;
}

.auth-lock-btn:hover {
  background: var(--primary-dark);
}

.auth-lock-btn.hidden {
  display: none;
}

.auth-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

/* PIN Inputs */
.pin-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
  /* Prevent overflow on small screens */
  width: 100%;
  max-width: 300px;
}

.pin-digit {
  /* Touch-friendly size */
  width: 52px;
  height: 60px;
  min-width: 44px;
  min-height: 44px;
  text-align: center;
  /* 16px prevents iOS zoom */
  font-size: 16px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  -webkit-text-security: disc;
  /* Prevent autofill styling */
  -webkit-autofill: none;
}

.pin-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.auth-pin-section {
  width: 100%;
}

.auth-error {
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  min-height: 20px;
  margin-bottom: 8px;
}
/* Unlock Form */
.unlock-form {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.unlock-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-align: center;
}

.unlock-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: all 0.2s ease-out;
  margin-bottom: 20px;
  -webkit-appearance: none;
}

.unlock-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.pin-digit {
  width: 52px;
  height: 60px;
  min-width: 44px;
  min-height: 44px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease-out;
  -webkit-text-security: disc;
}

.pin-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  transform: translateY(-1px);
}

.unlock-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.unlock-btn {
  margin-top: 24px;
}

.btn-fallback {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 12px;
}

.btn-fallback:hover {
  background: var(--bg);
  color: var(--text);
}

.unlock-footer {
  text-align: center;
  margin: 32px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-pin-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  gap: 8px;
}

.auth-setup .auth-tiles {
  flex-direction: row;
}

/* ── Responsive Breakpoints ─────────────────────────────────────── */

/* Very small screens (e.g., iPhone SE) */
@media (max-width: 360px) {
  .auth-tiles {
    flex-direction: column;
  }
  .pin-digit {
    width: 44px;
    height: 52px;
    font-size: 16px;
  }
  .balance-amount {
    font-size: 32px;
  }
  .actions {
    gap: 8px;
  }
}

/* Small screens */
@media (max-width: 400px) {
  .balance-card {
    margin: 16px 12px;
    padding: 20px;
  }
  .actions {
    padding: 0 12px;
  }
  .transactions {
    padding: 0 12px 100px;
  }
  .tx-filters {
    padding: 12px 12px;
    gap: 8px;
  }
}

/* Tablet and up */
@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius);
    max-height: 80vh;
    align-self: center;
  }
  .modal-overlay {
    align-items: center;
  }
}

/* Prevent zoom on iOS when rotating */
@media (orientation: landscape) {
  .balance-card {
    margin: 12px 16px;
    padding: 20px;
  }
  .auth-content {
    padding: 16px;
  }
}

/* ── QR Scanner Modal ─────────────────────────────────────────── */
.qr-scanner-overlay {
  background: #000;
  z-index: 200;
  align-items: flex-start;
  padding: 0;
  padding-top: var(--safe-top);
}
.qr-scanner-content {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}
.qr-scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  color: #fff;
}
.qr-scanner-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.qr-scanner-header .icon-btn {
  color: #fff;
}
.qr-reader {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 8px 0;
}
.qr-reader video {
  border-radius: var(--radius);
}
.qr-scanner-hint {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 12px;
}

/* ── My QR Code (Profile) ─────────────────────────────────────── */
.profile-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile-qr-section #my-qr-code {
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-qr-section #my-qr-code img,
.profile-qr-section #my-qr-code canvas {
  display: block;
}
#qr-pay-code {
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qr-center-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
  pointer-events: none;
  z-index: 1;
}
.profile-qr-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── QR Inline Button (in input) ──────────────────────────────── */
.input-with-btn {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}
.input-with-btn input {
  flex: 1 !important;
  width: auto !important;
}
.qr-inline-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border: none !important;
  background: var(--primary-light) !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--primary) !important;
  transition: background 0.2s !important;
  padding: 0 !important;
  margin: 0 !important;
}
.qr-inline-btn:hover {
  background: #c7d2fe;
}

/* ── Input shake animation ────────────────────────────────────── */
.input-shake {
  animation: inputShake 0.4s ease;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Transactions refresh button ──────────────────────────────── */
.tx-refresh-btn {
  color: var(--text-secondary);
}
.tx-refresh-btn:hover {
  color: var(--primary);
}

/* ── Enable Biometrics Button ─────────────────────────────────── */
.btn-enable-bio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  text-align: left;
}
.btn-enable-bio:hover {
  opacity: 0.8;
}

/* ── Recipient Chip (scanned QR) ─────────────────────────────── */
.recipient-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  margin-top: 6px;
  width: 100%;
}
.recipient-chip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.recipient-chip-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipient-chip-email {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipient-chip-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.recipient-chip-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ── Notes textarea ─────────────────────────────────────────── */
#tx-notes {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  resize: vertical;
  min-height: 60px;
}
#tx-notes:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Notes in detail view ───────────────────────────────────── */
.notes-field .detail-value {
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── Software Info in Profile ─────────────────────────────────── */
.profile-software-info {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
}

.profile-software-info #version-string {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

/* ── Step Indicator ───────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 20px;
  margin: 0 16px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15);
}

.step.completed .step-circle {
  background: var(--success, #4CAF50);
  border-color: var(--success, #4CAF50);
  color: white;
}

.step-label {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step.completed .step-label {
  color: var(--success, #4CAF50);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  margin-bottom: 24px;
  transition: background 0.3s ease;
}

.step-line.completed {
  background: var(--success, #4CAF50);
}

/* ── Stripe Card Element ── */
.stripe-card-field {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color 0.2s ease;
}

.stripe-card-field.StripeElement--focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.stripe-card-field.StripeElement--invalid {
  border-color: var(--danger);
}

.stripe-card-errors {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 8px;
  min-height: 20px;
}

.orange-iframe {
  width: 100%;
  min-height: 70vh;
  border: none;
  border-radius: 10px;
  background: #f5f5f5;
}

.stripe-card-errors {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-top: 4px;
}

.lang-switcher {
  display: flex;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.lang-btn {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.lang-btn:hover { color: var(--primary); background: var(--bg); }
.lang-btn.lang-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

#register-page .auth-content {
  max-width: 480px;
  padding: 24px 8px;
}
@media (min-width: 600px) {
  #register-page .auth-content {
    max-width: 640px;
    padding: 24px 16px;
  }
}
