:root {
  color-scheme: dark;
  --bg: var(--tg-theme-bg-color, #0c1020);
  --bg-soft: var(--tg-theme-secondary-bg-color, #13192b);
  --surface: var(--tg-theme-secondary-bg-color, #171e32);
  --surface-2: #202941;
  --surface-3: #28324c;
  --text: var(--tg-theme-text-color, #f5f7ff);
  --muted: var(--tg-theme-hint-color, #a0abc5);
  --subtle: #76819e;
  --link: var(--tg-theme-link-color, #9d8cff);
  --button: var(--tg-theme-button-color, #7657ee);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --accent: #8b73ff;
  --accent-2: #b09eff;
  --gold: #ffc93d;
  --gold-soft: rgba(255, 201, 61, .13);
  --green: #42d392;
  --green-soft: rgba(66, 211, 146, .13);
  --red: #ff667a;
  --red-soft: rgba(255, 102, 122, .13);
  --orange: #ffb454;
  --border: rgba(156, 169, 205, .17);
  --border-strong: rgba(176, 158, 255, .34);
  --shadow: 0 22px 55px rgba(1, 4, 16, .3);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --max-width: 720px;
  --nav-height: 78px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(139, 115, 255, .18), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.surface-open {
  overflow: hidden;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
label[for],
a {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

input,
textarea,
.balance-amount,
.payment-detail strong {
  user-select: text;
}

:focus-visible {
  outline: 3px solid rgba(176, 158, 255, .82);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 3000;
  transform: translateY(-150%);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.turnstile-mount {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 5, 15, .76);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.turnstile-mount.interactive {
  z-index: 2200;
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(9px);
}

.turnstile-mount > div {
  width: min(100%, 420px);
  min-width: min(300px, 100%);
  min-height: 65px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Bootstrap and fail-closed states */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 26px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 32%, rgba(139, 115, 255, .2), transparent 19rem),
    var(--bg);
  text-align: center;
}

.boot-orb {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
  border: 1px solid rgba(176, 158, 255, .34);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(139, 115, 255, .28), rgba(139, 115, 255, .07));
  color: var(--accent-2);
  box-shadow: 0 24px 70px rgba(84, 55, 204, .28);
}

.boot-orb.error {
  border-color: rgba(255, 102, 122, .35);
  background: var(--red-soft);
  color: var(--red);
}

.boot-orb.telegram {
  border-color: rgba(56, 189, 248, .36);
  background: rgba(56, 189, 248, .12);
  color: #5ecbff;
}

.boot-spinner {
  width: 23px;
  height: 23px;
  margin-top: 4px;
  border: 2px solid rgba(176, 158, 255, .22);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.boot-screen h1 {
  max-width: 420px;
  margin: 4px 0 0;
  font-size: clamp(23px, 6vw, 30px);
  letter-spacing: -.035em;
}

.boot-screen p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.boot-retry {
  width: min(100%, 320px) !important;
  margin-top: 10px;
}

/* Shell */
.app-shell {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom) + 28px);
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(156, 169, 205, .08);
  background: rgba(12, 16, 32, .83);
  backdrop-filter: blur(18px) saturate(135%);
}

.header-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 3px;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.user-avatar {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
}

.avatar-ring {
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
}

.user-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.eyebrow {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .085em;
  line-height: 1.3;
  text-transform: uppercase;
}

.user-name {
  max-width: 220px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-username {
  min-height: 15px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.security-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(66, 211, 146, .2);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.icon-btn:active {
  transform: scale(.94);
}

.bell-btn {
  position: relative;
  border-radius: 50%;
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

main {
  padding: 12px 16px 0;
}

/* Balance */
.balance-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 21px;
  border: 1px solid rgba(176, 158, 255, .27);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(126, 92, 246, .3), rgba(30, 38, 68, .94) 57%, rgba(19, 25, 43, .98));
  color: #f8f8ff;
  box-shadow: var(--shadow);
}

.balance-glow {
  position: absolute;
  top: -70px;
  right: -55px;
  z-index: -1;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(176, 158, 255, .19);
  filter: blur(9px);
}

.balance-topline,
.balance-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.balance-label,
.balance-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.balance-label {
  color: #d8d8ed;
  font-size: 12px;
  font-weight: 680;
}

.balance-secure {
  color: #aab5cf;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(66, 211, 146, .1);
}

.balance-amount {
  margin: 16px 0 18px;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1;
}

.balance-footer p {
  max-width: 275px;
  margin: 0;
  color: #aeb7cf;
  font-size: 12px;
}

.balance-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .93);
  color: #17152b;
  font-size: 13px;
  font-weight: 800;
}

/* Home sections */
.content-section {
  margin-top: 27px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 12px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading h2,
.page-section-title h2 {
  margin: 2px 0 0;
  font-size: 19px;
  letter-spacing: -.025em;
}

.section-note {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.service-card {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 112px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(32, 41, 65, .94), rgba(20, 26, 45, .98));
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 30px rgba(3, 7, 20, .16);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.service-card:active {
  transform: scale(.985);
}

.service-card:hover {
  border-color: var(--border-strong);
}

.service-icon {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 20px;
}

.stars-card .service-icon {
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 201, 61, .1);
}

.premium-card .service-icon {
  background: rgba(176, 158, 255, .14);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(176, 158, 255, .12);
}

.service-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.service-name {
  font-size: 16px;
  font-weight: 800;
}

.service-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.service-price {
  margin-top: 9px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 720;
}

.stars-card .service-price {
  color: var(--gold);
}

.service-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 18px;
}

.text-btn {
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--link);
  font-size: 13px;
  font-weight: 750;
}

.text-btn.danger {
  color: var(--red);
}

.home-recent {
  min-height: 78px;
}

.trust-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 24px 0 6px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(23, 30, 50, .68);
}

.trust-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.trust-item > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.trust-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.trust-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.trust-divider {
  width: 1px;
  height: 34px;
  background: var(--border);
}

/* Navigation */
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  width: min(100%, var(--max-width));
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(13, 18, 33, .92);
  backdrop-filter: blur(22px) saturate(145%);
}

.nav-btn {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-height: 54px;
  padding: 5px 2px;
  border-radius: 14px;
  background: transparent;
  color: var(--subtle);
}

.nav-btn span {
  font-size: 10px;
  font-weight: 680;
  line-height: 1.1;
}

.nav-btn.active {
  color: var(--accent-2);
}

.nav-btn.active::before {
  position: absolute;
  top: -8px;
  width: 24px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
  content: "";
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(18px, env(safe-area-inset-top));
  background: rgba(2, 5, 15, .74);
  backdrop-filter: blur(9px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(100%, 620px);
  max-height: min(91dvh, 840px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--bg-soft);
  box-shadow: 0 -25px 70px rgba(0, 0, 0, .38);
  animation: sheet-in .24s cubic-bezier(.2, .8, .2, 1);
}

.modal-handle {
  width: 42px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: var(--surface-3);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 19px 13px;
  border-bottom: 1px solid rgba(156, 169, 205, .09);
  background: rgba(19, 25, 43, .94);
  backdrop-filter: blur(16px);
}

.modal-title {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -.03em;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 19px calc(27px + env(safe-area-inset-bottom));
}

/* Forms */
.input-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.input-group label,
.input-group legend {
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.input-group > small {
  color: var(--muted);
  font-size: 12px;
}

.input-wrap,
.amount-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input-wrap:focus-within,
.amount-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 115, 255, .12);
}

.input-prefix {
  display: grid;
  width: 47px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input-wrap input,
.amount-input input {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 115, 255, .12);
}

input::placeholder {
  color: #6f7a98;
  opacity: 1;
}

.amount-input > span {
  flex: 0 0 auto;
  padding-right: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.info-banner,
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(176, 158, 255, .2);
  border-radius: var(--radius-md);
  background: rgba(139, 115, 255, .09);
  color: var(--muted);
  font-size: 13px;
}

.info-banner-icon {
  color: var(--gold);
  font-size: 17px;
  line-height: 1.2;
}

.notice.warning {
  border-color: rgba(255, 180, 84, .23);
  background: rgba(255, 180, 84, .08);
  color: #ffd39b;
}

.preset-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 3px;
  scrollbar-width: none;
}

.preset-row::-webkit-scrollbar {
  display: none;
}

.preset-row button {
  min-width: 58px;
  min-height: 38px;
  flex: 1 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.preset-row button.selected,
.preset-row button:active {
  border-color: var(--border-strong);
  background: rgba(139, 115, 255, .13);
  color: var(--accent-2);
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  transition: transform .16s ease, opacity .16s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--button), #6545db);
  color: var(--button-text);
  box-shadow: 0 10px 24px rgba(94, 65, 205, .25);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.btn-primary:active,
.btn-ghost:active {
  transform: scale(.985);
}

.spinner {
  display: inline-block;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, .28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.order-summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.order-summary small,
.balance-inline span {
  color: var(--muted);
  font-size: 11px;
}

.order-summary strong {
  font-size: 17px;
}

.summary-balance {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.balance-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.duration-fieldset legend {
  margin-bottom: 7px;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.duration-card {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.duration-card.selected,
.duration-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(139, 115, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(139, 115, 255, .14);
}

.duration-card:active {
  transform: scale(.975);
}

.duration-card:focus-within {
  outline: 3px solid rgba(176, 158, 255, .72);
  outline-offset: 2px;
}

.dur-months {
  font-size: 15px;
  font-weight: 800;
}

.dur-price {
  color: var(--muted);
  font-size: 11px;
}

.dur-badge {
  position: absolute;
  top: -8px;
  right: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green);
  color: #052317;
  font-size: 9px;
  font-weight: 850;
}

/* Username preview */
.username-preview {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  animation: fade-in .18s ease;
}

.preview-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: #fff;
  font-weight: 800;
  object-fit: cover;
}

.preview-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.preview-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  color: var(--muted);
  font-size: 11px;
}

.preview-state {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
}

.username-preview.error .preview-state,
.username-preview.error .preview-name {
  color: var(--red);
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--accent-2);
  font-size: 10px;
}

.preview-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.preview-skeleton::after,
.skeleton-block::after,
.skeleton-lines span::after {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
  content: "";
  animation: shimmer 1.3s infinite;
}

/* Deposit */
.step-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  width: 48px;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  color: var(--subtle);
}

.step > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.step small {
  font-size: 10px;
  font-weight: 700;
}

.step.active {
  color: var(--accent-2);
}

.step.active > span {
  border-color: var(--accent);
  background: rgba(139, 115, 255, .16);
  box-shadow: 0 0 0 4px rgba(139, 115, 255, .07);
}

.step-line {
  width: min(15vw, 55px);
  height: 1px;
  margin-top: 16px;
  background: var(--border);
}

.deposit-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deposit-presets button {
  min-width: 92px;
}

.payment-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.payment-detail.highlight {
  border-color: rgba(176, 158, 255, .25);
  background: rgba(139, 115, 255, .09);
}

.payment-detail > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

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

.payment-detail strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.copy-btn {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--muted);
}

.upload-area {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1.5px dashed rgba(176, 158, 255, .36);
  border-radius: var(--radius-lg);
  background: rgba(139, 115, 255, .05);
  color: var(--muted);
  text-align: center;
  transition: border-color .16s ease, background .16s ease;
}

.upload-area:hover,
.upload-area:focus-within {
  border-color: var(--accent);
  background: rgba(139, 115, 255, .1);
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 19px;
  background: rgba(139, 115, 255, .13);
  color: var(--accent-2);
}

.upload-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.upload-hint {
  max-width: 360px;
  font-size: 12px;
}

.field-error {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.check-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.check-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  background: #090c16;
  object-fit: contain;
}

.check-preview-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.check-preview-info > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.check-preview-info strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-preview-info small {
  color: var(--muted);
  font-size: 11px;
}

.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.progress-track {
  position: relative;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-track span {
  position: absolute;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: progress 1.25s ease-in-out infinite;
}

/* Full pages */
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% -12%, rgba(139, 115, 255, .14), transparent 28rem),
    var(--bg);
}

.page-overlay.open {
  display: block;
  animation: page-in .2s ease;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: max(12px, env(safe-area-inset-top)) 16px 11px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 16, 32, .91);
  backdrop-filter: blur(18px);
}

