:root {
  --bg: #000000;
  --card: #161616;
  --card-border: #2a2a2a;
  --selected: #fe2c55;
  --text: #ffffff;
  --muted: #8b8b8b;
  --price: #a3a3a3;
  --field: #121212;
  --success: #22c55e;
  --danger: #ff3b5c;
  --radius: 8px;
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input,
button {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 0;
  position: relative;
}

.header {
  position: relative;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

.icon-btn--left {
  left: 8px;
  right: auto;
}

.balance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 16px 14px;
}

.live-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  border: 1.5px solid #3a3a3a;
  flex-shrink: 0;
}

.balance-copy {
  min-width: 0;
}

.live-handle {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
}

.balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
}

.live-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
}

.live-preview img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
}

.live-preview strong {
  display: block;
  font-size: 14px;
}

.live-preview span {
  color: #8d8d8d;
  font-size: 12px;
}

.field-hint {
  font-size: 12px;
  color: #8b8b8b;
  line-height: 1.4;
  margin: -6px 0 14px;
}

.balance strong {
  font-weight: 700;
  font-size: 16px;
}

.coin-img {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.recipient-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  margin-right: 8px;
  flex-shrink: 0;
}

.user-form {
  margin: 0;
}

.autofill-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.user-field {
  display: flex;
  align-items: center;
  margin: 0 16px 8px;
  height: 44px;
  background: var(--field);
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  padding: 0 14px;
  transition: border-color 0.15s ease;
}

.user-field:focus-within {
  border-color: var(--selected);
}

.user-field.is-error {
  border-color: var(--danger);
  animation: shake 0.38s ease;
}

.user-field__at {
  color: #8e8e8e;
  font-size: 16px;
  font-weight: 600;
  margin-right: 6px;
}

.user-field input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}

.user-field input::placeholder {
  color: #6d6d6d;
  font-weight: 400;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  padding: 0 18px 10px;
}

.save-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 2px;
  color: #c45c63;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.save-note__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #8a8a8a;
  border-radius: 50%;
  color: #8a8a8a;
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  flex-shrink: 0;
  line-height: 1;
}

.packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 16px 150px;
}

.package {
  appearance: none;
  border: 1.5px solid var(--card-border);
  background: var(--card);
  border-radius: var(--radius);
  min-height: 92px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.package .coin-img {
  width: 18px;
  height: 18px;
  margin-bottom: 2px;
}

.package.is-selected {
  border-color: var(--selected);
  background: #1a1014;
}

.package__top {
  display: flex;
  align-items: center;
  gap: 5px;
}

.package__top .coin-img {
  width: 16px;
  height: 16px;
}

.package__amount {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.package__price {
  font-size: 12px;
  color: var(--price);
  font-weight: 500;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.total-row span {
  color: #fff;
}

.total-row strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
}

.total-row .coin-img {
  width: 18px;
  height: 18px;
}

.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 18px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, #000 82%, transparent);
}

.btn-primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--selected);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:active {
  transform: scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn-primary .mini-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 24px 18px;
  z-index: 80;
}

.overlay[hidden] {
  display: none !important;
}

.overlay.is-open {
  display: grid !important;
}

.process-card {
  width: 86%;
  max-width: 340px;
  background: #fff;
  color: #111;
  border-radius: 18px;
  padding: 32px 26px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.process-card h2 {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 800;
  color: #111;
}

.loading-card {
  width: 100%;
  max-width: 320px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 28px 22px 24px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #2a2a2a;
  border-top-color: var(--selected);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-title {
  font-size: 16px;
  font-weight: 700;
}

.loading-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.found-user {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #1c1c1c;
  border-radius: 12px;
  padding: 10px 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fe2c55, #ff7a45);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.found-user__name {
  font-size: 14px;
  font-weight: 700;
}

.found-user__status {
  font-size: 12px;
  color: var(--success);
  margin-top: 2px;
}

.success-card {
  width: 86%;
  max-width: 340px;
  background: #fff;
  color: #111;
  border-radius: 22px;
  padding: 28px 20px 16px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  animation: pop 0.45s ease;
}

.success-icon svg {
  width: 64px;
  height: 64px;
}

.success-card h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #111;
}

.success-lead {
  margin-top: 8px;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.success-note {
  margin-top: 8px;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.receipt {
  width: 100%;
  margin: 18px 0 14px;
  background: #f3f3f3;
  border: 0;
  border-radius: 14px;
  padding: 4px 16px;
  text-align: left;
}

.receipt__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid #e6e6e6;
  font-size: 14px;
}

.receipt__row:last-child {
  border-bottom: 0;
}

.receipt__row span {
  color: #333;
  font-weight: 500;
}

.receipt__row strong {
  font-weight: 700;
  color: #111;
}

.status-ok {
  color: var(--success) !important;
}

.success-card .btn-primary {
  margin-top: 4px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  max-width: 430px;
  margin: 0 auto;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
}

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a1a1a;
  border-radius: 16px 16px 0 0;
  padding: 10px 20px calc(var(--safe-bottom) + 8px);
  animation: slide-up 0.28s ease;
}

.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: #3a3a3a;
  margin: 4px auto 16px;
}

