/* ═══════════════════════════════════════════════════════════════════════════
   Scale VPN Mini App — Neo-Minimalist Fintech UI
   Apple HIG · Soft Glassmorphism · Liquid Glass · лёгкий Claymorphism
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Токены ── */
:root {
  --r-xl: 34px;
  --r-lg: 28px;
  --r-md: 22px;
  --r-sm: 16px;

  --acc-1: #0990DE;               /* лазурный, глубже */
  --acc-2: #045FA6;               /* тёмно-голубой */
  --grad-acc: linear-gradient(160deg, #1FA9F0 0%, #0A8CD8 48%, #045A9E 100%);
  --grad-acc-soft: color-mix(in srgb, var(--acc-1) 11%, transparent);  /* плоский светлый тон (без градиента) */

  --gold-grad: linear-gradient(135deg, #FFDF97 0%, #F7BE45 100%);
  --silver-grad: linear-gradient(135deg, #F0F3F9 0%, #C4CEDD 100%);
  --bronze-grad: linear-gradient(135deg, #F2C9A0 0%, #D99A5B 100%);

  --ok: #2EBD85;
  --warn: #F5A623;
  --bad: #F0506E;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F4F7;
  --text: #0C0E1A;
  --text-2: #6A7085;
  --text-3: #9AA0B4;
  --line: rgba(20, 28, 66, .07);

  --shadow-soft: 0 10px 34px rgba(24, 34, 84, .09), 0 2px 8px rgba(24, 34, 84, .05);
  --shadow-float: 0 18px 48px rgba(24, 34, 84, .16), 0 4px 12px rgba(24, 34, 84, .07);

  /* ═══ LIQUID GLASS (таббар) ═══
     Прозрачный центр + лёгкий blur с высокой насыщенностью (контент читается
     сквозь стекло, а не тонет в «морозе»), объёмная фаска и спекулярное
     кольцо по кромке. Только широко поддерживаемый CSS — одинаково в
     WebKit/Chromium; для WebView без backdrop-filter есть --glass-fallback. */
  --glass-surface: rgba(255, 255, 255, 0.22);
  /* Центр стекла: почти прозрачный, лёгкое преломляющее «дрожание» */
  --glass-filter: blur(2.5px) saturate(1.8) brightness(1.04);
  /* Кромка-линза (фолбэк WebKit, где SVG-преломление невозможно):
     кольцо с сильным blur + подсветкой — толстый край стекла, собирающий свет */
  --glass-rim-filter: blur(9px) saturate(2) brightness(1.12);
  --glass-rim-w: 12px;
  --glass-outer:
      0 2px 6px rgba(24, 34, 84, .07),
      0 14px 34px rgba(24, 34, 84, .13);
  --glass-bezel:  /* фаска: светлый свод сверху, глубина снизу, свечение внутрь */
      inset 0 1.5px 3px -1px rgba(255, 255, 255, .65),
      inset 0 -2px 4px -2px rgba(24, 34, 84, .18),
      inset 0 0 14px rgba(255, 255, 255, .12);
  --glass-rim: rgba(255, 255, 255, .85);   /* спекулярная дуга сверху */
  --glass-rim-2: rgba(255, 255, 255, .40); /* эхо-дуга снизу */
  --glass-fallback: rgba(255, 255, 255, .88);
  /* Капля-линза: почти прозрачная — «стеклянность» даёт преломление фона
     (backdrop-filter), а не белая заливка. Грани симметричные и тонкие. */
  --drop-bg: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .10) 52%, rgba(255, 255, 255, .20));
  --drop-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .75),
      inset 0 -1px 1.5px rgba(255, 255, 255, .35),
      inset 0 0 0 1px rgba(255, 255, 255, .22),
      0 2px 5px rgba(24, 34, 84, .07),
      0 8px 20px rgba(24, 34, 84, .09);
  --drop-filter: blur(3px) saturate(1.8) brightness(1.08);
  --drop-spec: .55;   /* яркость бликов капли */

  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: light;
}

/* ── Тёмно-серая тема (переключатель на главной). Меняем только токены —
   компоненты перекрашиваются сами, т.к. используют переменные. ────────── */
:root[data-theme="dark"] {
  --bg: #191919;
  --surface: #232323;
  --surface-2: #2F2F2F;
  --text: #F1F1F1;
  --text-2: #A1A1A1;
  --text-3: #6E6E6E;
  --line: rgba(255, 255, 255, .10);

  --shadow-soft: 0 6px 20px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow-float: 0 16px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .06);

  --grad-acc-soft: color-mix(in srgb, var(--acc-1) 24%, transparent);

  /* Стекло в тёмной теме — БЕЗ белой графики: объём дают тёмная глубина,
     преломление фона (backdrop-filter) и едва заметная нейтральная кромка. */
  --glass-surface: rgba(26, 26, 26, 0.45);
  --glass-filter: blur(3px) saturate(1.45) brightness(1.1);
  --glass-rim-filter: blur(9px) saturate(1.5) brightness(1.22);
  --glass-outer:
      0 2px 6px rgba(0, 0, 0, .3),
      0 14px 34px rgba(0, 0, 0, .38);
  --glass-bezel:
      inset 0 4px 8px -4px rgba(0, 0, 0, .45),
      inset 0 -4px 8px -4px rgba(0, 0, 0, .3);
  --glass-rim: rgba(255, 255, 255, .09);   /* только тонкая кромка, не блик */
  --glass-rim-2: rgba(255, 255, 255, .04);
  --glass-fallback: rgba(30, 30, 30, .94);

  /* Капля: чистая линза — без заливки-градиента, без белых inset-бликов.
     Видна за счёт осветления фона под собой (brightness) и мягкой тени. */
  --drop-bg: rgba(255, 255, 255, .04);
  --drop-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .055),
      0 2px 6px rgba(0, 0, 0, .22),
      0 6px 16px rgba(0, 0, 0, .2);
  --drop-filter: blur(5px) saturate(1.4) brightness(1.32);
  --drop-spec: 0;   /* спекулярная дуга и каустика полностью выключены */

  color-scheme: dark;
}

