:root {
  --bg: #08090c;
  --surface: rgba(18, 20, 27, 0.84);
  --surface-2: rgba(25, 28, 37, 0.9);
  --surface-hover: #1e222c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5f8;
  --text-2: #9097a8;
  --text-3: #5e6577;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --white: #f4f5f8;
  --white-ink: #090a0d;
  --positive: #34c77b;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(76, 141, 255, 0.15) 0%, rgba(22, 42, 78, 0.07) 42%, transparent 74%),
    radial-gradient(ellipse 70% 35% at 50% 108%, rgba(148, 178, 224, 0.06) 0%, transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  background-position: 0 0, 0 0, center top;
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(9, 10, 13, 0) 0%, rgba(9, 10, 13, 0.45) 55%, rgba(9, 10, 13, 0.85) 100%),
    linear-gradient(90deg, rgba(9, 10, 13, 0.65) 0%, transparent 18%, transparent 82%, rgba(9, 10, 13, 0.65) 100%);
}

.container {
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-2);
}

.accent {
  color: var(--accent);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* SVG-слоты из /static/icons/*.svg */
.ico-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ico-slot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ico-sm {
  width: 17px;
  height: 17px;
}

.ico-xs {
  width: 15px;
  height: 15px;
}

.container {
  max-width: 440px;
  margin: 0 auto;
  padding: 12px 14px 88px;
}

.demo-strip {
  font-size: 11.5px;
  color: var(--text-2);
  text-align: center;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Вкладки */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.16s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Баннер */
.banner-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--border);
}

.banner-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.banner-frame.no-img img {
  display: none;
}

.banner-frame.no-img .banner-fallback {
  display: flex;
}

/* Полоса аккаунта */
.account-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-top: 10px;
  padding: 11px 12px;
  gap: 10px;
}

.account-cell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.v-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.cell-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cell-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.label {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.2;
}

.account-cell code {
  font-size: 12.5px;
  color: var(--text);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bal-val {
  font-size: 15px;
  font-weight: 700;
  margin-top: 1px;
}

.mini-plus {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, transform 0.1s ease;
}

.mini-plus:active {
  transform: scale(0.94);
  background: var(--surface-hover);
}

/* Заголовок секции */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 10px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}

/* Карточки тарифов */
.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 15px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.1s ease;
}

.plan-card:active {
  transform: scale(0.988);
  background: var(--surface-2);
}

.plan-card.featured {
  border-color: rgba(76, 141, 255, 0.36);
  background: linear-gradient(180deg, rgba(22, 28, 42, 0.9) 0%, rgba(18, 20, 27, 0.86) 100%);
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-ident {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.plan-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plan-card.featured .plan-icon {
  background: var(--accent-soft);
  border-color: rgba(76, 141, 255, 0.3);
  color: var(--accent);
}

.plan-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.plan-name {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.tag.accent-tag {
  background: var(--accent-soft);
  color: #8bb8ff;
  border-color: rgba(76, 141, 255, 0.28);
}

.plan-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.plan-price-col {
  text-align: right;
  flex-shrink: 0;
}

.plan-price {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.plan-period {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cfd5e3;
}

.checklist .ico-slot {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.plan-footer {
  margin-top: 14px;
}

/* Кнопки */
.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.14s ease, transform 0.1s ease, background 0.14s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-white {
  background: var(--white);
  color: var(--white-ink);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-cryptobot {
  background: #1b6ef3;
  color: #ffffff;
}

.btn-xrocket {
  background: #1f293d;
  color: #e6f0ff;
  border-color: rgba(76, 141, 255, 0.38);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.pay-methods-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 0 2px 8px;
}

/* Переключатель провайдера и сумм пополнения */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.seg-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.seg-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.seg-btn.active .ico-slot {
  color: var(--accent);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.amt-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  padding: 9px 4px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.amt-btn.active {
  border-color: rgba(76, 141, 255, 0.55);
  background: var(--accent-soft);
  color: var(--text);
}

.wallet-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Категории ALTУШKI / $PORTIKI */
.cat-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.cat-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 9px 8px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.cat-pill.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(76, 141, 255, 0.5);
}

/* Цены в 3 валютах */
.price-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.price-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 7px;
}

.price-chip.stars {
  color: #f4c44e;
  border-color: rgba(244, 196, 78, 0.25);
  background: rgba(244, 196, 78, 0.08);
}

/* Кнопки оплаты в шторке */
.btn-stars {
  background: #f4c44e;
  color: #14120c;
}

.btn-lolz {
  background: #142b1e;
  color: #6ee7a8;
  border-color: rgba(52, 199, 123, 0.35);
}

.segmented.seg-3 {
  grid-template-columns: repeat(3, 1fr);
}

.segmented.seg-3 .seg-btn {
  padding: 9px 4px;
  font-size: 12px;
  gap: 5px;
}

.pay-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Поле ввода произвольной суммы в $ */
.usd-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.usd-input-wrap:focus-within {
  border-color: var(--accent);
}

.usd-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.usd-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.usd-input-wrap input::-webkit-outer-spin-button,
.usd-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.usd-preview {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

/* Экран обязательной подписки */
.gate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 13, 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
}

.gate-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin: 0 auto 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(76, 141, 255, 0.35);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
}

.gate-card p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.open-channel-btn {
  margin-top: 8px;
  padding: 9px 12px;
  font-size: 13px;
}

/* Преимущества (компактная строка) */
.perks-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 12px;
}

.perk-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perk-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.perk-item span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}

/* Шапки вкладок */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 16px;
}

.view-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.balance-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.balance-tag .ico-slot {
  color: var(--accent);
}

/* Профиль */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.wallet-card {
  padding: 16px;
  margin-bottom: 18px;
}

.wallet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 4px 8px;
}

.group-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.count-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.list-card {
  overflow: hidden;
}

.list-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

.order-row {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.order-row:last-child {
  border-bottom: none;
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.order-top strong {
  font-weight: 600;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
}

.key-box code {
  flex: 1;
  font-size: 12px;
  color: #a9c6ff;
  word-break: break-all;
}

.copy-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.tx-row:last-child {
  border-bottom: none;
}

.tx-note {
  color: #d6dbe8;
}

.tx-sum {
  font-weight: 600;
  white-space: nowrap;
}

.tx-sum.pos {
  color: var(--positive);
}

/* Нижняя навигация (docked native style) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 10, 13, 0.88);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}

.tab-btn {
  max-width: 140px;
  width: 100%;
  margin: 0 auto;
  border: none;
  background: none;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab-btn.active {
  color: var(--text);
}

.tab-btn.active .ico-slot {
  color: var(--accent);
}

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.sheet {
  width: 100%;
  max-width: 440px;
  background: #14161d;
  border-top: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheetIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-title {
  margin: 8px 0 3px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.sheet-desc {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: #c7cddb;
}

.summary-box {
  margin: 16px 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 9px 0;
}

.price-lg {
  font-size: 18px;
  font-weight: 700;
}

.val-md {
  font-size: 14.5px;
  font-weight: 600;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: #1b1f29;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
