/* ─────────────────────────────────────────────────────────────
   RapfionVPN · Mini App

   Это мобильное приложение, а не страница: шапка и нижняя панель
   закреплены, скроллится только содержимое активного экрана.
   Разделы переключаются кнопками внизу — экраны не идут друг за
   другом одной лентой.

   Тема всегда тёмная и не подстраивается под Telegram: свечение и
   стекло в светлой теме разваливаются. Акцент один — холодный
   ледяной свет, и только на свет, не на заливку текста.
   ───────────────────────────────────────────────────────────── */

:root {
  --ink:        #ffffff;
  --ink-2:      rgba(255,255,255,.74);
  --ink-3:      rgba(255,255,255,.46);
  --ink-4:      rgba(255,255,255,.30);

  --bg:         #04050a;
  --bg-2:       #090b12;

  --ice:        #8fd0ff;
  --ice-2:      #6ab8ff;
  --ice-dim:    rgba(143,208,255,.42);
  --ice-faint:  rgba(143,208,255,.13);

  --glass:      rgba(255,255,255,.055);
  --glass-2:    rgba(255,255,255,.02);
  --edge:       rgba(255,255,255,.11);
  --edge-soft:  rgba(255,255,255,.06);

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 12px;

  --ease: cubic-bezier(.22,.68,.32,1);
  --pad: 18px;
  --dock-h: 78px;

  --shadow:   0 24px 54px -30px rgba(0,0,0,.95);
  --shadow-2: 0 12px 30px -18px rgba(0,0,0,.9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;                 /* скроллит экран, а не документ */
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Фон ─────────────────────────────────────────────────────
   Три холодных пятна, тонкая сетка и зерно. Пятна медленно
   плывут — иначе тёмный фон выглядит мёртвой заливкой.        */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }

.aurora { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.aurora-a {
  width: 420px; height: 420px; top: -170px; left: -130px;
  background: radial-gradient(circle, rgba(255,255,255,.10), transparent 68%);
  animation: drift-a 22s var(--ease) infinite alternate;
}
.aurora-b {
  width: 380px; height: 380px; bottom: -150px; right: -140px;
  background: radial-gradient(circle, rgba(106,184,255,.16), transparent 70%);
  animation: drift-b 26s var(--ease) infinite alternate;
}
.aurora-c {
  width: 320px; height: 320px; top: 26%; left: 50%; margin-left: -160px;
  background: radial-gradient(circle, rgba(143,208,255,.10), transparent 72%);
  animation: drift-c 19s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate(40px, 60px) scale(1.12) } }
@keyframes drift-b { to { transform: translate(-50px, -40px) scale(1.08) } }
@keyframes drift-c { to { transform: translate(0, -70px) scale(.92) } }

/* Сетка: даёт ощущение «технического» интерфейса, к низу растворяется */
.mesh {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
}

/* Плёночное зерно: убирает «пластиковость» плоских тёмных фонов */
.grain {
  position: absolute; inset: -50%;
  opacity: .045; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 6s steps(5) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0) }
  20% { transform: translate(-2%,2%) }
  40% { transform: translate(2%,-2%) }
  60% { transform: translate(-1%,-2%) }
  80% { transform: translate(2%,1%) }
}

/* ── Экран загрузки ──────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.splash-ring {
  position: absolute;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(143,208,255,.18), transparent 70%);
  filter: blur(24px);
  animation: breathe 2.4s var(--ease) infinite;
}
.splash-logo {
  width: 104px; height: 104px; object-fit: contain; position: relative;
  filter: drop-shadow(0 8px 34px rgba(143,208,255,.32));
  animation: breathe 2.4s var(--ease) infinite;
}
.splash-text { margin: 0; font-size: 13px; color: var(--ink-4); position: relative; }
@keyframes breathe {
  0%,100% { opacity: .6; transform: scale(.95) }
  50%     { opacity: 1;  transform: scale(1) }
}
.splash-fail { padding: 0 24px; text-align: center; position: relative; }
.splash-fail p { margin: 0 0 10px; font-size: 15px; color: var(--ink-2); }
.splash-fail small { display: block; margin-bottom: 20px; font-size: 12.5px; color: var(--ink-4); }

/* ── Оболочка ────────────────────────────────────────────── */
#shell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100dvh;
}