/* ── База ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: var(--tg-viewport-stable-height, 100vh);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  transition: background .35s ease, color .35s ease;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* touch-action: manipulation — убирает ожидание двойного тапа: браузер
   отдаёт click мгновенно, нажатия ощущаются моментальными */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; }

/* ═══ LIQUID GLASS ═══
   Слои (все — детерминированный CSS, одинаковый в WebKit и Chromium):
   1) сам элемент: почти прозрачная подложка + backdrop-filter (лёгкий blur,
      высокая насыщенность — контент «живёт» под стеклом) + наружная тень;
   2) ::before — фаска: светлый свод сверху, глубина снизу (объём линзы);
   3) ::after — кольцо кромки: симметричные спекулярные дуги сверху/снизу.
   overflow:hidden клипует blur по радиусу (лечит квадратный blur на части
   Android WebView — главный источник «на устройствах по-разному»). */
.liquid-glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--glass-surface);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-outer);
}
/* Кромка-линза: кольцо шириной --glass-rim-w с собственным backdrop-filter
   (маской-рамкой вырезана только полоса по краю). Центр остаётся чистым, а
   край «преломляет» — сильный blur + подсветка читаются как толща стекла.
   Это WebKit-фолбэк уровня, близкого к настоящему преломлению; на Chromium
   слой гасится (.lg-live) — там работает честный SVG-фильтр. */
.liquid-glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  padding: var(--glass-rim-w);
  -webkit-backdrop-filter: var(--glass-rim-filter);
  backdrop-filter: var(--glass-rim-filter);
  box-shadow: var(--glass-bezel);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
/* Кольцо кромки: conic-градиент маскируется в рамку толщиной ~1.2px.
   Ярче в зените, мягкое эхо в надире, прозрачно по бокам — симметрично. */
.liquid-glass::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  padding: 1.2px;
  background: conic-gradient(
      var(--glass-rim) 0%,
      transparent 16%,
      transparent 34%,
      var(--glass-rim-2) 50%,
      transparent 66%,
      transparent 84%,
      var(--glass-rim) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
/* WebView без backdrop-filter: плотная подложка вместо прозрачной,
   чтобы стекло выглядело максимально похоже, а не исчезало */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .liquid-glass { background: var(--glass-fallback); }
}
/* Chromium (.lg-live): включено настоящее SVG-преломление по kube.io —
   js/liquid-glass.js ставит backdrop-filter: url(#lgf-N) blur() saturate().
   Нарисованные фаску и кольцо гасим: их роль выполняют физическое
   преломление кромки и specular rim-light внутри фильтра. */
.liquid-glass.lg-live::before,
.liquid-glass.lg-live::after { display: none; }
/* ── Каркас ── */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: var(--tg-viewport-stable-height, 100vh);
  display: flex;
  flex-direction: column;
}

