/* ============================================================
   GHOSTLINK — КАБИНЕТ В TELEGRAM

   Оформление снято с сайта один в один: тот же живой градиент,
   те же шрифты, те же появления и та же прозрачность. Заливок нет
   ни у одной карточки — фон виден насквозь, форму держит волосяная
   грань. Непрозрачны только две плавающие вещи: шапка и полоса
   разделов, иначе под ними читается текст, который они перекрывают.

   Порядок разделов:
     1. Шрифты и переменные
     2. Живой градиент и зерно
     3. Каркас: шапка, тело, полоса разделов
     4. Примитивы: кнопки, пилюли, поля, появления
     5. Разделы: главная, тарифы, статус, аккаунт
   ============================================================ */

@font-face {
  font-family: 'Benzin';
  src: url('./fonts/Benzin-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NauryzRedKeds';
  src: url('./fonts/NauryzRedKeds.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-400-cyrillic.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-500-cyrillic.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-700-cyrillic.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --ang {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --ink: #eef2ff;
  --bg: #04081a;
  --deep: #0a1028;
  --mut: #9fabd6;
  --soft: #c6d1f0;
  --blue: #4860ac;
  --glow: #d6e1f8;

  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;

  --green-text: #4ade80;
  --amber-text: #fbbf24;
  --red-text: #f87171;

  --line: rgba(238, 242, 255, 0.14);
  --line-soft: rgba(238, 242, 255, 0.09);

  --pad: clamp(16px, 5vw, 28px);
  --tabbar: 74px;

  --ui: "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, sans-serif;
  --display: "Benzin", sans-serif;
  --accent: "NauryzRedKeds", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Мини-апп прокручивается внутри Telegram: свою прокрутку тянет тело,
     иначе на iOS страница «отлипает» от низа при закрытии клавиатуры. */
  overscroll-behavior-y: contain;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }

::selection { background: var(--ink); color: var(--deep); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 4px; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   ЖИВОЙ ГРАДИЕНТ
   Пять пятен и конический слой. Длительности взаимно простые,
   поэтому рисунок практически не повторяется.
   ============================================================ */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(125% 95% at 50% -10%, #111c45 0%, #0a1028 42%, #04081a 100%);
}

.aurora i {
  position: absolute;
  display: block;
  border-radius: 44% 56% 62% 38% / 52% 44% 56% 48%;
  filter: blur(80px);
}

.aurora .a1 {
  width: max(62vw, 54vh); height: max(56vw, 48vh);
  top: -18vh; left: -8vw;
  background: radial-gradient(circle at 50% 50%, rgba(214, 225, 248, 0.38), rgba(214, 225, 248, 0) 68%);
  animation: path1 37s ease-in-out infinite, spinCW 71s linear infinite, breatheA 19s ease-in-out infinite;
}
.aurora .a2 {
  width: max(52vw, 46vh); height: max(52vw, 46vh);
  top: 14vh; right: -14vw;
  background: radial-gradient(circle at 50% 50%, rgba(72, 96, 172, 0.62), rgba(72, 96, 172, 0) 66%);
  animation: path2 43s ease-in-out infinite, spinCCW 89s linear infinite, breatheB 23s ease-in-out infinite;
}
.aurora .a3 {
  width: max(56vw, 48vh); height: max(46vw, 40vh);
  bottom: -16vh; left: 6vw;
  background: radial-gradient(circle at 50% 50%, rgba(143, 168, 255, 0.34), rgba(143, 168, 255, 0) 68%);
  animation: path3 31s ease-in-out infinite, spinCW 61s linear infinite, breatheA 17s ease-in-out infinite;
}
.aurora .a4 {
  width: max(34vw, 30vh); height: max(34vw, 30vh);
  top: 38vh; left: 32vw;
  background: radial-gradient(circle at 50% 50%, rgba(238, 242, 255, 0.24), rgba(238, 242, 255, 0) 65%);
  animation: path4 29s ease-in-out infinite, spinCCW 53s linear infinite, breatheB 29s ease-in-out infinite;
}
.aurora .a5 {
  width: max(46vw, 40vh); height: max(42vw, 36vh);
  bottom: 4vh; right: 2vw;
  background: radial-gradient(circle at 50% 50%, rgba(72, 96, 172, 0.48), rgba(72, 96, 172, 0) 66%);
  animation: path5 47s ease-in-out infinite, spinCW 79s linear infinite, breatheA 21s ease-in-out infinite;
}

.aurora-mesh {
  position: absolute;
  inset: -45%;
  display: block;
  background: conic-gradient(from 0deg at 50% 50%,
    rgba(72, 96, 172, 0) 0deg,
    rgba(185, 200, 238, 0.16) 62deg,
    rgba(72, 96, 172, 0) 128deg,
    rgba(238, 242, 255, 0.12) 196deg,
    rgba(72, 96, 172, 0) 258deg,
    rgba(143, 168, 255, 0.15) 318deg,
    rgba(72, 96, 172, 0) 360deg);
  filter: blur(70px);
  animation: spinCW 97s linear infinite;
}

.aurora-sheen {
  position: absolute;
  display: block;
  left: -25%;
  top: 6vh;
  width: 150%;
  height: 34vh;
  rotate: -19deg;
  background: linear-gradient(90deg, rgba(220, 230, 250, 0), rgba(220, 230, 250, 0.22), rgba(220, 230, 250, 0));
  filter: blur(55px);
  animation: sheen 41s ease-in-out infinite alternate;
}

@keyframes path1 {
  0%   { translate: 0 0; }
  13%  { translate: 11vw 7vh; }
  29%  { translate: -8vw 16vh; }
  41%  { translate: 17vw -5vh; }
  58%  { translate: -13vw -9vh; }
  73%  { translate: 5vw 19vh; }
  87%  { translate: -16vw 3vh; }
  100% { translate: 0 0; }
}
@keyframes path2 {
  0%   { translate: 0 0; }
  17%  { translate: -15vw 12vh; }
  31%  { translate: 6vw 24vh; }
  49%  { translate: -21vw -7vh; }
  63%  { translate: 9vw -16vh; }
  81%  { translate: -6vw 9vh; }
  100% { translate: 0 0; }
}
@keyframes path3 {
  0%   { translate: 0 0; }
  19%  { translate: 18vw -11vh; }
  34%  { translate: -7vw -22vh; }
  52%  { translate: 24vw 6vh; }
  71%  { translate: -14vw 12vh; }
  89%  { translate: 8vw -6vh; }
  100% { translate: 0 0; }
}
@keyframes path4 {
  0%   { translate: 0 0; }
  21%  { translate: -19vw -14vh; }
  38%  { translate: 14vw -25vh; }
  57%  { translate: 26vw 11vh; }
  76%  { translate: -11vw 18vh; }
  100% { translate: 0 0; }
}
@keyframes path5 {
  0%   { translate: 0 0; }
  14%  { translate: 9vw -17vh; }
  33%  { translate: -18vw -6vh; }
  47%  { translate: -4vw 14vh; }
  66%  { translate: 15vw 9vh; }
  84%  { translate: -12vw -12vh; }
  100% { translate: 0 0; }
}
@keyframes spinCW  { to { rotate: 360deg; } }
@keyframes spinCCW { to { rotate: -360deg; } }
@keyframes breatheA { 0%, 100% { scale: 1; } 37% { scale: 1.24; } 68% { scale: 0.84; } }
@keyframes breatheB { 0%, 100% { scale: 1.06; } 44% { scale: 0.82; } 79% { scale: 1.28; } }
@keyframes sheen {
  0%   { translate: -14vw 0; opacity: 0.55; }
  50%  { translate: 12vw 6vh; opacity: 1; }
  100% { translate: 20vw -4vh; opacity: 0.6; }
}
@keyframes angSpin { to { --ang: 360deg; } }

/* Зерно поверх всего — та же плёнка, что на сайте. */
.app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   КАРКАС
   ============================================================ */

.app { position: relative; min-height: 100svh; }

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) var(--pad) 10px;
  animation: item 0.55s var(--ease) both;
}

.logo { display: flex; align-items: center; gap: 8px; font-size: 15px; white-space: nowrap; }
.logo img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  animation: starBreathe 9s ease-in-out infinite;
}
.logo sup { font-size: 0.42em; top: -0.85em; color: var(--mut); }