/* ── Шапка ───────────────────────────────────────────────── */
.topbar {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 12px;
  background: linear-gradient(180deg, rgba(4,5,10,.92), rgba(4,5,10,.5) 70%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mark {
  width: 28px; height: 28px; flex: none; object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(143,208,255,.35));
}
.wordmark { flex: 1; font-size: 16px; letter-spacing: -.2px; }
.wordmark b { font-weight: 600; }
.wordmark span { font-weight: 300; color: var(--ink-3); }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--glass); color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  transition: transform .2s var(--ease), color .2s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:active { transform: scale(.92); color: var(--ink); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.wallet {
  flex: none;
  padding: 9px 14px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--glass); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  font: 600 13px/1 inherit; font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: transform .2s var(--ease);
}
.wallet b { color: var(--ink); }
.wallet:active { transform: scale(.94); }

/* ── Экраны ──────────────────────────────────────────────── */
#screens { position: relative; flex: 1; min-height: 0; }

.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  opacity: 0; transform: translateY(12px);
  pointer-events: none; visibility: hidden;
  transition: opacity .24s var(--ease), transform .28s var(--ease), visibility .28s;
}
.screen.is-active {
  opacity: 1; transform: none;
  pointer-events: auto; visibility: visible;
}
.screen-inner {
  padding: 4px var(--pad) calc(var(--dock-h) + 34px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}

/* Содержимое появляется лесенкой при каждом переключении экрана */
.screen.is-active .screen-inner > * {
  animation: rise .42s var(--ease) backwards;
}
.screen.is-active .screen-inner > *:nth-child(1) { animation-delay: .02s }
.screen.is-active .screen-inner > *:nth-child(2) { animation-delay: .06s }
.screen.is-active .screen-inner > *:nth-child(3) { animation-delay: .10s }
.screen.is-active .screen-inner > *:nth-child(4) { animation-delay: .14s }
.screen.is-active .screen-inner > *:nth-child(5) { animation-delay: .18s }
.screen.is-active .screen-inner > *:nth-child(n+6) { animation-delay: .2s }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } }

/* ── Типографика ─────────────────────────────────────────── */
.eyebrow, .label {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .19em; text-transform: uppercase;
  color: var(--ink-4);
}
.hello { padding: 14px 2px 2px; }
.hello .eyebrow { margin: 0 0 8px; }
.display {
  margin: 0; font-size: clamp(28px, 8.6vw, 34px);
  font-weight: 300; letter-spacing: -.03em; line-height: 1.05;
}
.screen-title {
  margin: 16px 2px 4px;
  font-size: 26px; font-weight: 300; letter-spacing: -.03em;
}
h2 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.note { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-4); }
.empty-text { margin: 0 0 4px; font-size: 14px; color: var(--ink-3); }

/* ── Карточки ────────────────────────────────────────────
   Стекло настоящее: размытие с подъёмом насыщенности, светящаяся
   градиентная кромка по контуру (маской, поэтому радиус любой) и
   блик сверху. Плюс зерно внутри — чтобы не выглядело пластиком. */
.card {
  position: relative; isolation: isolate;
  padding: 18px; border-radius: var(--r-xl);
  background: linear-gradient(168deg, var(--glass), var(--glass-2));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(158deg,
    rgba(255,255,255,.26), rgba(255,255,255,.05) 36%,
    rgba(143,208,255,.14) 70%, rgba(255,255,255,.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

/* Заголовок карточки с иконкой */
.ch { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.ch h2 { flex: 1; }
.ch-ico {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(255,255,255,.07); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
}
.ch-ico svg { width: 16px; height: 16px; }

/* ── Герой ───────────────────────────────────────────────── */
.card-hero { padding: 16px 16px 20px; text-align: center; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-4); transition: background .3s, box-shadow .3s;
}
.pill.on { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ice-dim); }
.pill.on .pill-dot {
  background: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-faint), 0 0 12px var(--ice);
  animation: blink 2.6s var(--ease) infinite;
}
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.pill-ghost { color: var(--ink-4); }

.stage { position: relative; margin: 6px auto 0; max-width: 290px; }
.stage-glow {
  position: absolute; inset: 12%;
  border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(143,208,255,.34), transparent 68%);
  filter: blur(26px);
  transition: opacity .6s var(--ease);
}
.stage.is-on .stage-glow { opacity: 1; animation: pulse-glow 4.5s var(--ease) infinite; }
@keyframes pulse-glow { 0%,100% { opacity: .55 } 50% { opacity: 1 } }