/* ── Шапка главной: профиль слева, кнопка темы справа (не закреплены) ── */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-btn {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, color .2s ease;
}
.theme-btn:active { transform: scale(.9); }
.theme-btn .icon { width: 22px; height: 22px; stroke-width: 1.9; }
/* Мягкая смена иконки при переключении */
.theme-btn .icon { animation: theme-swap .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes theme-swap {
  from { transform: rotate(-40deg) scale(.6); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .theme-btn .icon { animation: none; } }

/* ── Профильная «таблетка» (главная, слева сверху, скроллится с контентом) ── */
.profile-chip {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 0;
  padding: 7px 15px 7px 7px;
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease;
  max-width: 100%;
}
.profile-chip:active { transform: scale(.97); }
.profile-ava {
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: #fff;
  background: var(--acc-1);
}
.profile-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name {
  font-size: 17px; font-weight: 700; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-chip .chev { color: var(--text-3); width: 19px; height: 19px; flex: none; }

/* ── Экраны ── */
#view { flex: 1; padding: calc(14px + var(--safe-t)) 16px calc(var(--tabbar-h) + var(--safe-b) + 42px); }
.screen { display: flex; flex-direction: column; gap: 14px; animation: screen-in .34s ease; }
.screen[hidden] { display: none; }
/* Появление, а не «вылет»: мягкое проявление с почти незаметным приближением */
@keyframes screen-in {
  from { opacity: 0; transform: scale(.992); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.section-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-2);
  letter-spacing: .2px;
  margin: 8px 4px 0;
  display: flex; align-items: center; gap: 7px;
}
.section-title .icon { width: 17px; height: 17px; stroke-width: 2; }

/* ── Карточки ── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Hero-карта тарифа (Apple Wallet-стиль) */
.hero-card {
  border-radius: var(--r-xl);
  padding: 20px;
  color: #fff;
  background: var(--grad-acc);
  box-shadow: var(--shadow-soft), inset 0 1px 1.5px rgba(255,255,255,.45);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  top: -150px; right: -90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.34), rgba(255,255,255,.05) 62%, transparent 70%);
  filter: blur(2px);
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 210px; height: 210px;
  bottom: -120px; left: -70px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.16), transparent 65%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero-plan { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; letter-spacing: -.1px; }
.hero-plan .icon { width: 19px; height: 19px; stroke-width: 2; }
.hero-days { position: relative; z-index: 1; margin-top: 20px; font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.hero-days small { font-size: 17px; font-weight: 600; letter-spacing: 0; opacity: .82; margin-left: 6px; }
.hero-sub { position: relative; z-index: 1; margin-top: 7px; font-size: 13.5px; opacity: .86; font-weight: 500; }
.hero-foot {
  position: relative; z-index: 1;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
  display: flex; gap: 16px;
  font-size: 12.5px; font-weight: 600; opacity: .92;
}
.hero-foot span { display: flex; align-items: center; gap: 6px; }
.hero-foot .icon { width: 15px; height: 15px; stroke-width: 2.1; }
.hero-shield {
  position: absolute; right: 14px; bottom: -26px; z-index: 0;
  width: 120px; height: 120px;
  color: rgba(255, 255, 255, .13);
}
.hero-shield .icon { width: 100%; height: 100%; stroke-width: 1.1; }

/* Чипы */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .2px;
}
.chip .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.chip-glass {
  color: #fff;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
}
.chip-ok   { color: var(--ok);   background: color-mix(in srgb, var(--ok) 13%, transparent); }
.chip-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip-bad  { color: var(--bad);  background: color-mix(in srgb, var(--bad) 12%, transparent); }
.chip-acc  { color: var(--acc-1); background: color-mix(in srgb, var(--acc-1) 11%, transparent); }

/* Карточка тарифа «Трафик» */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; }
.plan-ico {
  width: 40px; height: 40px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.plan-ico .icon { width: 21px; height: 21px; }
.plan-sub { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-top: 2px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-weight: 700; font-size: 14.5px;
  transition: transform .16s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.965); }
.btn .icon { width: 18px; height: 18px; stroke-width: 2.1; }
.btn-primary {
  color: #fff;
  background: var(--grad-acc);
  box-shadow: inset 0 1px 1.5px rgba(255,255,255,.45);
}
/* Стеклянная кнопка внутри hero-карты (на градиенте) */
.btn-hero {
  position: relative; z-index: 1;
  margin-top: 16px;
  color: #fff;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.42), inset 0 -1px 1px rgba(255,255,255,.12);
}
.btn-soft { color: var(--acc-1); background: color-mix(in srgb, var(--acc-1) 9%, transparent); }
.btn-ghost { color: var(--text-2); background: var(--surface-2); }
.btn-danger { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: 13.5px; border-radius: 13px; }

.icon-btn {
  width: 42px; height: 42px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: color-mix(in srgb, var(--acc-1) 9%, transparent);
  transition: transform .16s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .icon { width: 19px; height: 19px; stroke-width: 2; }

/* Ключ доступа */
.key-link {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px;
  padding: 12px 12px 12px 15px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(20,28,66,.05);
}
.key-link code {
  flex: 1; min-width: 0;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 13px; }

/* Строка выбора типа роутинга внутри карточки ключа */
.route-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  transition: opacity .15s ease;
}
.route-row:active { opacity: .6; }
.route-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--acc-1); background: var(--grad-acc-soft);
}
.route-ico .icon { width: 20px; height: 20px; }
.route-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.route-text > span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.route-text b { font-size: 14.5px; letter-spacing: -.1px; }
.route-row .chev { color: var(--text-3); width: 19px; height: 19px; }

/* Прокси для Telegram */
.proxy-intro { font-size: 13px; line-height: 1.5; color: var(--text-2); font-weight: 500; margin-bottom: 14px; }
.proxy-row { gap: 11px; }
.proxy-flag { font-size: 25px; flex: none; line-height: 1; width: 30px; text-align: center; }
.proxy-row .row-main b { font-size: 14.5px; }
.proxy-go { flex: none; padding: 9px 16px; }