.page-header h1 {
  margin: 1px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.page-body {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 18px 16px calc(32px + env(safe-area-inset-bottom));
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-avatar {
  grid-row: span 2;
  width: 72px;
  height: 72px;
  border: 3px solid rgba(176, 158, 255, .42);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.profile-name {
  overflow: hidden;
  font-size: 19px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-username {
  color: var(--muted);
  font-size: 13px;
}

.verified-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat-card {
  display: flex;
  min-height: 90px;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stat-card.full-w {
  grid-column: 1 / -1;
}

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

.stat-card strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.page-section-title {
  margin-top: 24px;
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 23px;
}

.profile-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.profile-link-card > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.profile-link-card small {
  color: var(--muted);
}

.profile-link-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  font-weight: 800;
}

.profile-link-icon.channel {
  background: rgba(56, 189, 248, .12);
  color: #5ecbff;
}

.profile-link-icon.support {
  background: var(--green-soft);
  color: var(--green);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 15px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.tp-btn-u {
  min-height: 39px;
  padding: 7px 5px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tp-btn-u.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .13);
}

/* Dynamic data cards */
.order-item,
.top-user-row,
.notif-item,
.home-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.order-item.compact {
  margin-bottom: 0;
}

.order-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
}

.order-icon.stars {
  background: var(--gold-soft);
  color: var(--gold);
}

.order-icon.premium {
  background: rgba(176, 158, 255, .13);
  color: var(--accent-2);
}

.order-info,
.top-user-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.order-type,
.top-user-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-target,
.order-date,
.top-user-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-right {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.order-price,
.top-user-spent {
  font-size: 13px;
  font-weight: 800;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
}

.status-completed {
  background: var(--green-soft);
  color: var(--green);
}

.status-processing {
  background: rgba(139, 115, 255, .13);
  color: var(--accent-2);
}

.status-pending {
  background: rgba(255, 180, 84, .12);
  color: var(--orange);
}

.top-user-row {
  min-height: 71px;
}

.rank {
  display: grid;
  width: 29px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--subtle);
  font-size: 14px;
  font-weight: 850;
}

.rank.medal {
  font-size: 20px;
}

.top-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #525fc9);
  color: #fff;
  font-weight: 800;
  object-fit: cover;
}

.top-user-spent {
  flex: 0 0 auto;
  color: var(--accent-2);
}

.notif-item {
  position: relative;
  display: block;
  padding-left: 16px;
}

.notif-item.unread::before {
  position: absolute;
  top: 17px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.notif-text {
  font-size: 13px;
}

.notif-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state,
.home-empty {
  min-height: 110px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty-state strong,
.home-empty strong {
  color: var(--text);
  font-size: 15px;
}

.empty-state button,
.home-empty button {
  min-height: 40px;
}

.skeleton-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.skeleton-block {
  position: relative;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: var(--surface-2);
}

.skeleton-block.round {
  border-radius: 14px;
}

.skeleton-lines {
  display: flex;
  width: 55%;
  flex-direction: column;
  gap: 8px;
}

.skeleton-lines span {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-2);
}

.skeleton-lines span:last-child {
  width: 67%;
}

/* Feedback */
.toast {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
  left: 16px;
  z-index: 1500;
  width: fit-content;
  max-width: min(430px, calc(100% - 32px));
  margin: 0 auto;
  transform: translateY(15px);
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #252d43;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .32);
  color: #f7f8ff;
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: rgba(255, 102, 122, .3);
  background: #3a2230;
}

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

@keyframes sheet-in {
  from { transform: translateY(35px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes page-in {
  from { transform: translateX(15px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-in {
  from { transform: translateY(-3px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes progress {
  0% { left: -45%; }
  100% { left: 100%; }
}

@media (min-width: 520px) {
  main {
    padding-right: 22px;
    padding-left: 22px;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card {
    align-items: flex-start;
    flex-direction: column;
    min-height: 210px;
  }

  .service-arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
  }

  .service-copy {
    width: 100%;
  }

  .page-body {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (min-width: 680px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }

  .modal {
    border-bottom: 1px solid var(--border);
    border-radius: 28px;
  }

  .modal-handle {
    display: none;
  }
}

@media (max-width: 390px) {
  .security-chip span {
    display: none;
  }

  .security-chip {
    width: 34px;
    min-width: 34px;
    justify-content: center;
    padding: 0;
  }

  .balance-footer {
    align-items: flex-end;
  }

  .balance-footer p {
    max-width: 170px;
  }

  .duration-grid {
    gap: 6px;
  }

  .duration-card {
    padding-right: 3px;
    padding-left: 3px;
  }

  .dur-price {
    font-size: 10px;
  }

  .order-item {
    gap: 9px;
    padding: 11px;
  }

  .order-icon {
    width: 39px;
    height: 39px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Telegram light theme keeps the brand accents while using native surfaces. */
html[data-theme="light"] {
  color-scheme: light;
  --surface-2: #e8ecf6;
  --surface-3: #dde3f0;
  --subtle: #68738d;
  --border: rgba(64, 74, 102, .16);
  --border-strong: rgba(112, 80, 225, .34);
  --shadow: 0 20px 50px rgba(46, 52, 72, .14);
}

html[data-theme="light"] .header,
html[data-theme="light"] .bottom-nav,
html[data-theme="light"] .page-header {
  background: rgba(255, 255, 255, .88);
}

html[data-theme="light"] .modal-header {
  background: rgba(246, 247, 251, .94);
}

html[data-theme="light"] .service-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(242, 244, 250, .98));
}

html[data-theme="light"] .balance-card {
  background: linear-gradient(135deg, #7256dc, #3f3a72 62%, #272946);
}

html[data-theme="light"] .info-banner {
  color: #5e5875;
}