.stage-svg { width: 100%; display: block; overflow: visible; }

/* Насечки по кругу — пунктирная окружность, а не полсотни линий в разметке.
   Внешняя медленно вращается, внутренняя стоит: получается «прибор». */
.ticks {
  fill: none; stroke: rgba(255,255,255,.14); stroke-width: 1.5;
  stroke-dasharray: 1.5 12;
  transform-origin: 160px 160px;
  animation: spin 90s linear infinite;
}
.ticks-fine {
  stroke: rgba(255,255,255,.07); stroke-width: 1;
  stroke-dasharray: 1 7; animation: none;
}
.core { opacity: .9; }

.track { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 4; }
.progress {
  fill: none; stroke: url(#gRing); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 829.4;               /* 2πr, r = 132 */
  stroke-dashoffset: 829.4;
  transform: rotate(-90deg); transform-origin: 160px 160px;
  filter: drop-shadow(0 0 9px rgba(143,208,255,.7));
  transition: stroke-dashoffset 1.3s var(--ease);
}

.readout {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.readout-value {
  font-size: 60px; font-weight: 200; letter-spacing: -.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 40px rgba(143,208,255,.35);
}
.readout-unit {
  margin-top: 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .19em;
  text-transform: uppercase; color: var(--ink-4);
}
.readout-clock {
  margin-top: 8px; font-size: 12px; font-weight: 300;
  letter-spacing: .1em; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.hero-note { margin: 14px auto 0; max-width: 280px; font-size: 13px; color: var(--ink-3); }

/* Полоса срока: заполнение = сколько от периода осталось */
.bar {
  height: 5px; margin-top: 16px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
}
.bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--ice-2), #eaf6ff);
  box-shadow: 0 0 14px -1px var(--ice-dim);
  transition: width 1.1s var(--ease);
}
.bar-legend {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums;
}
/* Шкала трафика идёт второй, поэтому отступ сверху меньше — две шкалы
   подряд с одинаковым зазором читаются как один непонятный блок. */
.bar-traffic { margin-top: 10px; }
/* Меньше 15 % остатка — гасим ледяной свет и подсвечиваем тревожным.
   Это единственное место в приложении, где акцент не холодный. */
.bar-traffic.is-low i {
  background: linear-gradient(90deg, #d98b5f, #f3c69b);
  box-shadow: 0 0 14px -1px rgba(217,139,95,.5);
}

.hero-cta { display: grid; gap: 10px; grid-auto-flow: column; margin-top: 18px; }
.hero-cta:empty { display: none; }

/* ── Плитки ──────────────────────────────────────────────────
   minmax(0, 1fr), а не 1fr: иначе длинное неразрывное слово в
   подписи задаёт колонке свою минимальную ширину, и сетка
   вылезает за карточку.                                        */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative; isolation: isolate;
  padding: 14px; border-radius: var(--r-lg);
  background: linear-gradient(168deg, var(--glass), var(--glass-2));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.02) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.tile-ico {
  display: grid; place-items: center;
  width: 28px; height: 28px; margin-bottom: 10px;
  border-radius: 9px; color: var(--ink-3);
  background: rgba(255,255,255,.06);
}
.tile-ico svg { width: 15px; height: 15px; }
.tile .label { display: block; margin-bottom: 6px; overflow-wrap: anywhere; }
.tile b {
  display: block;
  font-size: 15px; font-weight: 500; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tile small { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-4); }

/* ── Факты о защите ──────────────────────────────────────── */
.facts { display: grid; }
.fact { padding: 11px 0; border-top: 1px solid var(--edge-soft); }
.fact:first-child { border-top: 0; padding-top: 0; }
.fact b { display: block; font-size: 14px; font-weight: 500; }
.fact small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ink-4); }