/* Опции роутинга в шторке (с описанием) */
.route-opt { align-items: flex-start; }
.route-opt .row-main b { font-size: 15px; }
.route-opt .row-main span { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); font-weight: 500; white-space: normal; }
.route-opt .radio-dot { margin-top: 3px; }
.action-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 13px 6px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12px; font-weight: 650; color: var(--text-2);
  transition: transform .16s ease;
}
.action-tile:active { transform: scale(.95); }
.action-tile .icon { width: 21px; height: 21px; color: var(--acc-1); }

/* Карточка поддержки (главная) — обычная белая, иконка с мягкой заливкой */
.support-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 15px 16px;
  transition: transform .16s ease;
}
.support-card:active { transform: scale(.98); }
.support-ico {
  width: 44px; height: 44px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--acc-1); background: var(--grad-acc-soft);
}
.support-ico .icon { width: 23px; height: 23px; }
.support-text { flex: 1; min-width: 0; }
.support-text b { display: block; font-size: 15px; letter-spacing: -.15px; }
.support-text span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.support-card .chev { color: var(--text-3); width: 19px; height: 19px; }

/* ── Рефералка: лаконичная карточка приглашения ── */
.invite { display: flex; flex-direction: column; gap: 12px; }
.invite-title { font-size: 13px; font-weight: 650; color: var(--text-2); letter-spacing: -.1px; }
.invite-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 13px 13px 13px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  transition: transform .16s ease;
}
.invite-link:active { transform: scale(.985); }
.invite-link code {
  flex: 1; min-width: 0;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invite-copy { flex: none; color: var(--acc-1); display: grid; place-items: center; }
.invite-copy .icon { width: 19px; height: 19px; stroke-width: 2; }

/* ── Минималистичная навигационная строка (Управление промокодами) ── */
.nav-row {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left;
  padding: 15px 16px;
  transition: transform .16s ease;
}
.nav-row:active { transform: scale(.98); }
.nav-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: color-mix(in srgb, var(--acc-1) 9%, transparent);
}
.nav-ico .icon { width: 19px; height: 19px; }
.nav-label { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.1px; }
.nav-row .chev { color: var(--text-3); width: 19px; height: 19px; }