@keyframes starBreathe {
  0%, 100% { scale: 1; }
  50%      { scale: 1.05; }
}

.view {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 4px var(--pad) calc(var(--tabbar) + 34px + env(safe-area-inset-bottom));
}

/* Разделы въезжают один за другим, а не появляются разом: так видно,
   что содержимое подменилось. Каскад тот же, что в кабинете сайта. */
.view > * { animation: item 0.5s var(--ease) both; }
.view > *:nth-child(1) { animation-delay: 0.02s; }
.view > *:nth-child(2) { animation-delay: 0.09s; }
.view > *:nth-child(3) { animation-delay: 0.16s; }
.view > *:nth-child(4) { animation-delay: 0.23s; }
.view > *:nth-child(5) { animation-delay: 0.3s; }
.view > *:nth-child(6) { animation-delay: 0.37s; }

/* --dir приходит из app.js на время смены раздела: 1 — ушли вправо,
   -1 — влево. Ноль по умолчанию — тогда движение чисто вертикальное,
   как при первой отрисовке. */
@keyframes item {
  from { opacity: 0; translate: calc(var(--dir, 0) * 24px) 16px; scale: 0.97; filter: blur(6px); }
  to   { opacity: 1; translate: 0 0; scale: 1; filter: blur(0); }
}

