@font-face {
  font-family: "SF Pro";
  src: url("/static/assets/font/sf-pro.ttf") format("truetype");
  font-style: normal;
  font-display: swap;
}

:root {
  --app-shell-max-width: 430px;
  --app-shell-min-width: 372px;
  --bg: #ffffff;
  --text: #0e0c0c;
  --muted: #9f9f9f;
  --panel: #f2f2f2;
  --stroke: #f2f2f2;
  --success: #2ec034;
  --success-bg: #e4ffe5;
  --danger: #e12a2a;
  --danger-bg: #ffe4e4;
  --warning: #f39511;
  --warning-bg: #fff1e4;
  --black: #0e0c0c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  display: flex;
  justify-content: center;
  font-synthesis: none;
  font-optical-sizing: none;
}

img,
svg {
  display: block;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(var(--app-shell-max-width), 100%);
  max-width: var(--app-shell-max-width);
  min-width: min(var(--app-shell-min-width), 100%);
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.content-root,
.screen {
  min-height: 100dvh;
}

.screen-enter {
  animation: screen-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-body {
  padding: max(16px, env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: grid;
  gap: 24px;
}

.onboarding-copy {
  display: grid;
  gap: 8px;
}

.onboarding-copy h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.onboarding-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--muted);
}

.onboarding-copy b {
  color: var(--text);
  font-weight: 600;
}

.card-panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.card-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 342 / 208;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay {
  position: absolute;
  inset: 0;
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-brand {
  max-width: 120px;
  width: 120px;
  height: 40px;
  overflow: hidden;
}

.card-brand img {
  width: 100%;
  height: auto;
  transform: translate(-22px, -18px);
}

.card-eye {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.card-eye svg {
  width: 30px;
  height: 30px;
}

.card-number-wrap {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-number {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
  flex-wrap: nowrap;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 2px 2px rgba(0, 0, 0, 0.5),
    0 4px 4px rgba(0, 0, 0, 0.5),
    0 8px 10px rgba(0, 0, 0, 0.5);
}

.card-number.is-masked {
  opacity: 0.95;
}

.card-number.is-revealed {
  font-size: 20px;
  font-weight: 800;
}

.card-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.card-group-fixed {
  width: 4ch;
  flex: 0 0 4ch;
}

.card-group-dots {
  justify-content: space-between;
  transform: translateY(1px);
}

.card-group-tail {
  justify-content: flex-start;
  transform: translateY(0);
}

.card-group-digits {
  justify-content: flex-start;
}

.card-number-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 2px rgba(0, 0, 0, 0.5),
    0 4px 4px rgba(0, 0, 0, 0.5),
    0 8px 10px rgba(0, 0, 0, 0.45);
}

.card-copy {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-copy svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-copy-pan {
  width: 22px;
  height: 22px;
}

.card-copy-meta {
  width: 18px;
  height: 18px;
}

.card-copy-meta svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.card-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.card-meta-group {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  text-shadow:
    0 2px 2px rgba(0, 0, 0, 0.6),
    0 4px 4px rgba(0, 0, 0, 0.6);
  text-transform: none;
}

.card-meta-item small {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
}

.balance-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--stroke);
  padding: 10px;
  border-radius: 16px;
  transition: border-color 240ms ease, box-shadow 240ms ease, background-color 240ms ease;
}

.balance-tile-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.balance-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e7e7e7;
  background: #f7f7f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}

.balance-icon svg {
  width: 18px;
  height: 18px;
  stroke: #8e8e8e;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.balance-label {
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
}

.balance-sub {
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: var(--muted);
}

.balance-value-wrap {
  text-align: right;
}

.balance-value {
  display: inline-block;
  font-size: 18px;
  line-height: 22px;
  font-weight: 600;
  white-space: nowrap;
  transform-origin: right center;
}

.balance-tile.is-pulse-up {
  animation: balance-tile-pulse-up 1150ms ease;
}

.balance-tile.is-pulse-down {
  animation: balance-tile-pulse-down 1150ms ease;
}

.balance-value.is-pulse-up {
  animation: balance-value-pulse-up 1150ms ease;
  color: #20a642;
}

.balance-value.is-pulse-down {
  animation: balance-value-pulse-down 1150ms ease;
  color: #d04444;
}

.balance-status {
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: var(--success);
  text-transform: capitalize;
}

@keyframes balance-tile-pulse-up {
  0% {
    border-color: var(--stroke);
    box-shadow: none;
    background: #fff;
  }
  28% {
    border-color: rgba(46, 192, 52, 0.46);
    box-shadow: 0 0 0 3px rgba(46, 192, 52, 0.18);
    background: #f7fff8;
  }
  100% {
    border-color: var(--stroke);
    box-shadow: none;
    background: #fff;
  }
}

@keyframes balance-tile-pulse-down {
  0% {
    border-color: var(--stroke);
    box-shadow: none;
    background: #fff;
  }
  28% {
    border-color: rgba(225, 42, 42, 0.4);
    box-shadow: 0 0 0 3px rgba(225, 42, 42, 0.14);
    background: #fff7f7;
  }
  100% {
    border-color: var(--stroke);
    box-shadow: none;
    background: #fff;
  }
}

@keyframes balance-value-pulse-up {
  0% {
    transform: scale(1);
  }
  24% {
    transform: scale(1.09);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes balance-value-pulse-down {
  0% {
    transform: scale(1);
  }
  24% {
    transform: scale(1.09);
  }
  100% {
    transform: scale(1);
  }
}

.primary-btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--black);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
}

.primary-btn-link {
  text-decoration: none;
}

.primary-btn[disabled] {
  opacity: 0.58;
  cursor: default;
}

.primary-btn.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}

.primary-btn svg,
.history-download svg,
.modal-note svg,
.modal-confirm svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-section {
  display: grid;
  gap: 16px;
}

.wallet-title {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: var(--muted);
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.wallet-card {
  min-height: 103px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  padding: 12px;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
}

.wallet-card span {
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
}

.wallet-logo-apple,
.wallet-logo-google {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wallet-logo-google img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.wallet-logo-apple img {
  width: 37px;
  height: 36px;
  object-fit: contain;
}

.history-section {
  background: #f7f7f7;
  border: 1px solid var(--stroke);
  border-radius: 30px;
  padding: 12px;
  display: grid;
  gap: 16px;
}

.history-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-headline h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.history-download {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--black);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 34px;
}

.history-download.loading svg {
  animation: spin 800ms linear infinite;
}

.tx-list {
  display: grid;
  gap: 8px;
}

.tx-load-trigger {
  width: 100%;
  height: 1px;
}

.tx-loading-more {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid #ececec;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #8d8d8d;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
}

.tx-loading-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-top-color: rgba(0, 0, 0, 0.62);
  animation: spin 800ms linear infinite;
}

.tx-item {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #f2f2f2;
  overflow: hidden;
}

.tx-main {
  padding: 10px 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-main-content {
  width: 100%;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}

.tx-icon svg {
  width: 20px;
  height: 20px;
  stroke: #0e0c0c;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tx-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tx-left {
  min-width: 0;
}

.tx-title {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: #0e0c0c;
}

.tx-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: var(--muted);
}

.tx-amount {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  color: #0e0c0c;
  white-space: nowrap;
}

.tx-type {
  margin: 0;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
}

.tx-divider {
  border-top: 1px dashed #f2f2f2;
  margin: 0;
  width: 100%;
}

.tx-row-bottom {
  padding: 8px 10px 10px;
}

.tx-status {
  display: inline-block;
  border-radius: 111px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
}

.tx-status.success {
  color: var(--success);
  background: var(--success-bg);
}

.tx-status.failed {
  color: var(--danger);
  background: var(--danger-bg);
}

.tx-status.pending {
  color: var(--warning);
  background: #fff4dc;
}

.tx-status.neutral {
  color: #6f6f6f;
  background: #efefef;
}

.tx-empty {
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 28px 14px;
}

.export-link {
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.export-link-title {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.export-link a {
  color: #1b64d8;
  font-size: 12px;
  text-decoration: underline;
  line-height: 1.35;
  word-break: break-all;
}

.export-link small {
  color: var(--muted);
  font-size: 11px;
}

.pull-refresh {
  --shift: 0px;
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 8px);
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e6e6e6;
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(1.5px);
  transform: translate(-50%, calc(-42px + var(--shift)));
  opacity: 0;
  pointer-events: none;
  z-index: 75;
  transition: opacity 160ms ease, transform 180ms ease, color 160ms ease, border-color 160ms ease;
}

.pull-refresh.visible {
  opacity: 1;
}

.pull-refresh.ready {
  border-color: #d7d7d7;
  color: #1f1f1f;
}

.pull-refresh.refreshing {
  border-color: #d2d2d2;
  color: #111;
}

.pull-refresh-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.16);
  border-top-color: rgba(0, 0, 0, 0.52);
}