/* ── Подстраница (Промокоды) — поверх вкладки, таббар остаётся ── */
.empty-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 5px; padding: 30px 22px;
}
.empty-ico {
  width: 52px; height: 52px; margin-bottom: 8px;
  border-radius: 16px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.empty-ico .icon { width: 25px; height: 25px; }
.empty-card b { font-size: 15px; letter-spacing: -.15px; }
.empty-card span { font-size: 13px; color: var(--text-2); font-weight: 500; line-height: 1.5; }

/* Действия в hero-блоке промокодов */
.hero-actions { position: relative; z-index: 1; margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-actions .btn { margin-top: 0; width: 100%; white-space: nowrap; }
.hero-default { margin-top: 10px; width: 100%; }

/* Карточка статистики промокодов: заголовок + пилюля периода + метрики */
.stats-card { padding: 16px 18px 18px; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stats-title { font-size: 15px; font-weight: 750; letter-spacing: -.2px; }
.period-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 10px 7px 13px;
  border-radius: 100px;
  font-size: 13px; font-weight: 650; color: var(--text);
  background: var(--surface-2);
  transition: transform .15s ease;
}
.period-pill:active { transform: scale(.95); }
.period-pill .chev { width: 15px; height: 15px; color: var(--text-3); transform: rotate(90deg); stroke-width: 2.4; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
.metric { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; position: relative; }
.metric + .metric::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 30px; width: 1px; background: var(--line);
}
.metric b { font-size: 19px; font-weight: 800; letter-spacing: -.6px; white-space: nowrap; }
.metric span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

/* Метка «по-умолчанию» у промокода */
.tag-default {
  display: inline-block; vertical-align: middle;
  margin-left: 6px; padding: 2px 7px;
  border-radius: 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
  color: var(--acc-1);
  background: color-mix(in srgb, var(--acc-1) 11%, transparent);
}

/* Премиальный список выбора (период статистики) */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  padding: 15px 16px;
  border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; letter-spacing: -.1px;
  color: var(--text-2);
  background: var(--surface-2);
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.opt:active { transform: scale(.985); }
.opt .opt-check { width: 20px; height: 20px; flex: none; color: var(--acc-1); opacity: 0; stroke-width: 2.4; }
.opt.sel { color: var(--text); background: color-mix(in srgb, var(--acc-1) 9%, transparent); font-weight: 700; }
.opt.sel .opt-check { opacity: 1; }
.opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-main b { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.opt-main span { font-size: 12px; color: var(--text-3); font-weight: 600; }

/* Метка «по-умолчанию» у промокода */
.tag-default {
  display: inline-block; vertical-align: middle;
  margin-left: 6px; padding: 2px 7px;
  border-radius: 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
  color: var(--acc-1);
  background: color-mix(in srgb, var(--acc-1) 11%, transparent);
}

/* Списки-строки */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
}
.row + .row { border-top: 1px solid var(--line); }
.row-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.row-ico .icon { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 14px; letter-spacing: -.1px; }
.row-main span { font-size: 12px; color: var(--text-3); font-weight: 500; }
.row-side { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.row-side .icon { width: 16px; height: 16px; color: var(--text-3); }
.row.selectable { border-radius: var(--r-sm); padding: 13px 10px; transition: background .15s ease; }
.row.selectable:active { background: var(--surface-2); }
.row.selected { background: color-mix(in srgb, var(--acc-1) 7%, transparent); }
.row.selected .row-ico { color: #fff; background: var(--acc-1); }

.radio-dot {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  display: grid; place-items: center;
  transition: border-color .18s ease, background-color .18s ease;
}
.row.selected .radio-dot { border-color: var(--acc-1); background: var(--acc-1); }
.radio-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0; transform: scale(.4); transition: opacity .18s ease, transform .18s ease; }
.row.selected .radio-dot::after { opacity: 1; transform: none; }

/* ── Лидерборд ── */
/* Аватар участника (инициал или фото) */
.ava {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.2px;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  overflow: hidden;
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Место в топе — маленький бейдж на углу аватара (аватар занял «место») */
.lb-ava { position: relative; flex: none; line-height: 0; }
.lb-badge {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--text-2);
  background: var(--surface);
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(20,28,66,.16);
}
.lb-badge.me-badge { color: #fff; background: var(--acc-1); border-color: var(--acc-1); }
.lb-row .row-main b { font-size: 14.5px; }

/* Переключатель периода (неделя / месяц / год / всё время) */
.seg {
  display: flex; gap: 4px;
  margin-top: 6px;
  padding: 5px;
  background: var(--surface);
  border-radius: 100px;
  box-shadow: var(--shadow-soft);
}
.seg button {
  flex: 1;
  padding: 9px 2px;
  border-radius: 100px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, transform .15s ease;
}
.seg button:active { transform: scale(.95); }
.seg button.on {
  color: #fff;
  background: var(--acc-1);
}

/* Подиум топ-3 */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  gap: 10px;
  align-items: end;
}
.pod {
  position: relative;
  text-align: center;
  background: var(--surface);
  border-radius: 22px;
  padding: 22px 6px 14px;
  box-shadow: var(--shadow-soft);
}
.pod-ava-wrap { position: relative; width: 52px; margin: 0 auto 8px; line-height: 0; }
.pod-ava { width: 52px; height: 52px; font-size: 19px; margin: 0 auto; }
.pod-medal {
  position: absolute;
  right: -5px; bottom: -5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  border: 2.5px solid var(--surface);
}
.pod.p1 { padding-top: 28px; padding-bottom: 18px; background: linear-gradient(180deg, rgba(255, 199, 84, .2), transparent 62%), var(--surface); }
.pod.p1 .pod-ava-wrap { width: 62px; margin-bottom: 10px; }
.pod.p1 .pod-ava { width: 62px; height: 62px; font-size: 23px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05), 0 0 0 3px rgba(244,178,33,.55); }
.pod.p1 .pod-medal { width: 27px; height: 27px; font-size: 13px; color: #7A5200; background: var(--gold-grad); box-shadow: 0 4px 10px rgba(244, 178, 33, .45), inset 0 1px 2px rgba(255,255,255,.65); }
.pod.p2 { background: linear-gradient(180deg, rgba(148, 163, 190, .14), transparent 60%), var(--surface); }
.pod.p2 .pod-ava { box-shadow: inset 0 0 0 1px rgba(0,0,0,.05), 0 0 0 3px rgba(148,163,190,.5); }
.pod.p2 .pod-medal { color: #4E586B; background: var(--silver-grad); box-shadow: 0 3px 8px rgba(120, 136, 165, .35), inset 0 1px 2px rgba(255,255,255,.7); }
.pod.p3 { background: linear-gradient(180deg, rgba(212, 138, 66, .13), transparent 60%), var(--surface); }
.pod.p3 .pod-ava { box-shadow: inset 0 0 0 1px rgba(0,0,0,.05), 0 0 0 3px rgba(212,138,66,.5); }
.pod.p3 .pod-medal { color: #7B4315; background: var(--bronze-grad); box-shadow: 0 3px 8px rgba(196, 128, 62, .35), inset 0 1px 2px rgba(255,255,255,.55); }
.pod-name {
  font-size: 13px; font-weight: 750; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px;
}
.pod.p1 .pod-name { font-size: 14px; }
.pod-count {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--text-2);
}
.pod-count .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.pod-prize { margin-top: 8px; }
.chip-gold {
  color: #7A5200;
  background: var(--gold-grad);
  box-shadow: 0 4px 10px rgba(244, 178, 33, .3), inset 0 1px 1px rgba(255,255,255,.55);
}

/* Задания */
.task-card { display: flex; flex-direction: column; gap: 12px; }
.task-head { display: flex; align-items: flex-start; gap: 12px; }
.task-num {
  width: 42px; height: 42px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.task-num.done { color: #fff; background: var(--ok); }
.task-num.done .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.task-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; line-height: 1.35; }
.task-reward { display: inline-flex; margin-top: 5px; }
.task-progress { display: flex; align-items: center; gap: 12px; }
.task-bar { flex: 1; height: 9px; border-radius: 100px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(20,28,66,.06); }
.task-fill { height: 100%; border-radius: 100px; background: var(--acc-1); transition: width .8s cubic-bezier(.22,.9,.3,1); }
.task-fill.done { background: var(--ok); }
.task-count { font-size: 12.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

/* ── «Плати по миру» — партнёрская страница (монохромный бренд партнёра) ── */
.pm-hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 22px 20px 24px;
  color: #fff;
  background: linear-gradient(160deg, #262A33 0%, #12141A 60%, #0A0C11 100%);
  box-shadow: var(--shadow-soft);
}
.pm-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 100px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pm-badge .icon { width: 14px; height: 14px; stroke-width: 2; }
.pm-h { margin-top: 14px; font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.pm-sub { margin-top: 8px; max-width: 32ch; font-size: 13.5px; line-height: 1.5; font-weight: 500; opacity: .82; }

/* Декоративная карта */
.pm-card {
  position: relative; overflow: hidden;
  margin-top: 20px; height: 156px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3C424E 0%, #191C23 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(255, 255, 255, .12);
}
.pm-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0, rgba(255, 255, 255, .16), transparent 55%);
}
.pm-card > span { position: absolute; z-index: 1; }
.pm-card-brand { top: 16px; left: 18px; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; }
.pm-card-chip {
  top: 50px; left: 18px; width: 38px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #EAD08A, #B8923F);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.pm-card-num { bottom: 40px; left: 18px; font-size: 16.5px; font-weight: 600; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.pm-card-sys { bottom: 16px; right: 18px; font-size: 15px; font-weight: 800; font-style: italic; letter-spacing: .5px; }

.pm-cta {
  margin-top: 20px; width: 100%;
  color: #14161C; background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.pm-cta:active { transform: scale(.97); }

.pm-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 8px; }
.pm-stats > div { position: relative; text-align: center; }
.pm-stats > div + div::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 26px; background: var(--line);
}
.pm-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.pm-stats span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.pm-note { font-size: 11.5px; color: var(--text-3); line-height: 1.5; font-weight: 500; text-align: center; padding: 0 10px; }

/* ── Таббар (liquid glass) ── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 12px);
  z-index: 60;
  width: min(calc(100% - 28px), 420px);
  height: var(--tabbar-h);
  border-radius: 36px;
  display: grid;
  /* Колонки создаются по числу вкладок (одна равная колонка на вкладку), а не
     фиксировано под 4 — так 3 вкладки растягиваются на всю панель без пустого
     места, а при возврате «Плати по миру» станет снова 4. .tab-drop вне потока
     (position:absolute), поэтому в раскладке колонок не участвует. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  padding: 8px;
}
.tab {
  position: relative;
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 26px;
  color: var(--text-2);
  font-weight: 650;
  transition: color .22s ease, transform .15s ease;
}
.tab span { font-size: 10px; letter-spacing: 0; white-space: nowrap; }
.tab:active { transform: scale(.94); }
.tab .icon { width: 22px; height: 22px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.tab.active { color: var(--acc-1); }
.tab.active .icon { transform: translateY(-1px) scale(1.06); stroke-width: 2.1; }

/* Капля-индикатор активной вкладки: жидкая стеклянная линза.
   Двухслойная схема: внешний .tab-drop только ЕДЕТ (translateX), внутреннее
   стеклянное ядро .drop-glass только РАСТЯГИВАЕТСЯ (scale). Так растяжение
   не искажает траекторию (scale, применённый к одному элементу вместе с
   translateX, масштабирует и саму дистанцию — капля «улетала» мимо вкладки).
   Позицию и размер под активной вкладкой задаёт moveDrop() в app.js. */
.tab-drop {
  position: absolute;
  top: 8px; left: 0;
  height: calc(100% - 16px);
  width: calc((100% - 16px) / 4);
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  transition:
    transform .55s cubic-bezier(.3, 1.35, .35, 1),
    width .3s ease;
}
/* Стеклянное ядро: почти прозрачное, объём дают преломление фона и блики */
.drop-glass {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 100px;
  background: var(--drop-bg);
  box-shadow: var(--drop-shadow);
  -webkit-backdrop-filter: var(--drop-filter);
  backdrop-filter: var(--drop-filter);
  will-change: transform;
  /* пружинная «посадка» после растяжения — желейный overshoot */
  transition: transform .5s cubic-bezier(.3, 1.6, .4, 1);
}
/* Верхний спекулярный блик — симметричная дуга по своду линзы */
.drop-glass::before {
  content: '';
  position: absolute;
  left: 9%; right: 9%; top: 2px;
  height: 46%;
  border-radius: 100px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 92%);
  opacity: var(--drop-spec);
}
/* Нижняя каустика — линза собирает свет у основания */
.drop-glass::after {
  content: '';
  position: absolute;
  left: 16%; right: 16%; bottom: 2px;
  height: 30%;
  border-radius: 100px;
  background: radial-gradient(52% 100% at 50% 100%, rgba(255, 255, 255, .6), transparent 72%);
  opacity: calc(var(--drop-spec) * .65);
}
/* Фаза полёта: ядро вытягивается по ходу движения и сплющивается, как
   жидкость; позиция при этом не искажается — тянется только ядро */
.tab-drop.drop-stretch .drop-glass {
  transform: scale(1.22, .84);
  transition: transform .2s cubic-bezier(.4, 0, .6, 1);
}
@media (prefers-reduced-motion: reduce) {
  .tab-drop, .drop-glass, .tab-drop.drop-stretch .drop-glass { transition: none; transform: none; }
}

/* ── Шторки (bottom sheets) ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(12, 15, 30, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  will-change: opacity; /* слой готов заранее — фейд без рывка первого кадра */
  transition: opacity .3s ease;
}
.sheet-backdrop.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%; transform: translate(-50%, 108%);
  bottom: calc(var(--safe-b) + 8px);
  z-index: 90;
  width: min(calc(100% - 16px), 464px);
  max-height: calc(var(--tg-viewport-stable-height, 100vh) - 60px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  will-change: transform; /* выезд шторки целиком на компоузере */
  transition: transform .38s cubic-bezier(.22,.9,.28,1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4.5px; border-radius: 100px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px 4px;
  flex: none;
}
.sheet-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.sheet-close { color: var(--text-3); background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sheet-close .icon { width: 15px; height: 15px; stroke-width: 2.3; display: block; }
.sheet-body { padding: 12px 18px calc(18px + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-note { font-size: 12.5px; color: var(--text-3); line-height: 1.5; font-weight: 500; }

/* ── Продление подписки: список тарифов как отдельные карточки-опции ── */
.plan-list { display: flex; flex-direction: column; gap: 9px; }
.plan-list .row.selectable {
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.plan-list .row.selectable:active { transform: scale(.985); }
.plan-list .row.selected {
  background: color-mix(in srgb, var(--acc-1) 8%, var(--surface));
  border-color: var(--acc-1);
}

/* ── Оплата: премиальная карточка суммы + пункты доверия ── */
.pay-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  color: #fff; text-align: center;
  background: var(--grad-acc);
  box-shadow: var(--shadow-soft), inset 0 1px 1.5px rgba(255, 255, 255, .4);
}
.pay-card::before {
  content: ''; position: absolute;
  width: 260px; height: 260px; top: -150px; right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .34), rgba(255, 255, 255, .04) 62%, transparent 70%);
}
.pay-card-label { position: relative; z-index: 1; font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; opacity: .85; }
.pay-card-sum { position: relative; z-index: 1; font-size: 42px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.04; margin-top: 6px; }
.pay-card-plan { position: relative; z-index: 1; font-size: 13.5px; font-weight: 500; opacity: .9; margin-top: 7px; }
.pay-card-glow { position: absolute; right: -14px; bottom: -24px; z-index: 0; opacity: .16; color: #fff; }
.pay-card-glow .icon { width: 120px; height: 120px; stroke-width: 1.1; }

.trust-list { display: flex; flex-direction: column; margin-top: 16px; }
.trust { display: flex; align-items: center; gap: 12px; padding: 11px 2px; }
.trust + .trust { border-top: 1px solid var(--line); }
.t-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--acc-1); background: var(--grad-acc-soft);
}
.t-ico .icon { width: 19px; height: 19px; }
.trust > div { min-width: 0; }
.trust b { display: block; font-size: 14px; letter-spacing: -.1px; }
.trust > div > span { display: block; margin-top: 1px; font-size: 12px; color: var(--text-3); font-weight: 500; }

/* Выбор тарифа в шторке */
.plan-pick {
  display: flex; align-items: center; gap: 13px;
  width: 100%;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  margin-bottom: 11px;
  transition: transform .16s ease, box-shadow .2s ease;
}
.plan-pick:active { transform: scale(.97); }
.plan-pick .plan-ico { width: 46px; height: 46px; border-radius: 16px; }
.plan-pick b { font-size: 15px; display: block; letter-spacing: -.15px; }
.plan-pick span { font-size: 12px; color: var(--text-2); font-weight: 500; line-height: 1.4; display: block; margin-top: 2px; }
.plan-pick .icon.chev { color: var(--text-3); width: 18px; height: 18px; }

/* Инпуты */
.field { margin: 12px 0; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 0 4px 7px; }
.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: var(--surface-2);
  font-size: 15px; font-weight: 600;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus { border-color: var(--acc-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc-1) 12%, transparent); }
.field input::placeholder { color: var(--text-3); font-weight: 500; }

/* Итог оплаты */
.total-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px;
  border-radius: var(--r-sm);
  background: var(--grad-acc-soft);
  font-weight: 700; font-size: 14px;
  margin-top: 10px;
}
.total-line b { font-size: 19px; font-weight: 800; letter-spacing: -.4px; color: var(--acc-1); }

/* QR */
.qr-wrap {
  display: grid; place-items: center;
  margin: 12px auto;
  padding: 18px;
  width: fit-content;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.qr-wrap img, .qr-wrap canvas { border-radius: 8px; display: block; }

/* Шаги инструкции */
.step-row { display: flex; gap: 13px; padding: 12px 0; }
.step-row + .step-row { border-top: 1px solid var(--line); }
.step-n {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13.5px; font-weight: 800;
  color: var(--acc-1);
  background: var(--grad-acc-soft);
}
.step-row p { font-size: 13.5px; line-height: 1.5; color: var(--text-2); font-weight: 500; padding-top: 4px; }
.step-row p b { color: var(--text); }

/* Список устройств: прокручивается, если их много (15+) */
.dev-list {
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px;
}

/* Меню профиля: шапка + список настроек (стиль как в настройках Telegram) */
.prof-head { display: flex; align-items: center; gap: 14px; padding: 2px 2px 16px; }
.prof-ava { width: 54px; height: 54px; font-size: 21px; }
.prof-id { min-width: 0; }
.prof-id b { display: block; font-size: 18px; font-weight: 750; letter-spacing: -.3px; }
.prof-id span { display: block; margin-top: 1px; font-size: 13px; color: var(--text-3); font-weight: 500; }

.set-list { padding: 6px 14px; }
.set-row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 11px 2px; transition: opacity .15s ease; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row:active { opacity: .55; }
.set-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
}
.set-ico .icon { width: 21px; height: 21px; stroke-width: 2; }
.set-label { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.set-row .chev { color: var(--text-3); width: 19px; height: 19px; flex: none; }

/* Успех */
.success-box { text-align: center; padding: 12px 0 6px; }
.success-ico {
  width: 74px; height: 74px;
  margin: 6px auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #2EBD85, #1FA873);
  box-shadow: 0 14px 32px rgba(46,189,133,.38), inset 0 1px 2px rgba(255,255,255,.5);
  animation: pop-in .45s cubic-bezier(.34,1.56,.64,1);
}
.success-ico .icon { width: 34px; height: 34px; stroke-width: 2.4; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.success-box h4 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 7px; }
.success-box p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; font-weight: 500; }

/* Тост */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 30px);
  transform: translate(-50%, 16px);
  z-index: 120;
  padding: 12px 20px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity .28s ease, transform .28s cubic-bezier(.22,.9,.3,1);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Кнопка-дублёр MainButton (только предпросмотр в браузере) */
/* Дублёр Telegram MainButton для браузера. MainButton живёт только в шторках,
   поэтому кнопка закреплена у нижнего края поверх шторки (z-index выше .sheet). */
.fallback-main {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 14px);
  z-index: 100;
  width: min(calc(100% - 32px), 432px);
  padding: 16px;
  border-radius: 19px;
  color: #fff;
  font-size: 15px; font-weight: 800; letter-spacing: -.1px;
  background: var(--grad-acc);
  box-shadow: var(--shadow-float), inset 0 1px 1.5px rgba(255,255,255,.5);
  transition: transform .16s ease;
}
.fallback-main:active { transform: translateX(-50%) scale(.97); }