/* ── Кнопки ──────────────────────────────────────────────── */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border: 0; border-radius: 14px;
  font: 600 14px/1 inherit; font-family: inherit;
  cursor: pointer; transition: transform .14s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-solid {
  background: linear-gradient(180deg, #ffffff, #d7e5f2);
  color: #04070c;
  box-shadow: 0 10px 26px -14px rgba(143,208,255,.9), inset 0 1px 0 rgba(255,255,255,.9);
}
/* Диагональный блик по кнопке — тонкая подсветка объёма */
.btn-solid::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 72% { transform: translateX(-120%) } 88%, 100% { transform: translateX(120%) } }
.btn-outline {
  background: rgba(255,255,255,.04); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge);
}
.btn-ghost { background: rgba(255,255,255,.05); color: var(--ink-2); }
.btn-wide { width: 100%; margin-top: 14px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-row .btn { width: 100%; }
.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font: 600 12px/1 inherit; font-family: inherit;
}
.link-btn:active { color: var(--ink); }

/* ── Баланс ──────────────────────────────────────────────── */
.card-balance .bal-row { display: flex; align-items: center; justify-content: space-between; }
.bal-value { margin-top: 8px; font-size: 34px; font-weight: 200; letter-spacing: -.04em; }
.bal-value b { font-weight: 200; font-variant-numeric: tabular-nums; }
.bal-ico {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; color: var(--ice);
  background: var(--ice-faint);
  box-shadow: inset 0 0 0 1px var(--ice-dim);
}
.bal-ico svg { width: 21px; height: 21px; }

/* ── Тарифы ──────────────────────────────────────────────── */
.plan-list { display: grid; gap: 10px; }
.plan {
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 16px; border: 0; cursor: pointer;
  border-radius: var(--r-lg); text-align: left;
  background: linear-gradient(168deg, var(--glass), var(--glass-2));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--ink);
  font-family: inherit;
  transition: transform .14s var(--ease);
}
.plan::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.02) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.plan:active { transform: scale(.985); }
.plan:disabled { opacity: .5; }
.plan-left { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.plan-title { font-size: 15.5px; font-weight: 500; letter-spacing: -.015em; }
.plan-sub { font-size: 12.5px; color: var(--ink-4); }
.plan-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.plan-price { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-hint {
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ice-dim);
}
.plan.is-best::before {
  background: linear-gradient(160deg, rgba(143,208,255,.5), rgba(143,208,255,.08) 60%);
}
.badge {
  margin-left: 8px; padding: 3px 8px; border-radius: 7px;
  font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--ice-faint); color: var(--ice);
  box-shadow: inset 0 0 0 1px var(--ice-dim);
}
.plan-trial::before {
  background: linear-gradient(160deg, rgba(255,255,255,.34), rgba(143,208,255,.16) 70%);
}

/* Карточка своей подписки */
.plan-name { font-size: 26px; font-weight: 300; letter-spacing: -.03em; margin-bottom: 12px; }
.perks { list-style: none; margin: 0; padding: 0; }
.perks li { position: relative; padding: 6px 0 6px 24px; font-size: 13.5px; color: var(--ink-2); }
.perks li::before {
  content: ""; position: absolute; left: 2px; top: 11px;
  width: 10px; height: 5.5px;
  border-left: 1.6px solid var(--ice); border-bottom: 1.6px solid var(--ice);
  transform: rotate(-45deg);
}
.plan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--edge-soft);
}
.plan-until { font-size: 11px; color: var(--ink-4); }
.plan-until b {
  display: block; margin-top: 3px; font-size: 14px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.plan-foot .btn { padding: 12px 20px; }

/* ── Ключ ────────────────────────────────────────────────── */
.key-view {
  padding: 13px 15px; border-radius: var(--r-md);
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  max-height: 92px; overflow-y: auto;
}
.key-view::-webkit-scrollbar { width: 0; }
.key-view code {
  font: 11px/1.6 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink-3); word-break: break-all;
}
.qr-panel { margin-top: 16px; text-align: center; }
.qr-frame {
  display: inline-block; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: 0 0 44px -12px rgba(143,208,255,.6);
}
.qr-panel img { width: 180px; height: 180px; display: block; }
.qr-panel p { margin: 10px 0 0; font-size: 12px; color: var(--ink-4); }