/* Уход перед сменой раздела: содержимое отступает в ту сторону, откуда
   придёт новое, и гаснет. Коротко — это не отдельная сцена, а полвдоха
   между разделами. Каскад здесь не нужен: уходит всё разом, иначе
   переключение растянулось бы вдвое. Правило стоит ПОСЛЕ задержек
   каскада намеренно — вес тот же, побеждает последнее. */
.view.leaving > * {
  animation: itemOut 0.16s ease-in both;
}

@keyframes itemOut {
  to { opacity: 0; translate: calc(var(--dir, 0) * -16px) -4px; scale: 0.985; filter: blur(5px); }
}

/* ---- полоса разделов ----
   Единственное непрозрачное место, кроме шапки: под ней проезжает
   содержимое, и сквозь него подписи не читались бы. Размытие стоит
   всегда и не анимируется — как у шапки сайта. */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 0 var(--pad) calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.tabbar-in {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  width: 100%;
  max-width: 460px;
  padding: 5px;
  border: 1px solid rgba(238, 242, 255, 0.10);
  border-radius: 999px;
  background: rgba(8, 13, 34, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  animation: tabbarIn 0.6s var(--ease) both 0.1s;
}

@keyframes tabbarIn {
  from { opacity: 0; translate: 0 26px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Выбранное отмечает не заливка, а тонкое кольцо: оно переезжает
   к нажатому разделу. --count и --active приходят из app.js. */
.tabbar-in::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px - (var(--count, 4) - 1) * 2px) / var(--count, 4));
  border-radius: 999px;
  border: 1px solid rgba(238, 242, 255, 0.42);
  translate: calc(var(--active, 0) * (100% + 2px)) 0;
  transition: translate 0.52s cubic-bezier(0.34, 1.42, 0.44, 1);
}

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 4px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--mut);
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.35s var(--ease);
}
.tab svg { width: 19px; height: 19px; stroke-width: 1.5; }
.tab:hover { color: var(--soft); }
.tab.active { color: var(--ink); }

/* ============================================================
   ПРИМИТИВЫ
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(238, 242, 255, 0.12);
  background: transparent;
  color: var(--soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  position: relative;
  min-height: 46px;
  border: 1px solid rgba(238, 242, 255, 0.24);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 15px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.btn:hover { border-color: rgba(238, 242, 255, 0.45); }
.btn:active { scale: 0.985; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:disabled:hover { border-color: rgba(238, 242, 255, 0.24); }
.btn-sm { min-height: 38px; padding: 9px 18px; font-size: 13.5px; }
.btn-wide { width: 100%; }
.btn-ghost { border-color: rgba(238, 242, 255, 0.16); color: var(--soft); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Зелёным метится то, что продолжает подписку, красным — то, что
   обрывает сеанс. Заливок на сайте нет, цвет несут грань и текст. */
.btn-go { color: var(--green-text); border-color: rgba(34, 197, 94, 0.45); }
.btn-go:hover { border-color: rgba(34, 197, 94, 0.8); color: #86efac; }
.btn-out { color: var(--red-text); border-color: rgba(239, 68, 68, 0.4); }
.btn-out:hover { border-color: rgba(239, 68, 68, 0.75); color: #fca5a5; }

/* Главное действие: вращающийся градиент ВНУТРИ кнопки, обрезанный
   по её краю. Заливки не появляется — светится подкладка под гранью. */
.btn-glow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.btn-glow > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.btn-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--ang),
    #3b53a0 0deg, #8ea8ff 95deg, #b9c8ee 165deg, #6f8ede 245deg, #3b53a0 360deg);
  filter: blur(7px);
  opacity: 0.7;
  animation: angSpin 9s linear infinite;
  transition: opacity 0.3s ease;
}
.btn-glow:hover::before { opacity: 1; }