.sheet__panel h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.sheet__panel p {
  color: #b3b3b3;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.sheet__panel .btn-primary {
  margin-top: 12px;
}

.view--auth {
  justify-content: center;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(254, 44, 85, 0.18), transparent 52%),
    #000;
}

.auth-card {
  width: 100%;
  padding: 28px 22px 36px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-lottie {
  width: 128px;
  height: 128px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
}

.auth-lottie svg,
.auth-lottie canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 24px rgba(245, 197, 24, 0.28));
}

.auth-lottie.is-fallback {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe9a0 0%, #f5c518 46%, #c99212 100%);
  box-shadow: 0 10px 28px rgba(245, 197, 24, 0.22);
}

.auth-brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.auth-lead {
  margin: 6px 0 0;
  color: #9a9a9a;
  font-size: 13px;
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 20px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
}

.auth-tabs button {
  height: 40px;
  border: 0;
  background: transparent;
  color: #8d8d8d;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.auth-tabs button.is-active {
  background: #fe2c55;
  color: #fff;
}

.auth-form {
  text-align: left;
}

.auth-note {
  color: #8d8d8d;
  font-size: 12px;
  line-height: 1.4;
  margin: -4px 0 14px;
}

.input-wrap {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid #2e2e2e;
  background: #121212;
  border-radius: 12px;
  padding: 0 12px;
}

.input-wrap:focus-within {
  border-color: var(--selected);
}

.input-prefix {
  color: #8e8e8e;
  font-weight: 700;
  margin-right: 6px;
}

.input-wrap input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  min-width: 0;
  user-select: text;
}

.input-wrap input::placeholder {
  color: #5f5f5f;
}

.eye-btn {
  border: 0;
  background: transparent;
  color: #8d8d8d;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 0 6px 8px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  min-width: auto;
  height: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  text-align: left;
}

.field span {
  font-size: 12px;
  color: #b0b0b0;
  font-weight: 600;
}

.field > input {
  height: 46px;
  border: 1px solid #2e2e2e;
  background: #121212;
  color: #fff;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}

.field > input:focus {
  border-color: var(--selected);
}

.auth-form .btn-primary {
  margin-top: 4px;
}

.auth-body {
  padding: 24px 22px 40px;
  text-align: center;
}

.auth-body .btn-primary {
  margin-top: 6px;
}

.auth-body .field-error {
  padding: 0 0 12px;
}

.auth-form .field-error {
  padding: 0 0 12px;
}

.btn-ghost {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: 1px solid #2e2e2e;
  background: transparent;
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost--danger {
  color: #ff6b81;
  border-color: #3a1a22;
}

.pending-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #2a2208;
  color: #f5c518;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
}

.admin-body {
  padding: 8px 16px 32px;
}

.admin-body h2 {
  font-size: 13px;
  color: #8d8d8d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 10px;
}

.admin-card {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-card strong {
  display: block;
  font-size: 15px;
}

.admin-card span {
  color: #8d8d8d;
  font-size: 12px;
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-actions button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-approve {
  background: #22c55e;
  color: #04120a;
}

.btn-reject {
  background: #2a2a2a;
  color: #fff;
}

.empty-note {
  color: #6d6d6d;
  font-size: 13px;
  padding: 8px 0 16px;
}

.processing-sub {
  margin-top: 8px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  min-height: 20px;
  line-height: 1.4;
}

.spinner--lg {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-width: 3.5px;
  border-color: #ececec;
  border-top-color: var(--selected);
}

.checks {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 18px auto 0;
  max-width: 320px;
  text-align: left;
}

.checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: #222;
  font-size: 14px;
  font-weight: 500;
}

.checks li::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  flex-shrink: 0;
}

.checks li.is-current {
  color: #111;
}

.checks li.is-current::before {
  border-color: var(--selected);
  box-shadow: inset 0 0 0 4px var(--selected);
}

.checks li.is-done {
  color: #1a1a1a;
}

.checks li.is-done::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.sheet-account {
  color: var(--selected);
  font-weight: 700;
  margin-bottom: 14px;
}

.custom-preview {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0 8px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 480px) {
  body {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  .app {
    border-left: 1px solid #1c1c1c;
    border-right: 1px solid #1c1c1c;
    min-height: 100dvh;
  }

  .overlay {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 430px;
    transform: translateX(-50%);
  }
}