/* ── Строки «параметр — значение» ────────────────────────── */
.rows {
  border-radius: var(--r-md); padding: 2px 14px;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
}
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--edge-soft);
  font-size: 13px; color: var(--ink-4);
}
.row:first-child { border-top: 0; }
.row b {
  color: var(--ink); font-size: 13.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#ip-result { margin-top: 14px; }

/* ── Профиль ─────────────────────────────────────────────── */
.card-user { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid var(--edge);
  background: linear-gradient(150deg, rgba(255,255,255,.14), rgba(255,255,255,.02));
  color: var(--ink-2); font: 600 19px/1 inherit;
  box-shadow: 0 0 0 4px rgba(143,208,255,.07);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta b { display: block; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.user-meta small { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-4); }

.toggle-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; cursor: pointer;
  border-top: 1px solid var(--edge-soft);
}
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.toggle-body { flex: 1; min-width: 0; }
.toggle-body b { display: block; font-size: 14px; font-weight: 500; }
.toggle-body small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--ink-4); }

.switch { position: relative; flex: none; width: 46px; height: 27px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; pointer-events: none;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  transition: background .25s var(--ease), box-shadow .25s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #cfd9e3);
  transition: transform .25s var(--ease);
}
.switch input:checked + i {
  background: rgba(143,208,255,.3);
  box-shadow: inset 0 0 0 1px var(--ice-dim), 0 0 18px -6px var(--ice);
}
.switch input:checked + i::after { transform: translateX(19px); }

.card-refer .refer-head { display: flex; align-items: center; gap: 14px; }
.refer-num {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center; border-radius: 16px;
  font-size: 22px; font-weight: 300;
  background: var(--ice-faint); color: var(--ice);
  box-shadow: inset 0 0 0 1px var(--ice-dim);
  font-variant-numeric: tabular-nums;
}
.card-refer b { display: block; font-size: 15px; font-weight: 500; }
.card-refer small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--ink-4); }

/* История операций */
.op { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--edge-soft); }
.op:first-child { border-top: 0; padding-top: 0; }
.op-ico {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  background: rgba(255,255,255,.06); color: var(--ink-3);
}
.op-ico svg { width: 16px; height: 16px; }
.op-body { flex: 1; min-width: 0; }
.op-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-date { margin-top: 2px; font-size: 11.5px; color: var(--ink-4); }
.op-sum { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-sum.plus { color: var(--ice); }
.op-sum.minus { color: var(--ink-2); }

/* Админ-сводка: подписи здесь длиннее обычных, поэтому разрядка меньше,
   а колонки жёстко ограничены по минимуму — карточка не должна распираться. */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-grid .tile { padding: 13px 12px; }
.admin-grid .label { letter-spacing: .1em; }
.admin-grid b { font-size: 18px; font-weight: 300; letter-spacing: -.03em; }

/* ── Помощь ──────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 5px; padding: 5px; border-radius: 15px;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
}
.tab {
  flex: 1; padding: 9px 3px; border: 0; border-radius: 11px; cursor: pointer;
  background: none; color: var(--ink-4);
  font: 600 11.5px/1 inherit; font-family: inherit;
  transition: color .2s, background .25s var(--ease);
}
.tab.is-active {
  background: rgba(255,255,255,.1); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid var(--edge-soft); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.step-n {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 9px;
  font-size: 11px; font-weight: 700; color: var(--ice);
  background: var(--ice-faint);
  box-shadow: inset 0 0 0 1px var(--ice-dim);
}
.steps b { display: block; font-size: 14px; font-weight: 500; }
.steps p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-4); }

.faq-item { border-top: 1px solid var(--edge-soft); }
.faq-item:first-child { border-top: 0; }
.faq-item summary {
  position: relative; padding: 13px 24px 13px 0; cursor: pointer;
  font-size: 13.5px; font-weight: 500; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 4px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--ink-4); border-bottom: 1.5px solid var(--ink-4);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq-item p { margin: 0 0 13px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

/* ── Нижняя навигация ────────────────────────────────────
   Плавающая панель: закреплена, экраны переключаются мгновенно.  */
.dock {
  position: fixed; z-index: 20;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--dock-h);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 6px; border-radius: 24px;
  background: rgba(12,14,20,.82);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 -6px 30px -12px rgba(0,0,0,.9),
              0 0 0 1px rgba(255,255,255,.05);
}
.dock-item {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 2px; border: 0; background: none; cursor: pointer;
  color: var(--ink-4); font-family: inherit;
  transition: color .25s var(--ease), transform .16s var(--ease);
}
.dock-item svg { width: 21px; height: 21px; }
.dock-item span { font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.dock-item:active { transform: scale(.9); }
.dock-item.is-active { color: var(--ink); }
.dock-item.is-active::before {
  content: ""; position: absolute; top: 4px; left: 50%;
  width: 26px; height: 3px; margin-left: -13px; border-radius: 999px;
  background: var(--ice);
  box-shadow: 0 0 12px var(--ice);
}

/* Ключ — акцентная кнопка по центру */
.dock-key {
  flex: none;
  width: 58px; height: 58px; margin: 0 4px;
  display: grid; place-items: center;
  border: 0; border-radius: 20px; cursor: pointer;
  background: linear-gradient(180deg, #ffffff, #cfe0f0);
  color: #04070c;
  box-shadow: 0 12px 28px -10px rgba(143,208,255,.75), inset 0 1px 0 rgba(255,255,255,.9);
  transition: transform .16s var(--ease);
}
.dock-key svg { width: 24px; height: 24px; }
.dock-key:active { transform: scale(.92); }
.dock-key.is-active { box-shadow: 0 12px 34px -8px rgba(143,208,255,1), inset 0 1px 0 rgba(255,255,255,.9); }

/* ── Шторка ──────────────────────────────────────────────── */
.sheet-root { position: fixed; inset: 0; z-index: 40; }
.sheet-veil {
  position: absolute; inset: 0; opacity: 0;
  background: rgba(2,3,6,.74);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .28s var(--ease);
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86dvh; overflow-y: auto;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #12151d, #07090e);
  box-shadow: 0 -18px 60px -20px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.1);
  transform: translateY(101%);
  transition: transform .32s var(--ease);
}
.sheet-root.open .sheet-veil { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 36px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: rgba(255,255,255,.16); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 17px; }
.sheet-close {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.06); color: var(--ink-3);
}
.sheet-close svg { width: 17px; height: 17px; }
.sheet-body { margin-top: 16px; }
.sheet-foot .btn:first-child { margin-top: 18px; }