/* Промо-баннер (создание промокода / пробный период) */
.banner {
  border-radius: var(--r-lg);
  padding: 17px;
  display: flex; align-items: center; gap: 13px;
  background: var(--grad-acc-soft);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), var(--shadow-soft);
  overflow: hidden;
  position: relative;
  text-align: left;
  width: 100%;
}
.banner-ico {
  width: 46px; height: 46px; flex: none;
  border-radius: 16px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--acc-1);
}
.banner-ico .icon { width: 22px; height: 22px; }
/* Статичный баннер (просто блок, не кнопка) */
.banner-static { cursor: default; }
.banner-text { flex: 1; min-width: 0; }
.banner-text b { font-size: 14px; display: block; letter-spacing: -.1px; }
.banner-text span { font-size: 12px; color: var(--text-2); font-weight: 500; display: block; margin-top: 2px; line-height: 1.4; }
.banner .icon.chev { color: var(--text-3); width: 18px; height: 18px; margin-left: auto; }

/* Хелперы */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.muted { color: var(--text-3); font-size: 12px; font-weight: 500; }
.hidden { display: none !important; }
.stat-strip { display: flex; gap: 10px; }
.stat-box {
  flex: 1;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.stat-box b { font-size: 21px; font-weight: 800; letter-spacing: -.5px; display: block; }
.stat-box b em { font-style: normal; color: var(--acc-1); }
.stat-box span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
