:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --ink: #202228;
  --muted: #777b84;
  --subtle: #a4a8b0;
  --line: #ebedf0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #0a9b68;
  --green-soft: #ecf9f4;
  --red: #d14343;
  --red-soft: #fff1f1;
  --shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

html,
body {
  background: var(--bg);
}

body {
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 2px;
}

.topbar {
  backdrop-filter: none;
  background: rgba(255, 255, 255, .98);
  border-bottom-color: var(--line);
}

.topbar-inner {
  height: 58px;
  max-width: 520px;
  padding: 0 20px;
}

.orders-link {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #41454e;
  height: 36px;
}

main {
  max-width: 520px;
  padding: 28px 20px max(72px, env(safe-area-inset-bottom));
}

.page-loading,
.page-error,
.page-auth {
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  min-height: 320px;
}

.page-intro {
  padding: 6px 2px 22px;
}

.page-intro h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.2;
  margin: 0;
}

.page-intro p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  margin: 9px 0 0;
}

.benefit-summary {
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  padding: 21px 20px;
}

.benefit-item {
  min-width: 0;
}

.benefit-item:first-child {
  padding-right: 18px;
}

.benefit-item:last-child {
  padding-left: 18px;
}

.benefit-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.benefit-item strong {
  color: var(--ink);
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -.035em;
  margin-top: 8px;
}

.benefit-divider {
  background: var(--line);
  width: 1px;
}

.invite-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
  margin-top: 14px;
  padding: 20px;
}

.invite-box h2,
.section-title h2 {
  color: var(--ink);
  font-size: 19px;
  font-weight: 820;
  letter-spacing: -.035em;
  margin: 0;
}

.section-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 7px 0 0;
}

.invite-link {
  background: #f7f8fa;
  border-color: #ebeef2;
  border-radius: 13px;
  margin-top: 17px;
  min-height: 52px;
}

.invite-link input {
  color: #5a5f69;
  font-size: 12px;
}

.icon-action {
  border-color: #e3e6eb;
  color: #363a43;
}

.share-button {
  background: var(--ink);
  border-radius: 13px;
  box-shadow: none;
  height: 50px;
}

.share-button:hover {
  background: #111319;
}

.section {
  margin-top: 30px;
}

.section-title {
  align-items: center;
  margin: 0 2px 12px;
}

.section-title p {
  color: var(--subtle);
  font-size: 11px;
}

.stat-grid {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: block;
  overflow: hidden;
}

.stat-card {
  align-items: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 18px;
}

.stat-card + .stat-card {
  border-top: 1px solid #f0f1f3;
}

.stat-card span {
  color: #5f646d;
  font-size: 13px;
  font-weight: 680;
}

.stat-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.wallet-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.wallet-balance {
  background: var(--card);
  border-bottom: 1px solid #f0f1f3;
  padding: 23px 20px;
}

.wallet-balance span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-balance strong {
  color: var(--ink);
  font-size: 31px;
  margin-top: 7px;
}

.wallet-content {
  padding: 19px 20px 21px;
}

.account-row {
  background: #f8f9fa;
  border-color: #eceef1;
  border-radius: 13px;
  min-height: 60px;
}

.account-row-main {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
  text-align: left;
}

.account-row-copy {
  min-width: 0;
}

.account-row strong {
  align-items: baseline;
  color: #292d35;
  display: flex;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 2px 7px;
  overflow-wrap: anywhere;
}

.account-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
}

.account-row small {
  color: var(--muted);
}

.bank-icon {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 50%;
  flex: 0 0 auto;
  height: 30px;
  object-fit: contain;
  padding: 4px;
  width: 30px;
}

.withdraw-form {
  margin-top: 16px;
}

.money-input {
  border-color: #dfe3e8;
  border-radius: 13px;
  height: 54px;
}

.money-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.money-input input:focus,
.money-input input:focus-visible {
  border-radius: 11px;
  box-shadow: none;
  outline: none;
}

.all-balance {
  background: #f2f5fa;
  color: #4e5968;
}