.sum { border-radius: var(--r-md); padding: 2px 15px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--edge-soft); }
.sum-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--edge-soft);
  font-size: 13px; color: var(--ink-3);
}
.sum-row:first-child { border-top: 0; }
.sum-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-row b.warn { color: var(--ice); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.chip-btn {
  padding: 11px 16px; border: 0; border-radius: 13px; cursor: pointer;
  background: rgba(255,255,255,.05); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  font: 600 13px/1 inherit; font-family: inherit; font-variant-numeric: tabular-nums;
  transition: transform .14s var(--ease), color .2s;
}
.chip-btn:active { transform: scale(.95); }
.chip-btn.is-active {
  color: var(--ink); background: var(--ice-faint);
  box-shadow: inset 0 0 0 1px var(--ice-dim);
}

.field { display: block; margin-top: 16px; }
.field span {
  display: block; margin-bottom: 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .19em;
  text-transform: uppercase; color: var(--ink-4);
}
.field input {
  width: 100%; padding: 14px 16px; border: 0; border-radius: 14px;
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px var(--edge-soft);
  color: var(--ink); font: 500 15px/1 inherit; font-family: inherit;
  outline: none; transition: box-shadow .25s var(--ease);
}
.field input:focus { box-shadow: inset 0 0 0 1px var(--ice-dim), 0 0 24px -10px var(--ice); }
.field input::placeholder { color: var(--ink-4); }

/* ── Всплывашка ──────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 50;
  left: 50%; bottom: calc(var(--dock-h) + 26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 14px;
  background: rgba(244,248,252,.97); color: #04070c;
  font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  box-shadow: 0 18px 44px -16px rgba(0,0,0,.9);
  transition: .3s var(--ease);
  max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Спокойный режим ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .aurora, .grain, .ticks, .splash-logo, .splash-ring,
  .stage.is-on .stage-glow, .pill.on .pill-dot, .btn-solid::after,
  .icon-btn.spin svg { animation: none !important; }
  .screen, .sheet, .sheet-veil, .bar i, .progress, .switch i, .switch i::after { transition: none; }
  .screen.is-active .screen-inner > * { animation: none; }
}