.row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---- поля ---- */

.field {
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--text);
  /* 16 px — иначе iOS зумит страницу на фокусе. */
  font-size: 16px;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.field:focus {
  outline: none;
  border-color: rgba(214, 225, 248, 0.6);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(214, 225, 248, 0.12);
}

/* ---- появление при прокрутке ---- */

.reveal {
  opacity: 0;
  translate: 0 34px;
  scale: 0.99;
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease) var(--rv-delay, 0s),
    translate 0.8s var(--ease) var(--rv-delay, 0s),
    scale 0.8s var(--ease) var(--rv-delay, 0s),
    filter 0.8s var(--ease) var(--rv-delay, 0s);
}
.reveal.in { opacity: 1; translate: 0 0; scale: 1; filter: blur(0); }

/* ---- заглушки, пока летит запрос ----
   Дышащие полосы той же высоты, что и настоящие строки: экран не
   прыгает, когда приезжают данные. */

.wait { display: flex; flex-direction: column; gap: 8px; }
.wait span {
  display: block;
  height: 52px;
  border-radius: 16px;
  background: rgba(238, 242, 255, 0.06);
  animation: waitPulse 1.4s ease-in-out infinite both;
}
.wait-tall span { height: 168px; border-radius: 22px; }
@keyframes waitPulse {
  0%, 100% { opacity: 0.28; }
  50%      { opacity: 0.55; }
}

/* ---- ответ сервера словами ---- */

.note {
  font-family: var(--text);
  margin-bottom: 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--line);
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--soft);
  animation: item 0.45s var(--ease) both;
}
.note-ok { border-left-color: var(--green); }
.note-warn { border-left-color: var(--amber); }
.note-bad { border-left-color: var(--red); color: #fca5a5; }

.plain {
  font-family: var(--text);
  font-size: 14px;
  line-height: 1.6;
  color: var(--mut);
}

/* ============================================================
   ЗАГОЛОВКИ И КАРТОЧКИ
   ============================================================ */

.eyebrow { font-size: 12.5px; color: var(--mut); }

.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 7vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  padding-top: 6px;
}

.head { padding-bottom: 18px; }
.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section { padding-top: clamp(26px, 5vh, 40px); }
.section:first-child { padding-top: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.015em;
}
.section-note { font-family: var(--text); font-size: 12.5px; color: var(--mut); }

/* Карточка — просто прозрачное поле. Ни заливки, ни тени, ни фильтра:
   фон виден как есть. Грань появляется только там, где без неё две
   карточки сливаются в одну простыню. */
.card {
  padding: clamp(18px, 5vw, 24px);
  border: none;
  border-radius: 22px;
  background: transparent;
}
.card + .card { margin-top: 10px; }
.card-edge { border: 1px solid rgba(238, 242, 255, 0.14); }

.label { font-size: 12.5px; color: var(--mut); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  background: transparent;
  white-space: nowrap;
}
.badge-on { --dot: var(--green); color: var(--green-text); }
.badge-off { --dot: var(--red); color: var(--red-text); }

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--green));
  box-shadow: 0 0 12px var(--dot, var(--green));
  flex: none;
}
.dot-live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--dot, var(--green));
  animation: dotPulse 2.2s ease-out infinite;
}
@keyframes dotPulse {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ============================================================
   ГЛАВНАЯ: ТАРИФ, СРОК, КЛЮЧ
   ============================================================ */

.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.plan-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 9vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1;
  padding-top: 8px;
}

/* ---- кольцо оставшихся дней ----
   Срок — то, ради чего сюда заходят чаще всего. Кольцо показывает долю
   оставшегося, число — сам остаток, подпись под ним — точную дату. */

.ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 124px;
  height: 124px;
  text-align: center;
}
.ring svg {
  grid-area: 1 / 1;
  width: 124px;
  height: 124px;
  rotate: -90deg; /* отсчёт от верха, а не справа */
}
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-track { stroke: rgba(238, 242, 255, 0.1); }
.ring-line {
  stroke: var(--ring);
  stroke-dasharray: var(--dash);
  animation: ringDraw 1.2s var(--ease) both 0.15s;
}
@keyframes ringDraw {
  from { stroke-dashoffset: var(--dash); }
  to   { stroke-dashoffset: var(--off); }
}
.ring-ok   { --ring: var(--green); }
.ring-warn { --ring: var(--amber); }
.ring-bad  { --ring: var(--red); }
.ring-off  { --ring: rgba(238, 242, 255, 0.22); }

