:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  --bg: #050911;
  --surface: #101721;
  --raised: #172231;
  --line: #27364a;
  --soft-line: #1d2a3b;
  --text: #f7f9fc;
  --muted: #8f99aa;
  --blue: #1683ff;
  --cyan: #13b8e8;
  --green: #30c49a;
  --amber: #ffc43d;
  --space-shift: 0px;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  z-index: 0;
  inset: -8vh -8vw;
  background-image: linear-gradient(rgb(3 8 15 / 42%), rgb(3 8 15 / 18%)), url("/static/assets/space-background.png");
  background-position: center top;
  background-size: cover;
  content: "";
  pointer-events: none;
  transform: translate3d(0, var(--space-shift), 0) scale(1.04);
  will-change: transform;
}
button { font: inherit; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom));
}

.profile-header {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 13px;
  min-height: 94px;
  padding: 18px;
  border: 1px solid #123d66;
  border-radius: 14px;
  background: rgb(8 35 65 / 92%);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 38px rgb(0 14 31 / 35%);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: flex-start;
  width: 158px;
  max-width: 100%;
  height: auto;
  padding: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 160ms ease, transform 160ms ease;
  gap: 9px;
}

.brand:active { opacity: .75; transform: scale(.98); }
.brand:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.brand img { display: block; width: 34px; height: auto; flex: 0 0 34px; }
.brand strong { color: #fff; font-family: Arial, sans-serif; font-size: 31px; font-weight: 700; line-height: 1; letter-spacing: 0; }

.profile-copy { min-width: 0; }
.profile-copy > * { display: block; }
.eyebrow, .section-label { color: #5bb4ff; font-size: 11px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.profile-copy h1 { margin: 4px 0 6px; overflow: hidden; font-size: 14px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.user-identity { width: 100%; padding: 0; overflow: hidden; border: 0; background: transparent; color: #f4f7fb; font-size: 12px; font-weight: 650; line-height: 1.35; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.user-identity:hover { color: #75c4ff; }
.telegram-user-button { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 31px; margin-top: 8px; padding: 6px 11px; border: 1px solid rgb(44 213 163 / 22%); border-radius: 14px; background: #075d4d; color: #e8fff8; font-size: 10px; font-weight: 700; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.telegram-user-button i { width: 8px; height: 8px; border: 2px solid #c8ffef; border-radius: 50%; background: var(--green); }
.telegram-user-button:active { background: #08705c; transform: scale(.97); }
.avatar { position: relative; display: grid; place-items: center; width: 46px; aspect-ratio: 1; overflow: hidden; border: 1px solid #4d759f; border-radius: 50%; background: #173a5c; color: #e7f3ff; font-size: 13px; font-weight: 800; }
.avatar img { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-photo img { display: block; }
.avatar.has-photo span { visibility: hidden; }

.page-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 22px 2px 18px; }
.back-button { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 7px; border: 0; background: transparent; color: white; font-size: 24px; cursor: pointer; }
.back-button span { font-size: 17px; font-weight: 700; }
.timer { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; min-width: 105px; height: 44px; padding: 0 13px; border: 1px solid #2a4664; border-radius: 10px; background: #142437; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 800; }
.timer-icon { color: var(--cyan); font-size: 19px; }

.panel { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgb(16 23 33 / 94%); box-shadow: 0 14px 34px rgb(0 0 0 / 28%); backdrop-filter: blur(10px); }
.amount-panel { position: relative; overflow: hidden; padding: 28px 26px; border-color: #29445f; background: rgb(11 29 49 / 93%); }
.amount-panel h2 { width: min(100%, 330px); margin: 18px 0 0; font-size: 29px; line-height: 1.18; letter-spacing: 0; }
.amount { margin: 26px 0 21px; color: #ffffff; font-size: 50px; font-variant-numeric: tabular-nums; font-weight: 850; line-height: 1; letter-spacing: 0; text-shadow: 0 6px 24px rgb(28 139 255 / 22%); }
.description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.bank-panel { padding: 26px; background: rgb(14 22 33 / 94%); }
.bank-panel > h2 { margin: 0; padding-bottom: 20px; border-bottom: 1px solid var(--soft-line); font-size: 21px; letter-spacing: 0; }
dl { margin: 0; }
.detail-row { padding: 18px 0; border-bottom: 1px solid var(--soft-line); }
.detail-row:last-child { padding-bottom: 2px; border-bottom: 0; }
dt { margin-bottom: 7px; color: var(--muted); font-size: 12px; }
dd { margin: 0; overflow-wrap: anywhere; font-size: 18px; font-weight: 650; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.copy-row > div { min-width: 0; }
#card-number { font-variant-numeric: tabular-nums; }
.copy-action { position: relative; flex: 0 0 42px; min-width: 42px !important; }
.icon-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #36516f; border-radius: 10px; background: #17263a; color: #e4edf8; cursor: pointer; transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease; }
.icon-button:active { transform: scale(.94); }
.icon-button:active { border-color: #315f91; background: #1b2c40; color: #72b8ff; }
.copy-icon { position: relative; display: inline-block; flex: 0 0 19px; width: 19px; height: 19px; color: inherit; }
.copy-icon::before, .copy-icon::after { position: absolute; width: 11px; height: 11px; border: 1.7px solid currentColor; border-radius: 4px; content: ""; }
.copy-icon::before { top: 1px; right: 1px; }
.copy-icon::after { bottom: 1px; left: 1px; }
.icon-button .copy-icon::after { background: #202735; }
.icon-button:active .copy-icon::after { background: #1b2c40; }
.secondary-button .copy-icon::after { background: #10151d; }
.copy-toast { position: absolute; z-index: 5; top: 50%; right: calc(100% + 9px); width: max-content; max-width: 150px; padding: 7px 10px; border: 1px solid #344457; border-radius: 6px; background: #202a37; color: #dce6f3; box-shadow: 0 8px 24px rgb(0 0 0 / 35%); font-size: 12px; font-weight: 650; line-height: 1.2; opacity: 0; pointer-events: none; transform: translate(5px, -50%); transition: opacity 150ms ease, transform 150ms ease; }
.copy-toast::after { position: absolute; top: 50%; left: 100%; border: 5px solid transparent; border-left-color: #344457; content: ""; transform: translateY(-50%); }
.copy-toast.is-visible { opacity: 1; transform: translate(0, -50%); }

.warning { display: flex; gap: 13px; margin-bottom: 18px; padding: 17px; border: 1px solid #574719; border-radius: 14px; background: #262112; color: #efc75a; font-size: 13px; line-height: 1.55; }
.warning-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: #332600; font-weight: 900; }
.warning p, .warning strong { margin: 0; }
.warning strong { display: block; color: #ffd76a; }

.actions { display: grid; gap: 11px; }
.actions button { min-height: 58px; border-radius: 14px; color: white; font-size: 16px; font-weight: 750; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease; }
.actions button:active:not(:disabled) { transform: scale(.985); }
.primary-button { border: 0; background: linear-gradient(105deg, #0878ff, #04bfe8); box-shadow: 0 13px 32px rgb(18 139 255 / 28%); }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid #36516f; background: #0c1623; color: #e2ebf5; }
.actions button:disabled { cursor: default; opacity: .58; box-shadow: none; }
.status { min-height: 20px; margin: 12px 0 0; text-align: center; color: #7de0c2; font-size: 13px; }

.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 14px; background: rgb(3 6 10 / 82%); backdrop-filter: blur(4px); }
.modal-overlay[hidden] { display: none; }
.payment-modal { width: min(100%, 410px); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 24px; border: 1px solid #353e4b; border-radius: 18px; background: #181d25; color: var(--text); box-shadow: 0 28px 90px rgb(0 0 0 / 62%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.processing-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 8px; background: #453b1d; color: var(--amber); font-size: 26px; }
.modal-close { display: grid; place-items: center; width: 42px; height: 42px; border: 0; background: transparent; color: #9ba3af; font-size: 32px; line-height: 1; cursor: pointer; }
.payment-modal h2 { margin: 22px 0; font-size: 31px; line-height: 1.15; letter-spacing: 0; }
.payment-modal p { margin: 0 0 22px; color: #adb3bd; font-size: 17px; line-height: 1.55; }
.payment-modal a { color: var(--blue); }
.modal-ok { width: 100%; min-height: 56px; margin-top: 8px; border: 0; border-radius: 8px; background: linear-gradient(105deg, #137cff, #0cbbe6); color: white; font-size: 18px; font-weight: 800; cursor: pointer; }
.modal-close:focus-visible, .modal-ok:focus-visible, button:focus-visible { outline: 2px solid #49b8ff; outline-offset: 3px; }

@media (max-width: 400px) {
  .app-shell { padding-inline: 12px; }
  .profile-header { grid-template-columns: 130px minmax(0, 1fr) 42px; gap: 9px; padding: 15px 14px; }
  .brand { width: 130px; height: auto; gap: 7px; }
  .brand img { width: 29px; flex-basis: 29px; }
  .brand strong { font-size: 25px; }
  .avatar { width: 42px; }
  .profile-copy h1 { font-size: 13px; }
  .page-nav { gap: 10px; }
  .timer { min-width: 91px; padding-inline: 10px; }
  .amount-panel, .bank-panel { padding: 21px 19px; }
  .amount-panel h2 { font-size: 25px; }
  .amount { font-size: 42px; }
  dd { font-size: 17px; }
  .payment-modal h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  body::before { transform: none !important; }
}