.pull-refresh.ready .pull-refresh-spinner {
  border-top-color: rgba(0, 0, 0, 0.7);
}

.pull-refresh.refreshing .pull-refresh-spinner {
  border-top-color: rgba(0, 0, 0, 0.82);
  animation: spin 700ms linear infinite;
}

.status {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%) translateY(-12px);
  width: min(358px, calc(100vw - 24px));
  border-radius: 14px;
  background: rgba(14, 12, 12, 0.95);
  color: #fff;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.35;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.status.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.status.ok {
  background: rgba(27, 116, 37, 0.95);
}

.status.err {
  background: rgba(153, 27, 27, 0.95);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.modal-sheet {
  position: relative;
  width: min(var(--app-shell-max-width), 100%);
  border-radius: 32px 32px 0 0;
  background: #fff;
  padding: 36px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}

.modal-handle {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 4px;
  border-radius: 111px;
  background: #f2f2f2;
}

.modal-fields {
  display: grid;
  gap: 14px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 13px;
  border: 2px solid #f2f2f2;
  color: #0e0c0c;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.modal-input::placeholder {
  color: #a2acb0;
}

.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.modal-row span {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--muted);
}

.modal-row b {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: #0e0c0c;
  white-space: nowrap;
}

.modal-warning {
  min-height: 16px;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.3;
}