.ring-mid {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.ring-mid b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.03em;
}
.ring-mid i {
  font-family: var(--text);
  font-style: normal;
  font-size: 12px;
  color: var(--mut);
}
.ring-over { font-size: 14px !important; color: var(--red-text) !important; }
.ring-till {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-family: var(--text);
  font-size: 12px;
  color: var(--mut);
}

/* Состав тарифа отделяет воздух, а не черта. */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.chips li {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--soft);
}

/* ---- короткие факты ---- */

/* Три коротких факта строкой: на телефоне они укладываются в один ряд,
   а не переносят третий вниз отдельной полосой. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: transparent;
}
.fact-label { font-size: 12px; color: var(--mut); }
.fact-value { font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.fact-hint { font-family: var(--text); font-size: 12px; color: var(--mut); }

/* ---- ключ-подписка ---- */

.key-qr {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: center;
  cursor: pointer;
}
.key-qr img {
  display: block;
  width: min(190px, 55%);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
}
.key-qr span {
  display: block;
  font-family: var(--text);
  padding-top: 8px;
  font-size: 11.5px;
  color: var(--mut);
  transition: color 0.2s ease;
}
.key-qr:hover span { color: var(--soft); }

.key-row { display: flex; gap: 8px; padding-top: 10px; }
.key-row .field {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding-right: 14px;
  color: var(--soft);
}
.key-hint {
  font-family: var(--text);
  padding-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--mut);
}

/* Кнопка проходит три состояния: скопировать → скопировано → открыть.
   Невидимый двойник держит ширину по самой длинной надписи, поэтому
   кнопка неподвижна, а слово внутри спокойно сменяется. */
.copy { flex: none; overflow: hidden; transition: color 0.3s ease, border-color 0.3s ease; }
.copy-done { color: var(--green-text); border-color: rgba(34, 197, 94, 0.45); }
.copy-open { color: var(--ink); border-color: rgba(238, 242, 255, 0.45); }
.copy-stack { display: grid; }
.copy-stack > * { grid-area: 1 / 1; }
.copy-ghost { visibility: hidden; padding-left: 20px; white-space: nowrap; }
.copy-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  animation: copySwap 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.copy-text svg { width: 14px; height: 14px; }
@keyframes copySwap {
  from { opacity: 0; translate: 0 11px; scale: 0.94; filter: blur(5px); }
  to   { opacity: 1; translate: 0 0; scale: 1; filter: blur(0); }
}

/* ============================================================
   ТАРИФЫ
   ============================================================ */

/* Переключатель периода — то же кольцо, что и у полосы разделов. */
.switch {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 5px;
  border: 1px solid rgba(238, 242, 255, 0.12);
  border-radius: 999px;
  background: transparent;
}
.switch::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / var(--count, 4));
  border-radius: 999px;
  border: 1px solid rgba(238, 242, 255, 0.42);
  translate: calc(var(--active, 0) * 100%) 0;
  transition: translate 0.45s var(--ease);
}
.switch button {
  position: relative;
  z-index: 1;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  padding: 10px 6px;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.35s var(--ease);
}
.switch button.active { color: var(--ink); }

.rate {
  font-family: var(--text);
  padding: 12px 2px 4px;
  font-size: 13px;
  color: var(--mut);
  animation: fadeUp 0.45s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; translate: 0 6px; }
  to   { opacity: 1; translate: 0 0; }
}

.plans { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }

/* Карточка тарифа — кнопка. Рамка тут возвращена: четыре карточки
   текста без краёв сливались в одну простыню. */
.plan {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 22px 20px;
  border: 1px solid rgba(238, 242, 255, 0.12);
  border-radius: 22px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.plan:hover { border-color: rgba(238, 242, 255, 0.3); }

/* Тариф, который у человека сейчас, обводит вращающаяся палитра — та же,
   что у главных кнопок. Маска оставляет от градиента только рамку. */
.plan-current { border-color: transparent; isolation: isolate; }
.plan-current::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: conic-gradient(from var(--ang),
    #3b53a0 0deg, #8ea8ff 95deg, #b9c8ee 165deg, #6f8ede 245deg, #3b53a0 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: angSpin 9s linear infinite;
}
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .plan-current::before { display: none; }
  .plan-current { border-color: rgba(214, 225, 248, 0.45); }
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}
.plan-title { color: var(--soft); font-size: 14.5px; }

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 10vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
}
/* Цифра не едет: она гаснет и проявляется заново, чуть подрастая.
   Любой сдвиг по вертикали читался как подпрыгивание. */