.primary-button {
  background: var(--blue);
  border-radius: 13px;
  min-height: 50px;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.history-item {
  min-height: 68px;
}

.history-icon {
  background: #f2f5fa;
  color: #4e5968;
}

.notice {
  margin-top: 14px;
}

.modal-layer {
  background: rgba(27, 31, 39, .46);
  backdrop-filter: blur(3px);
}

.modal {
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  max-width: 420px;
  padding: 24px;
}

.modal-close {
  background: #f3f4f6;
  color: #545963;
}

.modal h2 {
  font-size: 22px;
  font-weight: 850;
}

.field {
  color: #343943;
  font-size: 12px;
  font-weight: 750;
  gap: 8px;
}

.field input {
  border-color: #dfe3e8;
  border-radius: 13px;
  height: 54px;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.bank-picker-trigger {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 13px;
  color: var(--ink);
  display: flex;
  height: 54px;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
  width: 100%;
}

.bank-picker-trigger:hover {
  border-color: #cdd3dc;
}

.bank-picker-trigger[aria-expanded="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.bank-picker-trigger > svg {
  color: #7f8490;
  height: 22px;
  width: 22px;
}

.bank-picker-value {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 720;
  gap: 11px;
  min-width: 0;
}

.bank-picker-value .bank-icon {
  height: 29px;
  width: 29px;
}

.bank-picker-layer {
  align-items: center;
  background: rgba(27, 31, 39, .5);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 16px;
  pointer-events: none;
  position: fixed;
  transition: opacity .16s ease;
  z-index: 10030;
}

.bank-picker-layer.open {
  opacity: 1;
  pointer-events: auto;
}

.bank-picker-sheet {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
  max-height: min(720px, calc(100dvh - 32px));
  max-width: 420px;
  overflow: hidden;
  transform: translateY(12px) scale(.99);
  transition: transform .16s ease;
  width: 100%;
}

.bank-picker-layer.open .bank-picker-sheet {
  transform: none;
}

.bank-picker-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 18px 0 20px;
}

.bank-picker-header h2 {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.03em;
  margin: 0;
}

.bank-picker-close {
  align-items: center;
  background: #f3f4f6;
  border-radius: 50%;
  color: #5a5f68;
  display: inline-flex;
  font-size: 21px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.bank-list {
  max-height: calc(min(720px, 100dvh - 32px) - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px 12px;
}

.bank-option {
  align-items: center;
  background: #fff;
  border-radius: 12px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  min-height: 56px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

.bank-option:hover,
.bank-option.active {
  background: #f6f8fb;
}

.bank-option .bank-icon {
  height: 34px;
  width: 34px;
}

.bank-option-name {
  font-size: 14px;
  font-weight: 720;
}

.bank-option-check {
  color: var(--blue);
  font-size: 19px;
  font-weight: 900;
  opacity: 0;
  text-align: center;
}

.bank-option[aria-selected="true"] .bank-option-check {
  opacity: 1;
}

@media (max-width: 560px) {
  .topbar-inner {
    height: 56px;
    padding: 0 18px;
  }

  main {
    padding: 24px 16px max(68px, env(safe-area-inset-bottom));
  }

  .page-intro {
    padding-left: 2px;
    padding-right: 2px;
  }

  .page-intro h1 {
    font-size: 28px;
  }

  .benefit-summary {
    padding: 19px 17px;
  }

  .benefit-item:first-child {
    padding-right: 14px;
  }

  .benefit-item:last-child {
    padding-left: 14px;
  }

  .benefit-item strong {
    font-size: 20px;
  }

  .invite-box {
    padding: 18px;
  }

  .stat-grid {
    display: block;
  }

  .stat-card:last-child {
    grid-column: auto;
  }

  .wallet-balance,
  .wallet-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal {
    border-radius: 21px;
    max-height: calc(100dvh - 24px);
    padding: 22px 19px;
  }

  .bank-picker-layer {
    align-items: flex-end;
    padding: 0;
  }

  .bank-picker-sheet {
    border-radius: 22px 22px 0 0;
    max-height: min(78dvh, 720px);
    max-width: none;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
  }

  .bank-list {
    max-height: calc(min(78dvh, 720px) - 64px - env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bank-picker-layer,
  .bank-picker-sheet {
    transition: none;
  }
}