.modal-confirm {
  border-radius: 16px;
}

.modal-note {
  margin: 0;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 500;
}

.modal-note svg {
  flex: 0 0 20px;
  margin-top: 1px;
}

.modal-nav {
  height: 14px;
  display: grid;
  place-items: center;
}

.phone-nav-handle {
  width: 108px;
  height: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.9);
}

.modal-layer.open .modal-overlay {
  animation: modal-fade-in 220ms ease-out both;
}

.modal-layer.open .modal-sheet {
  animation: modal-up 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-layer.closing .modal-overlay {
  animation: modal-fade-out 200ms ease-in both;
}

.modal-layer.closing .modal-sheet {
  animation: modal-down 200ms ease-in both;
}

@keyframes modal-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes modal-down {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .pull-refresh,
  .status {
    transition: none;
  }

  .pull-refresh.refreshing .pull-refresh-spinner {
    animation: none;
  }

  .balance-tile.is-pulse-up,
  .balance-tile.is-pulse-down,
  .balance-value.is-pulse-up,
  .balance-value.is-pulse-down {
    animation: none;
  }
}

@media (max-width: 374px) {
  .screen-body {
    gap: 18px;
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .card-number {
    font-size: 19px;
    gap: 8px;
  }

  .card-group {
    gap: 4px;
  }

  .card-number-dot {
    width: 10px;
    height: 10px;
  }

  .history-headline h2 {
    font-size: 18px;
  }

  .wallet-card span {
    font-size: 14px;
  }
}

@media (max-width: 385px) {
  .card-number-wrap {
    top: 90px;
  }

  .card-number {
    font-size: 19px;
    gap: 8px;
  }

  .card-number.is-revealed {
    font-size: 18px;
    font-weight: 700;
  }

  .card-group {
    gap: 4px;
  }

  .card-number-dot {
    width: 9px;
    height: 9px;
  }

  .balance-label {
    font-size: 14px;
    line-height: 20px;
  }

  .balance-value {
    font-size: 17px;
    line-height: 20px;
  }

  .tx-title,
  .tx-amount {
    font-size: 14px;
    line-height: 20px;
  }
}