/* Прокрутка цены (rollPrice в app.js) подрастает transform-ом от левого
   края: от центра число растаскивало бы в обе стороны, и оно ёрзало бы. */
.plan-num {
  display: inline-block;
  transform-origin: left center;
  animation: numIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes numIn {
  from { opacity: 0; scale: 0.9; }
  to   { opacity: 1; scale: 1; }
}
.plan-unit { font-family: var(--ui); font-weight: 400; font-size: 14px; color: var(--mut); }
.plan-per {
  padding-top: 10px;
  font-size: 13px;
  color: var(--mut);
  animation: fadeUp 0.5s var(--ease) both 0.06s;
}

.plan-items { display: flex; flex-direction: column; gap: 7px; padding-top: 16px; }
.plan-items li { font-size: 13.5px; line-height: 1.4; color: var(--soft); }

.plan-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--text);
  font-size: 13px;
  color: var(--mut);
  transition: color 0.2s ease, gap 0.25s var(--ease);
}
.plan-go svg { width: 14px; height: 14px; }
.plan:hover .plan-go { color: var(--ink); gap: 11px; }

.badge-sm { padding: 5px 11px; font-size: 11.5px; animation: badgeIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both 0.05s; }
@keyframes badgeIn {
  from { opacity: 0; translate: 0 -3px; filter: blur(2px); }
  to   { opacity: 1; translate: 0 0; filter: blur(0); }
}

/* ============================================================
   СТАТУС
   ============================================================ */

.sbar {
  --dot: var(--green);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}
.sbar-wait { --dot: rgba(159, 171, 214, 0.55); }
.sbar-bad {
  --dot: var(--amber);
  border-radius: 20px;
  border-color: rgba(245, 158, 11, 0.45);
}
.sbar-title { font-weight: 500; font-size: 14.5px; }
.sbar-sub { font-family: var(--text); flex: 1; font-size: 13px; color: var(--mut); }
.sbar-reason {
  flex-basis: 100%;
  font-family: var(--text);
  padding-top: 2px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--soft);
}

.locs { display: flex; flex-direction: column; gap: 8px; }

.loc {
  --dot: var(--green);
  border-radius: 18px;
  background: transparent;
  overflow: hidden;
  transition: background 0.3s ease;
}
.loc-wait { --dot: rgba(159, 171, 214, 0.55); --dot-text: var(--mut); }
.loc-wait .dot::after { animation: none; }
.loc-down { --dot: var(--red); --dot-text: var(--red-text); }
.loc.open { background: rgba(255, 255, 255, 0.045); }
.loc-down .loc-name { opacity: 0.7; }
.loc-auto .loc-name { color: var(--glow); }

.loc-row {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.loc-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
/* Флаг рисует система: своего размера у эмодзи нет, задаём явно, иначе
   он тянется за 17px заголовка и висит выше базовой линии. */
.loc-flag { font-size: 15px; line-height: 1; }

.loc-tag {
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 700;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--glow);
  border: 1px solid rgba(214, 225, 248, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1;
}
.loc-state { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.loc-state-text { color: var(--dot-text, var(--green-text)); font-size: 12.5px; }

.loc-plus {
  font-size: 20px;
  line-height: 1;
  justify-self: end;
  color: var(--soft);
  transition: rotate 0.4s var(--ease), color 0.3s ease;
}
.loc.open .loc-plus { rotate: 135deg; color: var(--ink); }

/* Раскрытие через строку грида 0fr → 1fr: высоту содержимого знать
   заранее не нужно. Тот же приём, что на сайте. */
.loc-acc {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease);
}
.loc.open .loc-acc { grid-template-rows: 1fr; }
.loc-acc-in { overflow: hidden; }
.loc-body { padding: 0 18px 20px; }

.loc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px 20px;
}
.loc-fact { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.loc-label { color: var(--mut); font-size: 11.5px; }
.loc-fact b { font-weight: 400; font-size: 14px; }

.loc-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; }
.loc-bar {
  flex: 1;
  min-width: 90px;
  height: 5px;
  border-radius: 3px;
  background: rgba(238, 242, 255, 0.14);
  overflow: hidden;
}
/* Ширина задаётся сразу, наполнение анимируется трансформом: проценты
   внутри раскрывающейся панели считались бы от нулевой ширины. */
.loc-bar i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 3px;
  background: var(--dot);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.85s var(--ease) 0.12s;
}
.loc.open .loc-bar i { transform: scaleX(1); }
.loc-load {
  flex: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--soft);
}
.loc-note {
  font-family: var(--text);
  padding-top: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--mut);
}
.loc-foot {
  font-family: var(--text);
  padding-top: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--mut);
}

/* ============================================================
   АККАУНТ
   ============================================================ */

.rows { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 15px;
  background: transparent;
  font-size: 14px;
}
.row-main { flex: 1; min-width: 120px; }
.row-tag { font-family: var(--text); font-size: 12px; color: var(--mut); }
.row-side { font-family: var(--text); font-size: 13px; color: var(--soft); white-space: nowrap; }

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.toggle-title { display: block; font-weight: 500; font-size: 14.5px; }
.toggle-sub {
  display: block;
  font-family: var(--text);
  padding-top: 5px;
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mut);
}

/* Переключатель: кружок переезжает, рамка меняет цвет. Заливки нет. */
.toggle-box {
  position: relative;
  flex: none;
  width: 46px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s ease;
}
.toggle-box::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--mut);
  transition: translate 0.4s cubic-bezier(0.34, 1.42, 0.44, 1), background 0.3s ease;
}
.toggle-on .toggle-box { border-color: rgba(34, 197, 94, 0.5); }
.toggle-on .toggle-box::after { translate: 19px 0; background: var(--green); }

.info { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.info div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}
.info dt { font-size: 13px; color: var(--mut); }
.info dd { margin: 0; font-size: 14px; text-align: right; word-break: break-word; }

/* ============================================================
   ВО ВЕСЬ ЭКРАН: QR И ПЕРЕХОД НА ТАРИФ
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: rgba(4, 8, 26, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Анимируем только цвет подложки: прозрачность на этом же элементе
     выключила бы её собственное размытие. */
  animation: veil 0.3s ease both;
}
@keyframes veil {
  from { background-color: rgba(4, 8, 26, 0); }
  to   { background-color: rgba(4, 8, 26, 0.72); }
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(460px, 100%);
  padding: clamp(18px, 5vw, 26px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--deep);
  text-align: center;
  animation: sheetIn 0.5s cubic-bezier(0.2, 1.25, 0.4, 1) both 0.04s;
}
@keyframes sheetIn {
  from { opacity: 0; scale: 0.94; translate: 0 34px; filter: blur(10px); }
  to   { opacity: 1; scale: 1; translate: 0 0; filter: blur(0); }
}
.sheet-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.sheet-qr {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  animation: qrIn 0.5s var(--ease) both 0.18s;
}
@keyframes qrIn {
  from { opacity: 0; scale: 0.86; }
  to   { opacity: 1; scale: 1; }
}
.sheet-sum {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.03em;
  color: var(--glow);
}
.sheet-note {
  font-family: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--mut);
}
.sheet-cta { display: flex; gap: 9px; }
.sheet-cta .btn { flex: 1; }

/* ============================================================
   ЭКРАН БЕЗ СЕССИИ
   ============================================================ */

.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 70svh;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}
.gate img {
  width: min(160px, 40vw);
  animation: starIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both 0.05s, starBreathe 9s ease-in-out infinite 1.2s;
}
@keyframes starIn {
  from { opacity: 0; translate: 0 -22vh; scale: 0.82; rotate: -16deg; filter: blur(10px); }
  55%  { opacity: 1; }
  to   { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; filter: blur(0); }
}
.gate-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 8vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.gate-sub {
  font-family: var(--text);
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--mut);
}

/* ============================================================
   ЩАДЯЩИЙ РЕЖИМ
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; scale: 1; filter: none; transition: none; }
  .aurora i, .aurora-mesh, .aurora-sheen, .logo img, .gate img,
  .dot::after, .btn-glow::before, .plan-current::before, .ring-line,
  .view > *, .top, .tabbar-in, .plan-num, .plan-per, .rate, .copy-text, .note {
    animation: none !important;
  }
  * { transition-duration: 0.01ms !important; }
}
