/* URBEX VPN — мини-приложение и кабинет сайта (основа).
 *
 * Разметку экранов собирает app.js из данных сервера; здесь — всё
 * оформление макета: палитра, стекло карточек, кнопки, шторки, навигация,
 * кадры анимаций. Компоненты экранов макета docs/design/miniapp.html
 * (сцена, тарифы, шторки, мастер, профиль) — в theme-urbex.css, он
 * подключается следом и уточняет эти правила. */

/* Шрифт лежит в проекте, а не тянется с Google: приложение открывают из
   Telegram в России, и сторонний домен — это лишняя точка отказа. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-cyr.woff2') format('woff2');
  font-weight: 400 900;
  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.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Палитра URBEX. Старые имена (--mint, --pink) оставлены как псевдонимы:
     --mint — сиреневый акцент, --pink — янтарный. */
  --bg: #0e0b16;
  --card-bg: #18152c;
  --purple: #2b2350;
  --lilac: #beabfe;
  --mint: #beabfe;
  --mint-2: #9f86f2;
  --pink: #d69b51;
  --pink-text: #d69b51;
  --amber: #d69b51;
  --text: #f4f2f8;
  --text-2: #d8d2e6;
  --text-3: #a6a0b4;
  --muted: #a6a0b4;
  --ink: #0e0b16;
  --placeholder: #6e6782;
  --card: #18152c;
  /* Карточки без backdrop-filter: сплошные, фон не просвечивает. */
  --card-solid: #18152c;
  --card-2: #141126;
  --line: #2a2540;
  --line-soft: rgba(190, 171, 254, .12);
  --line-faint: rgba(190, 171, 254, .08);
  --glass-blur: 14px;
  --r-card: 24px;
  --r-btn: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Пружинистое замедление для переходов экранов и шторок. */
  --spring: cubic-bezier(.22, 1, .36, 1);
  /* Безопасные зоны Telegram. Ставит app.js (applyInsets): --sat — вырез
     камеры, --csat — полоса кнопок Telegram во весь экран, --sab — низ.
     Вне полноэкранного режима обе верхние — ноль. */
  --sat: 0px;
  --csat: 0px;
  --sab: 0px;
  --head: calc(var(--sat) + var(--csat));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--sab));
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translate3d(0, 100%, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes screenIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes menuIn { from { transform: translateX(-50%) scale(.92) translateY(-6px); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes ripple { 0% { transform: translate(-50%, -50%) scale(.55); opacity: .7; } 100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; } }
@keyframes shimmer { from { transform: translateX(-120%); } to { transform: translateX(220%); } }
@keyframes bbDot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Фон живёт на html: у обёртки телефона ограничена ширина, и фон,
   нарисованный на ней, оставил бы по бокам чужой цвет. */
html {
  /* Telegram на Android передаёт в WebView системный масштаб текста, и без
     этого все надписи выходили крупнее макета и ломали вёрстку. Остаток
     масштаба (если WebView его всё же применил) гасит app.js — см. textZoom. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-height: 100%;
  background: #0E0B16;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  /* Системный стек позади обязателен: пока шрифт грузится — и если не
     загрузится вовсе — текст должен остаться читаемым. */
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

a { color: var(--mint); text-decoration: none; }
button { font-family: inherit; color: inherit; }
button:disabled { cursor: default; }
input, textarea { font-family: inherit; -webkit-user-select: text; user-select: text; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
[data-noscroll]::-webkit-scrollbar { display: none; }
svg { flex: none; }

/* --- Окно приложения ------------------------------------------------------
   На телефоне — весь экран. В широком окне (браузер на ПК, планшет) экран
   встаёт по центру в рамке телефона из макета: так витрину проверяют на
   компьютере ровно в том виде, в каком её увидят в Telegram. */
#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}
#phone {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #0E0B16 0%, #18152C 45%, #0E0B16 100%);
}
/* Рамка-телефон — ТОЛЬКО в браузерном кабинете на ПК (`.web`): там витрину
   смотрят на большом экране, и приятно видеть её «как в телефоне». В самом
   Telegram (и на телефоне, и в Desktop) `.web` нет — там мини-апп заполняет
   окно как обычный мини-апп, без нарисованного телефона в тёмной рамке. */
@media (min-width: 640px) {
  .web #stage { padding: 20px 16px; }
  .web #phone {
    width: 412px;
    height: min(866px, 100%);
    border-radius: 32px;
    box-shadow: 0 30px 70px rgba(20, 17, 36, .4), 0 12px 30px rgba(0, 0, 0, .25);
  }
}
/* Высоты хватает на целый «телефон» — добавляем фирменную рамку-корпус (web). */
@media (min-width: 640px) and (min-height: 700px) {
  .web #stage { padding: 24px 16px; }
  .web #phone {
    border-radius: 49px;
    box-shadow:
      0 0 0 11px #0E0B16,
      0 0 0 13px #2A2540,
      0 0 0 14px #0E0B16,
      0 50px 90px rgba(20, 17, 36, .35),
      0 12px 30px rgba(0, 0, 0, .25);
  }
}
/* В самом Telegram (нет `.web`) на широком окне (Desktop) мини-апп заполняет
   окно как обычно: живой фон #phone растянут на все окно, а контент —
   центрированной колонкой, чтобы не разъезжался. Никакого нарисованного
   телефона. Нижняя навигация и так центрируется (justify-content: center). */
@media (min-width: 640px) {
  html:not(.web) .sheet { left: 50%; right: auto; width: min(560px, 100%); translate: -50% 0; }
  html:not(.web) .sheet .body { border-radius: 26px 26px 0 0; }
  html:not(.web) #screen { max-width: 412px; margin: 0 auto; }
  html:not(.web) .top {
    left: 50%; right: auto; transform: translateX(-50%); width: min(412px, 100%);
  }
}

/* Размытие под шапкой: содержимое уходит под неё при прокрутке. */
.fadeTop {
  position: absolute; top: 0; left: 0; right: 0; height: calc(84px + var(--head)); z-index: 6;
  pointer-events: none;
  background: linear-gradient(180deg, #0E0B16 0%, rgba(24, 21, 44, .95) 60%, rgba(24, 21, 44, 0) 100%);
}

/* --- Шапка ------------------------------------------------------------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 7;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 0;
}
.top .brand {
  position: absolute; left: 50%; top: calc(50% + 5px); transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 4px;
  font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: #fff;
  pointer-events: none; white-space: nowrap;
}
/* Во весь экран: шапка — это полоса кнопок Telegram под вырезом камеры.
   «Закрыть» слева, меню справа, название ровно посередине между ними. */
body.fs .top { top: var(--sat); height: var(--csat); padding: 0 14px; }
body.fs .top .brand { top: 50%; font-size: 16px; }
body.fs #screen { padding-top: calc(var(--head) + 14px); }
.top .brand b { color: var(--mint); font-weight: 800; }
.top .brand small { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
/* На сайте логотип — ссылка на главную: кликабелен и подсвечивается. */
html.web .top a.brand { pointer-events: auto; text-decoration: none; transition: opacity .2s; }
html.web .top a.brand:hover { opacity: .8; }
.pill-btn {
  height: 32px; padding: 0 14px 0 10px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; border: none; background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.pill-btn:active { transform: scale(.97); }
/* Пилюля 32px на вид, а попадать пальцем — по 44px. */
.pill-btn { position: relative; }
.pill-btn::after { content: ""; position: absolute; inset: -6px -2px; }
/* В Telegram кнопка «Назад» — своя, в его шапке. Нашу тогда не рисуем. */
body.tg-back .top .back { display: none; }

/* --- Прокрутка и экран ---------------------------------------------------- */
#scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  /* Выглядывающий URBEX и карусель выходят за край намеренно: без этого
     iPhone давал «пружинить» главной вбок, и она казалась кривой. */
  overscroll-behavior-x: none;
}
#screen { padding: calc(68px + var(--head)) 16px calc(132px + var(--bottom)); position: relative; min-height: 100%; }
#screen.in > .view { animation: screenIn .28s var(--spring) both; }
#screen.up > .view { animation: fadeUp .3s var(--spring) both; }
.view { animation: fadeUp .3s var(--spring) both; }

/* --- Типографика ---------------------------------------------------------- */
h1, h2, h3 { margin: 0; color: #fff; letter-spacing: -.02em; }
.h1 { margin: 4px 0 16px; font-size: 28px; font-weight: 700; }
.h1.mid { font-size: 26px; margin-bottom: 12px; }
.lead { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--text-3); text-wrap: pretty; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.sec {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase;
}
.sec::before { content: ''; width: 3px; height: 12px; border-radius: 3px; background: var(--mint); }
.sec.pink::before { background: var(--pink); }
.sec.grey::before { background: var(--muted); }
.sec.amber::before { background: var(--amber); }
.center { text-align: center; }
.dim { color: var(--muted); }
.mint { color: var(--mint); }
.pinkt { color: var(--pink-text); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* --- Карточки и списки ---------------------------------------------------- */
.card {
  padding: 18px; border-radius: var(--r-card);
  background: var(--card-solid); border: 1px solid var(--line);
}
.card.soft { background: var(--card-2); border-color: var(--line-soft); }
.card.tight { padding: 14px; border-radius: 20px; }
.card + .card, .card + .list, .list + .card, .list + .list { margin-top: 10px; }
.mb { margin-bottom: 18px; }
.mb-s { margin-bottom: 12px; }
.mt { margin-top: 12px; }

.list {
  border-radius: 20px; background: var(--card); border: 1px solid var(--line-soft); overflow: hidden;
}
.list.pad { padding: 6px; border-radius: 22px; }
.li {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 13px 14px; border: none; border-bottom: 1px solid var(--line-faint);
  background: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer;
}
.li:last-child { border-bottom: none; }
.li:active { background: rgba(190, 171, 254, .06); }
.li.static { cursor: default; }
a.li { text-decoration: none; }
.li.static:active { background: none; }
.li .ic {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: rgba(190, 171, 254, .12); color: var(--mint); display: grid; place-items: center;
}
.li .ic.pink { background: rgba(214, 155, 81, .16); color: var(--pink-text); }
.li .ic.big { width: 44px; height: 44px; border-radius: 13px; }
.li .ic.solid { background: var(--pink); color: #fff; }
.li .ic.amber { background: rgba(214, 155, 81, .14); color: var(--amber); }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-size: 15px; font-weight: 600; }
.li .t small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.li .badge { font-size: 12px; color: var(--mint); margin-right: 4px; white-space: nowrap; }
.li .badge.amber { color: var(--amber); }
.li .badge.dim { color: var(--muted); }
.li .chev { color: var(--muted); }
.list.pad .li { padding: 12px; border-bottom: none; border-radius: 16px; }
.list.pad .li:active { background: rgba(190, 171, 254, .06); }

.rowb { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k { font-size: 12px; color: var(--muted); }
.k.big { font-size: 13px; }
.v { font-size: 22px; font-weight: 700; color: #fff; margin-top: 4px; letter-spacing: -.02em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-soft); }
.stat.lit { background: rgba(190, 171, 254, .1); border-color: rgba(190, 171, 254, .3); }
/* «₽» не переносится на отдельную строку: на 320 сумма ужимается, а не ломается. */
.stat .v { font-size: clamp(17px, 6vw, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.lit .v { color: var(--mint); }

/* Чипы состояния. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.chip.ok { background: rgba(190, 171, 254, .12); }
.chip.off { background: rgba(214, 155, 81, .16); }
.chip.off .dot { background: var(--pink); }
.chip.wait { background: rgba(214, 155, 81, .14); }
.chip.wait .dot { background: var(--amber); animation: glow 1.4s ease-in-out infinite; }
.chip.line { border: 1px solid rgba(190, 171, 254, .2); color: var(--text-2); }

/* Полоса срока. */
.bar { height: 6px; border-radius: 6px; background: rgba(190, 171, 254, .12); overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--mint-2), var(--mint));
  box-shadow: 0 0 12px rgba(190, 171, 254, .5); transition: width .6s ease;
}
.bar.low i { background: linear-gradient(90deg, #C08A45, var(--amber)); box-shadow: 0 0 12px rgba(214, 155, 81, .5); }
.bar.dead i { background: rgba(214, 155, 81, .55); box-shadow: none; }

/* --- Кнопки --------------------------------------------------------------- */
.btn {
  width: 100%; height: 54px; border: none; border-radius: var(--r-btn);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .12s, opacity .2s, background .25s, color .25s;
}
.btn:active { transform: scale(.98); }
.btn.p { background: var(--pink); color: #fff; box-shadow: 0 10px 26px rgba(214, 155, 81, .32); }
.btn.g {
  height: 50px; background: none; color: var(--text); font-size: 15px; font-weight: 500;
  border: 1.5px solid rgba(190, 171, 254, .4); box-shadow: inset 0 0 18px rgba(190, 171, 254, .08);
}
.btn.m { background: var(--mint); color: var(--ink); height: 44px; font-size: 14px; }
.btn.q { height: 46px; background: none; color: var(--muted); font-size: 15px; font-weight: 400; }
.btn.sm { height: 44px; font-size: 14px; }
.btn.tiny { width: auto; height: 36px; padding: 0 14px; font-size: 13px; }
.btn.dis, .btn:disabled { background: rgba(255, 255, 255, .08); color: var(--placeholder); box-shadow: none; cursor: default; }
.btn + .btn { margin-top: 8px; }
.quiet {
  display: block; width: 100%; margin-top: 8px; padding: 8px; border: none; background: none;
  color: var(--muted); font-size: 13px; cursor: pointer; text-align: center;
}
.quiet span { color: var(--mint); }
/* Цель для пальца — не меньше 44px. */
.quiet { min-height: 44px; }
.pickrow .acts { display: flex; gap: 6px; flex: none; align-items: center; }
.pickrow .t { min-width: 0; }
.pickrow .t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 375px) {
  .pickrow .acts { flex-direction: column; align-items: stretch; }
  .pickrow .acts .btn.tiny { height: 32px; }
}
@media (max-width: 340px) {
  /* На самых узких экранах кнопки «Установить/Добавить» — в колонку, иначе
     правая обрезается; бейдж программы — переносится, а не наезжает;
     URBEX-зазывала — прячется, он перекрывал подзаголовок. */
  .pickrow .acts { flex-direction: column; align-items: stretch; }
  .pickrow .acts .btn.tiny { height: 32px; }
  .li .t { min-width: 0; }
  .li .badge { white-space: normal; text-align: right; }
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pair .btn { height: 46px; margin: 0; font-size: 14px; border-radius: 14px; }

/* Кнопка на время запроса: выключена и с бегущей полоской. Иначе выключенная
   кнопка читается как «нажатие не дошло», и человек жмёт ещё раз. */
.busy { position: relative; overflow: hidden; pointer-events: none; opacity: .85; }
.busy::after {
  content: ''; position: absolute; inset: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  animation: shimmer 1.1s linear infinite;
}

/* --- Поля ----------------------------------------------------------------- */
.field {
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px;
  border-radius: 16px; background: rgba(24, 21, 44, .6); border: 1.5px solid rgba(190, 171, 254, .2);
  transition: border-color .2s; margin-bottom: 12px;
}
.field:focus-within, .field.ok { border-color: var(--mint); }
.field input { flex: 1; min-width: 0; height: 100%; border: none; background: none; color: #fff; font-size: 16px; outline: none; }
.field.sheet-input { background: rgba(0, 0, 0, .2); border-color: rgba(190, 171, 254, .3); }
.field input.code { text-align: center; font-size: 22px; letter-spacing: .3em; font-weight: 600; }
.field input.promo { font-size: 17px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
textarea.area {
  width: 100%; resize: none; padding: 14px 16px; border-radius: 16px;
  background: rgba(24, 21, 44, .6); border: 1.5px solid rgba(190, 171, 254, .2);
  color: #fff; font-size: 15px; line-height: 1.45; outline: none; margin-bottom: 12px; transition: border-color .2s;
}
textarea.area:focus { border-color: var(--mint); }
.label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.label.w { font-size: 14px; font-weight: 600; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips button {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(190, 171, 254, .25);
  background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.chips button.on { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.hint-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(190, 171, 254, .07); font-size: 13px; color: var(--text-3); margin-bottom: 16px;
}
.count { font-size: 12px; color: var(--muted); text-align: right; margin: -6px 0 10px; }

/* Сегмент-переключатель. */
.seg {
  position: relative; display: grid; padding: 4px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line-soft); margin-bottom: 18px;
}
.seg .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 12px;
  background: var(--mint); transition: transform .3s var(--ease), opacity .2s;
}
.seg.soft .thumb { background: rgba(190, 171, 254, .14); border: 1px solid rgba(190, 171, 254, .3); }
.seg button {
  position: relative; height: 40px; border: none; background: none; color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: color .25s;
}
.seg button.on { color: var(--ink); }
.seg.soft button.on { color: #fff; }
.seg.soft button { color: var(--muted); }

/* Переключатель. */
.switch {
  width: 44px; height: 26px; flex: none; border-radius: 999px; padding: 3px; border: none;
  background: rgba(190, 171, 254, .18); display: flex; justify-content: flex-start; cursor: pointer; transition: background .2s;
}
.switch.on { background: var(--mint); justify-content: flex-end; }
.switch i { width: 20px; height: 20px; border-radius: 50%; background: #fff; }

/* --- Главная: сцена с логотипом -------------------------------------------- */
/* Главная подогнана под экран без прокрутки: высота = видимая область
   (#screen минус его отступы под шапку и нижнюю панель), сцена с логотипом —
   гибкая и ужимается, остальное компактное. */
.home { display: flex; flex-direction: column; min-height: 0; margin-top: 14px; height: calc(100vh - 200px - var(--head, 0px) - var(--bottom)); height: calc(100dvh - 200px - var(--head, 0px) - var(--bottom)); }
/* Во весь экран сверху отступ — полоса кнопок Telegram (--head) плюс 14px. */
body.fs .home { height: calc(100dvh - var(--head) - 146px - var(--bottom)); }
@media (min-width: 640px) and (min-height: 700px) { .home { height: auto; min-height: 640px; } }
.switcher { position: relative; display: flex; justify-content: center; z-index: 8; }
.switcher > button {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 16px; border-radius: 999px;
  border: 1px solid rgba(190, 171, 254, .28); background: rgba(24, 21, 44, .9);
  color: #fff; font-size: 15px; font-weight: 500; cursor: pointer;
}
/* Длинное своё название — одной строкой с многоточием, а не в две строки
   в кнопке высотой 36px. */
.switcher > button { max-width: calc(100% - 24px); min-width: 0; }
.switcher > button .sw-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher > button svg { flex-shrink: 0; }
.switcher > button:active { transform: scale(.97); }
.switcher > button svg { transition: transform .25s; }
.switcher.open > button svg { transform: rotate(180deg); }
.menu-shade { position: fixed; inset: 0; z-index: 1; }
.menu {
  position: absolute; top: 46px; left: 50%; z-index: 2; width: 250px; padding: 6px; border-radius: 18px;
  background: rgba(20, 17, 36, .96); border: 1px solid rgba(190, 171, 254, .2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .45);
  transform: translateX(-50%); transform-origin: top center; animation: menuIn .22s var(--ease) both;
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: none; color: var(--text); font-size: 15px; cursor: pointer; text-align: left;
  min-width: 0; overflow-wrap: anywhere;
}
.menu button:active { background: rgba(190, 171, 254, .08); }
.menu button.danger { color: var(--pink-text); }
.menu button.danger:active { background: rgba(214, 155, 81, .1); }
.menu hr { height: 1px; border: none; background: rgba(190, 171, 254, .12); margin: 4px 8px; }

.home-title { margin: 8px 0 2px; color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -.02em; text-align: center; text-wrap: balance; }
.home-sub { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--muted); text-align: center; text-wrap: pretty; }
.home .card.offer { margin-top: auto; padding: 20px; }
.offer .big { font-size: 22px; font-weight: 700; margin: 6px 0 4px; color: #fff; }
.offer .note { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.sub-card { margin-top: auto; padding: 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, .18); }
/* Название переносится, а не режется многоточием: на узком экране рядом
   дата, и «1 месяц · 3 устройст…» читалось как поломка. */
.sub-card .name { font-size: 17px; font-weight: 600; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub-card .rowb { align-items: flex-start; }
.sub-card .date { display: flex; align-items: center; gap: 6px; flex: none; font-size: 13px; }
.sub-card .chips-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.sub-card .meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.sub-card .bar { margin-bottom: 16px; }
.sub-card .foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.4; }

/* --- Тарифы ---------------------------------------------------------------- */
.steps2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.steps2 span, .steps3 span { height: 4px; border-radius: 4px; background: rgba(190, 171, 254, .18); transition: background .3s; }
.steps2 span.on, .steps3 span.on { background: var(--mint); }
.for { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13px; color: var(--text-3); }
.for::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
.periods {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line-soft); margin-bottom: 12px;
}
.period {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 14px;
  border-radius: 16px; border: 1.5px solid rgba(190, 171, 254, .14); background: rgba(0, 0, 0, .15);
  color: var(--text); cursor: pointer; text-align: left; transition: all .25s;
}
.period:active { transform: scale(.97); }
.period.on { border-color: var(--mint); background: rgba(190, 171, 254, .1); box-shadow: 0 0 0 4px rgba(190, 171, 254, .08), 0 0 24px rgba(190, 171, 254, .15); }
.period .badge { position: absolute; top: -9px; right: 10px; padding: 3px 8px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; }
.period .lbl { font-size: 16px; font-weight: 600; }
.period .pr { align-self: stretch; text-align: right; }
.period .pr b { display: block; font-size: 20px; font-weight: 700; color: #fff; }
.period.on .pr b { color: var(--mint); }
.period .pr small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.period .pr s { display: block; font-size: 12px; color: var(--muted); }

/* Нижняя панель оплаты. */

/* --- Навигация ------------------------------------------------------------- */
.nav {
  position: absolute; left: 0; right: 0; bottom: calc(22px + var(--bottom)); z-index: 5; display: flex; justify-content: center;
  animation: fadeUp .35s both;
}

/* --- Тост ------------------------------------------------------------------ */
.toast {
  position: absolute; top: calc(64px + var(--head)); left: 16px; right: 16px; z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 16px;
  background: var(--mint); color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4); animation: fadeUp .3s var(--ease) both;
  visibility: hidden; opacity: 0; transition: opacity .25s, visibility .25s;
}
.toast.on { visibility: visible; opacity: 1; }
/* Во весь экран тост встаёт сразу под полосой кнопок Telegram («Назад»,
   «Закрыть», меню), а не поверх них. */
body.fs .toast { top: calc(var(--head) + 10px); }
.toast.bad { background: #D69B51; color: #0E0B16; }
.toast.bad svg { display: none; }

/* --- Шторки ----------------------------------------------------------------- */
.shade {
  position: absolute; inset: 0; z-index: 10; background: rgba(5, 4, 10, .7);
  animation: fade .22s both;
}
.sheet { position: absolute; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 11; animation: rise .34s var(--spring) both; will-change: transform; contain: layout paint; backface-visibility: hidden; transition: bottom .26s var(--ease); }
.shade { will-change: opacity; }
/* Закрытие: шторка уезжает вниз, затемнение гаснет; нажатия уже не ловятся. */
#sheet.leaving { pointer-events: none; }
#sheet.leaving .shade { animation: fadeOut .22s ease both; }
#sheet.leaving .sheet { animation: sink .22s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sink { from { transform: none; } to { transform: translate3d(0, 100%, 0); } }
.sheet .body {
  background: linear-gradient(180deg, #211B3A 0%, #18152C 100%); border: 1px solid var(--line); border-bottom: none;
  border-radius: 30px 30px 0 0; padding: 10px 22px calc(40px + var(--bottom)); box-shadow: 0 -20px 50px rgba(0, 0, 0, .35);
  max-height: 86vh; max-height: calc(86dvh - var(--kb, 0px)); overflow-y: auto; scrollbar-width: none;
  transition: max-height .26s var(--ease);
}
.sheet .grip { width: 38px; height: 5px; border-radius: 5px; background: rgba(190, 171, 254, .25); margin: 0 auto 20px; }
.sheet h2 { margin: 0 0 6px; font-size: 21px; font-weight: 700; color: #fff; }
.sheet h2.c { text-align: center; }
.sheet .lead { margin-bottom: 16px; }
.sheet .lead.c { text-align: center; }
.sheet .btn.q { margin-top: 0; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 3px solid rgba(190, 171, 254, .16); border-top-color: var(--mint); animation: spin .9s linear infinite; margin: 0 auto 16px; }
.okmark {
  width: 78px; height: 78px; border-radius: 50%; background: var(--mint); color: var(--ink); display: grid; place-items: center;
  animation: pop .5s both; box-shadow: 0 0 0 10px rgba(190, 171, 254, .12), 0 0 40px rgba(190, 171, 254, .4); margin: 0 auto 18px;
}
.warnmark { width: 56px; height: 56px; border-radius: 18px; background: rgba(214, 155, 81, .16); color: var(--pink-text); display: grid; place-items: center; margin-bottom: 14px; }
.pickrow {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 16px;
  border: 1.5px solid rgba(190, 171, 254, .14); background: rgba(0, 0, 0, .15); color: var(--text); cursor: pointer; text-align: left;
  margin-bottom: 8px;
}
.pickrow.on { border-color: var(--mint); background: rgba(190, 171, 254, .08); }
.pickrow .t { flex: 1; }
.pickrow .t b { display: block; font-size: 15px; font-weight: 600; }
.pickrow .t small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pickrow .tag { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: rgba(190, 171, 254, .14); color: var(--mint); white-space: nowrap; }
.pickrow .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(244, 242, 248, .3); flex: none; }
.pickrow.on .radio { background: var(--mint); box-shadow: none; display: grid; place-items: center; }
.key-groups { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 14px; }
.key-groups span { padding: 7px 10px; border-radius: 10px; background: rgba(190, 171, 254, .12); font-size: 17px; font-weight: 600; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--mint); }
.lnk {
  padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--mint); word-break: break-all; line-height: 1.5; -webkit-user-select: text; user-select: text;
}

/* --- Мастер подключения ----------------------------------------------------- */
.setup {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; padding: calc(76px + var(--head)) 24px calc(40px + var(--bottom));
  background: radial-gradient(80% 50% at 50% 30%, #211B3A 0%, #0E0B16 70%);
  overflow-y: auto; scrollbar-width: none;
}
.setup.enter { animation: fade .3s ease both; }
.setup.leaving { animation: fadeOutSetup .22s ease both; pointer-events: none; }
@keyframes fadeOutSetup { from { opacity: 1; } to { opacity: 0; } }
.setup .lnk { margin: 0 0 16px; text-align: left; }

/* --- Прочее ----------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; padding: 30px 20px; border-radius: 22px; background: var(--card-2); border: 1px solid var(--line-soft); animation: fade .3s; text-align: center; }
.empty b { font-size: 15px; font-weight: 500; }
.empty small { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ticket { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-soft); animation: fadeUp .35s both; margin-bottom: 8px; }
.ticket .t { flex: 1; min-width: 0; }
.ticket .t small { display: block; font-size: 12px; color: var(--muted); }
.ticket .t b { display: block; font-size: 15px; font-weight: 600; margin-top: 3px; }
.ticket .t span { display: block; font-size: 13px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.faq { border-radius: 18px; background: var(--card); border: 1px solid rgba(190, 171, 254, .14); overflow: hidden; transition: border-color .25s; margin-bottom: 8px; }
.faq.open { border-color: rgba(190, 171, 254, .35); }
.faq button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: none; background: none; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; }
.faq button svg { transition: transform .3s; }
.faq.open button svg { transform: rotate(180deg); }
.faq .a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.faq.open .a { grid-template-rows: 1fr; }
.faq .a > div { overflow: hidden; }
.faq .a p { margin: 0; padding: 0 16px 16px; font-size: 14px; line-height: 1.55; color: var(--text-3); }
.avatar { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--mint), #9F86F2); color: var(--ink); font-size: 22px; font-weight: 700; display: grid; place-items: center; flex: none; }
.profile-name { font-size: 18px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idbtn { display: flex; align-items: center; gap: 6px; padding: 0; margin-top: 3px; border: none; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.balance { position: relative; overflow: hidden; padding: 16px; border-radius: 24px; background: linear-gradient(140deg, rgba(190, 171, 254, .16), rgba(190, 171, 254, .04) 70%); border: 1px solid rgba(190, 171, 254, .28); margin-bottom: 20px; }
.balance .amt { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: #fff; margin-top: 2px; }
/* Карточка баланса в теме — сплошной мятный фон: приглушённый текст на нём
   тонул, поэтому делаем его тёмным, как остальные подписи на этой карточке. */
.balance .k { color: #2A2540; }
.balance .tag { padding: 5px 10px; border-radius: 999px; background: rgba(190, 171, 254, .14); color: var(--mint); font-size: 12px; font-weight: 500; white-space: nowrap; }
/* Сумма и «+N% с друзей» в один ряд, но с переносом: большая сумма не
   наезжает на чип, а уводит его на строку ниже — карточка не ломается. */
.bal-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bal-row .tag { align-self: center; min-height: 32px; }
.bal-note { color: #2A2540; font-size: 13px; line-height: 1.4; margin-top: 8px; }
/* Чипы банка/сети в выводе: компактнее обычных, чтобы влезал длинный список. */
.wd-picks { margin-bottom: 14px; }
/* Тап-цель не ниже 44px: чипы банков/сетей и способов — кнопки, по которым
   попадают пальцем. */
.wd-picks button { padding: 8px 12px; font-size: 13px; min-height: 44px; }
.linkbox { display: flex; align-items: center; gap: 8px; }
.linkbox .u { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); display: flex; align-items: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--mint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbox .ib { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid rgba(190, 171, 254, .3); background: none; color: var(--mint); display: grid; place-items: center; cursor: pointer; }
.linkbox .ib:active { transform: scale(.94); }
.linkbox .ib.danger { color: var(--pink-text); border-color: rgba(214, 155, 81, .4); }
/* Пригласительная ссылка — вся плашка нажимается и копируется; адрес читаемый
   (переносится целиком, код виден), а не обрезанная моноширинная строка. */
.reflink { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(190, 171, 254, .22); cursor: pointer; }
.reflink:active { transform: scale(.99); }
.reflink .rl-main { flex: 1; min-width: 0; }
.reflink .rl-main b { display: block; font-size: 13px; color: #fff; margin-bottom: 3px; }
.reflink .rl-url { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--mint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.35; }
.reflink .rl-ic { width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--mint); background: rgba(190, 171, 254, .12); }
.rl-stat { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 7px 2px 12px; }
.rl-del { margin-left: auto; background: none; border: none; color: var(--pink-text); font-size: 12px; cursor: pointer; padding: 2px 4px; }
/* Промокоды партнёра: код, скидка, тариф/срок, статистика и кто купил. */
.promo-card { padding: 14px; border-radius: 16px; background: rgba(190, 171, 254, .06); border: 1px solid var(--line-soft); margin-bottom: 10px; }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-top b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; color: #fff; letter-spacing: .04em; word-break: break-all; }
.pc-disc { flex: none; font-size: 13px; font-weight: 700; color: var(--mint); }
.pc-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pc-stats { display: flex; gap: 20px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.pc-stats b { color: #fff; font-weight: 700; }
.pc-buyers { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pc-b { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text); }
.pc-empty { margin-top: 10px; font-size: 12px; color: var(--muted); }
/* Скидка и бейдж статуса справа от кода — группой, чтобы не разъезжались. */
.pc-right { flex: none; display: flex; align-items: center; gap: 8px; }
/* Код на модерации/отклонённый/выключенный приглушаем — активные читаются первыми. */
.promo-card.muted { opacity: .8; }
/* Серый бейдж «выключен»: не беда (не розовый), но и не «живой» мятный. */
.chip.dim { background: rgba(255, 255, 255, .07); }
.chip.dim .dot { background: var(--muted); }
/* Ссылка партнёра — компактной строкой-раскрывашкой: имя и цифры снаружи,
   кнопки «поделиться»/«скопировать» справа; адрес, люди и «убрать» — внутри.
   Так и десять ссылок читаются ровным списком. */
.lnk-row { border-top: 1px solid var(--line-soft); }
.lnk-row:first-of-type { border-top: 0; }
.lnk-row > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 2px; cursor: pointer; }
.lnk-row > summary::-webkit-details-marker { display: none; }
.lnk-row > summary::after { content: '▾'; color: var(--muted); font-size: 11px; margin-left: 2px; transition: transform .15s; }
.lnk-row[open] > summary::after { transform: rotate(180deg); }
.lr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lr-t b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-t small { color: var(--muted); font-size: 12px; }
.lr-body { padding: 0 2px 12px; display: flex; flex-direction: column; gap: 10px; }
.lr-body .drill { margin: 0; }
.lr-body .rl-del { align-self: flex-start; margin: 0; padding: 2px 0; }
.lnk-ic { flex: none; display: flex; gap: 6px; }
.lnk-ic button { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .05); color: var(--mint); display: grid; place-items: center; cursor: pointer; }
.lnk-ic button:active { transform: scale(.94); }
.lnk-url { display: block; width: 100%; text-align: left; padding: 0; border: 0; background: none; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); font-size: 12.5px; word-break: break-all; line-height: 1.35; cursor: pointer; }
/* Свёрнутые «Неактивные» промокоды: раскрыл — карточки с отступом сверху. */
.off-codes { margin: 2px 2px 10px; }
.off-codes[open] > summary { margin-bottom: 8px; }
.promo-card .pc-stats .rl-del { margin: 0 0 0 auto; }
/* На узких экранах три цифры + «убрать» не должны вылезать за карточку. */
.promo-card .pc-stats { flex-wrap: wrap; row-gap: 4px; }
/* Раскрывашка «кто перешёл/применил» — под ссылкой и под промокодом. */
.drill { margin: 0 2px 12px; }
.drill > summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--mint); padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; }
.drill > summary::-webkit-details-marker { display: none; }
.drill > summary::before { content: '▸'; font-size: 10px; transition: transform .15s; }
.drill[open] > summary::before { transform: rotate(90deg); }
.drill > .list, .drill > .pc-buyers { margin-top: 6px; }
/* Сворачиваемый заголовок раздела (например «Приглашённые») — выглядит как
   .sec, но раскрывается по клику. Свёрнут по умолчанию — список не распирает
   экран. */
.sec-drill { margin-top: 18px; }
.sec-drill > summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.sec-drill > summary::-webkit-details-marker { display: none; }
.sec-drill > summary::after { content: '▾'; margin-left: auto; font-size: 11px; transition: transform .15s; }
.sec-drill[open] > summary::after { transform: rotate(180deg); }
.howto { padding: 6px 16px; }
.howto .st { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-faint); font-size: 14px; }
.howto .st:last-child { border-bottom: none; }
.howto .st i { width: 28px; height: 28px; flex: none; border-radius: 50%; background: rgba(190, 171, 254, .14); color: var(--mint); font-size: 13px; font-weight: 700; font-style: normal; display: grid; place-items: center; }
.howto .st i.on { background: var(--mint); color: var(--ink); }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-faint); }
.person:last-child { border-bottom: none; }
.person .av { width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(190, 171, 254, .14); color: var(--mint); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.person .t { flex: 1; min-width: 0; }
.person .t b { display: block; font-size: 14px; font-weight: 500; }
.person .t small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.person .st { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dashed { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px 16px; border-radius: 18px; border: 1px dashed rgba(190, 171, 254, .3); background: none; color: var(--text); cursor: pointer; text-align: left; }
.dashed .t { flex: 1; }
.dashed .t b { display: block; font-size: 14px; font-weight: 600; }
.dashed .t small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Ожидание загрузки. */
/* :not(.chip): у значка статуса «Выдаём ключ» тот же модификатор wait, и
   без исключения он раздувался в мигающий круг с отступом 40px. */
.wait:not(.chip) { text-align: center; color: var(--muted); padding: 40px 0; animation: bbDot 1.2s ease-in-out infinite; }

/* Кому движение мешает — тому без него: покачивание, дрейф пятен, кольца и
   переходы экранов выключаются системной настройкой. Цвета и состояния
   остаются, пропадает только анимация. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Отклик на касание: палец попал, даже если ответ сервера идёт секундами. */
.bb-press { transform: scale(.97); opacity: .8; }

.home { position: relative; }

/* Фото профиля поверх буквы: не загрузилось — остаётся буква. */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.balance .tag { display: inline-flex; align-items: center; gap: 2px; border: none; cursor: pointer; }
.balance .tag svg { width: 14px; height: 14px; color: var(--mint) !important; }

/* Способ «скоро»: виден, но не выбирается. */
.pickrow.soon { opacity: .6; cursor: default; }
.pickrow.soon .tag { background: rgba(214, 155, 81, .16); color: var(--amber); }
.pickrow .ic { width: 36px; height: 36px; flex: none; border-radius: 11px; background: rgba(190, 171, 254, .1); display: grid; place-items: center; }

/* Узкие экраны: кот в шапке рефералки не наезжает на заголовок и подзаголовок —
   текст отступает от правого края на ширину кота, сам кот чуть меньше. */
@media (max-width: 340px) {
  .sub-card .btn.g { font-size: 13px; padding-inline: 8px; white-space: nowrap; }
  .sub-card .btn.g svg { width: 16px; height: 16px; }
  /* Правая подпись «50% на баланс» наезжала на название программы — прячем. */
  .li .badge { display: none; }
}

/* Во весь экран сверху занята полоса кнопок Telegram: сцена чуть ниже, чтобы
   карточка подписки целиком помещалась над навигацией без прокрутки. */
body.fs .fadeTop { height: calc(var(--head) + 22px); }

/* --- Несколько подписок: карточки листаются --------------------------------
   Слайд во всю ширину, соседний выглядывает на ширину отступа — видно, что
   дальше есть ещё. Последний слайд — «Ещё одна подписка». */
.subs-wrap { margin-top: auto; }
.subs {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px;
}
.subs::-webkit-scrollbar { display: none; }
.subs .slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; }
.subs .slide > .card { flex: 1; margin: 0; }
.home .subs .sub-card { margin-top: 0; }
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 6px; padding: 22px 18px; border: 1.5px dashed rgba(190, 171, 254, .35); background: rgba(190, 171, 254, .04);
}
.add-card .plus { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(190, 171, 254, .12); color: var(--mint); margin-bottom: 4px; }
.add-card b { font-size: 17px; color: #fff; }
.add-card small { font-size: 13px; line-height: 1.45; color: var(--muted); max-width: 270px; margin-bottom: 8px; }
.add-card .btn { width: 100%; margin: 0; }
.dots { display: flex; justify-content: center; gap: 6px; }
/* Ряд листания под карточкой: [‹] точки [›]. Стрелки живут здесь, а не
   поверх карточки — ничего не перекрывают. На телефоне остаются одни точки. */
.dots-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; min-height: 20px; }
/* Точки кликабельны (листание без свайпа) — с запасом под палец/курсор. */
.dots i { position: relative; cursor: pointer; }
.dots i::after { content: ""; position: absolute; inset: -7px -5px; }
/* Стрелки — только на сайте в широком окне, мышкой свайп неудобен. */
.subs-arr { display: none; }
@media (min-width: 840px) {
  html.web .subs-arr {
    display: grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(190, 171, 254, .22);
    background: rgba(255, 255, 255, .04); color: var(--mint); cursor: pointer;
    transition: background-color .2s, border-color .2s, scale .15s var(--spring);
  }
  html.web .subs-arr:hover { background: rgba(190, 171, 254, .14); border-color: rgba(190, 171, 254, .45); }
  html.web .subs-arr:active { scale: .92; }
}
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(190, 171, 254, .25); transition: width .25s var(--ease), background .25s; }
.dots i.on { width: 18px; background: var(--mint); }
.dots i.add.on { background: var(--text-3); }
.menu button.on { color: var(--mint); }
.menu button .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.menu button .dot.ok { background: var(--mint); }
.menu button .dot.off { background: var(--pink); }

/* Тот же экран перерисован после нажатия: без анимаций появления, иначе
   каждое нажатие выглядит как перезагрузка страницы. Бесконечные (URBEX,
   кольца, светлячки) не трогаем. */
#screen.still .view,
#screen.still .ticket,
#screen.still .empty,
#screen.still [style*="animation"] { animation: none !important; }
.setup.still, .setup.still .step-in { animation: none !important; }

/* Невысокий экран во весь экран: сцена ниже, и маленький URBEX тоже
   поднимается и уменьшается, чтобы не наезжать на заголовок. */
@media (max-height: 700px) {
  /* Низкое окно (Telegram Desktop 400×650, iPhone SE): не зажимаем сцену до
     70px — главная докручивается, герой читаемого размера, выглядывающий
     URBEX (он был крупнее героя) спрятан; карточка с кнопками — над
     плавающей навигацией с запасом. */
  .view.home { height: auto; min-height: calc(100dvh - var(--head, 0px) - var(--bottom)); padding-bottom: calc(var(--bottom) + 92px); }
}


/* --- Плавность ---------------------------------------------------------------
   Единственная бесконечная анимация главной — мягкое свечение «луны» за
   логотипом. app.js ставит body.calm, когда открыт другой экран, шторка или
   приложение свёрнуто: работу, которую не видно, телефон не делает. */
@keyframes moonGlow { 0%, 100% { box-shadow: 0 0 60px rgba(93, 57, 159, .21); } 50% { box-shadow: 0 0 80px rgba(93, 57, 159, .38); } }
.app-scene::before { animation: moonGlow 6s ease-in-out infinite; }
body.calm .app-scene::before { animation-play-state: paused; }

/* --- Анкета в партнёры и блок вывода ------------------------------------- */
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-pick {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(190, 171, 254, .05); color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .12s;
}
.chip-pick:active { transform: scale(.96); }
.chip-pick.on { background: var(--mint); border-color: var(--mint); color: var(--ink); font-weight: 600; }
.pa-about {
  width: 100%; min-height: 88px; resize: vertical; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .18); color: var(--text); font: inherit; font-size: 15px; line-height: 1.4;
}
.pa-about:focus { outline: none; border-color: var(--mint); }
.pa-error { min-height: 0; max-height: 0; overflow: hidden; color: var(--pink-text); font-size: 13px; transition: max-height .2s var(--ease), margin .2s; }
.pa-error.on { max-height: 60px; margin-top: 10px; }
.wd .btn { margin: 0 0 10px; }
.wd .meta { display: flex; justify-content: space-between; margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.lnk-btn { display: block; margin-top: 8px; padding: 0; border: none; background: none; color: var(--mint); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Способы оплаты: настоящие логотипы и хорошо заметный выбор. */
.pickrow .radio { width: 24px; height: 24px; box-shadow: inset 0 0 0 2px rgba(244, 242, 248, .35); }
.pickrow.on { border-color: var(--mint); background: rgba(190, 171, 254, .12); box-shadow: 0 0 0 1px rgba(190, 171, 254, .35) inset; }
.pickrow.on .radio { background: #BEABFE; box-shadow: 0 0 0 4px rgba(190, 171, 254, .22); }
.pickrow.on .radio svg { width: 15px; height: 15px; stroke: #0E0B16; stroke-width: 3.4; }
/* «Скоро»: серая строка, но логотип различим. */
.pickrow.soon { opacity: 1; background: rgba(255, 255, 255, .02); border-color: rgba(190, 171, 254, .08); }
.pickrow.soon .t b, .pickrow.soon .t small { color: var(--muted); }
/* Логотип у способа «скоро» — в полном цвете: бледный знак СБП выглядел
   сломанным. Приглушён только текст и метка. */

/* --- Мастер: выбор устройства ------------------------------------------------ */
.watch {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: 13px; color: var(--mint);
}
.watch.off { color: var(--text-3); line-height: 1.45; }
.watch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: bbDot 1s ease-in-out infinite; }

/* Плитки устройств в мастере: класс .dev общий с карточками тарифов, и
   их анимация появления не должна повторяться при выборе устройства. */

/* --- Вывод: способы, реквизиты с проверкой на лету, сводка перед отправкой --- */
.wd-methods { margin-bottom: 14px; }
.wd-methods button { min-height: 44px; }
.field.bad, .field.bad:focus-within { border-color: var(--pink); }
.wd-hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin: -4px 2px 14px; min-height: 18px; }
.wd-hint.bad { color: var(--pink-text); }
.wd-sum .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.wd-sum .row span { color: var(--muted); flex: none; }
.wd-sum .row b { text-align: right; word-break: break-all; font-weight: 600; }
.wd-sum .mono, .person small .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.person .st.mint { color: var(--mint); }


/* --- Число устройств: карточки с картинкой ------------------------------------- */

/* --- Уровни тарифов (Стандарт / Про / Ультра) ----------------------------------- */

/* --- Пакеты трафика ---------------------------------------------------------- */
.packs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.pack {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 18px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); -webkit-tap-highlight-color: transparent;
  transition: border-color .22s, background-color .22s, transform .14s;
}
.pack:active { transform: scale(.985); }
.pack:hover { border-color: rgba(190, 171, 254, .4); }
.pack-gb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pack-gb b { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.pack-gb small { font-size: 12.5px; color: var(--muted); }
.pack-p { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.pack-p b { font-size: 17px; font-weight: 800; color: var(--mint); font-variant-numeric: tabular-nums; }
.pack-p small { font-size: 11.5px; color: var(--muted); }

/* --- Сроки строками ------------------------------------------------------------ */

/* --- Мастер: устройство узнали сами -------------------------------------------- */
.detect0 { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.detect0 .btn.g { margin-top: 8px; }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Шторки: клавиатура и смахивание ------------------------------------------- */
.sheet { bottom: var(--kb, 0px); transition: bottom .24s ease; touch-action: pan-y; }
.sheet.dragging { animation: none !important; transition: none !important; }
.sheet .grip { cursor: grab; }
.rename-sugg { margin: 12px 0 16px; }

/* --- Анкета партнёра ------------------------------------------------------------ */
.pa-head { margin-bottom: 14px; }
.pa-kicker { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); margin-bottom: 6px; }
.pa-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pa-perk { padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .16); border: 1px solid rgba(190, 171, 254, .14); display: flex; flex-direction: column; gap: 3px; }
.pa-perk .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--mint); background: rgba(190, 171, 254, .1); margin-bottom: 4px; }
.pa-perk .ic svg { width: 16px; height: 16px; }
.pa-perk b { font-size: 14.5px; color: #fff; }
.pa-perk small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pa-steps { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin: 4px 0 14px; }
.pa-steps span { white-space: nowrap; }
.pa-steps span.on { color: var(--mint); font-weight: 700; }
.pa-steps i { flex: 1; height: 1px; background: rgba(190, 171, 254, .2); min-width: 8px; }
.pa-sec { margin: 16px 0 8px; }
.pa-field { margin-top: 10px; }
.pa-hint { font-size: 12px; color: var(--muted); margin: 6px 2px 0; transition: color .2s; }
.pa-hint.bad { color: var(--pink-text); }
.pa-field.bad .field { border-color: rgba(214, 155, 81, .7); box-shadow: 0 0 0 3px rgba(214, 155, 81, .12); }
.pa-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 8px 0; line-height: 1.45; }

/* --- Вход на сайте (браузер, не Telegram) --------------------------------- */
.view.login { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 8px; }
.view.login .home-title { margin-top: 4px; }
.login-left { width: 100%; display: flex; flex-direction: column; align-items: center; }
.login-hero { width: 100%; animation: loginFloat 6s ease-in-out infinite; }
@keyframes loginFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-actions, .login-card { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.login-actions .btn, .login-card .btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-actions .btn svg, .login-card .btn svg { width: 20px; height: 20px; }
.login-card { padding: 22px 18px; border-radius: 26px; background: var(--card); border: 1px solid rgba(190, 171, 254, .16); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.login-card h2 { margin: 2px 0 0; font-size: 21px; color: #fff; }
.login-card p { margin: 0 0 4px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.login-card p b { color: var(--text); }
.login-ic { width: 58px; height: 58px; margin: 0 auto 4px; border-radius: 18px; display: grid; place-items: center; color: var(--mint); background: rgba(190, 171, 254, .1); border: 1px solid rgba(190, 171, 254, .25); animation: loginPop .5s var(--spring) both; }
.login-ic svg { width: 26px; height: 26px; }
.login-ic.tg { color: #fff; background: #2AABEE; border-color: transparent; box-shadow: 0 10px 26px rgba(42, 171, 238, .35); }
@keyframes loginPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.login-code { display: flex; justify-content: center; gap: 8px; margin: 6px 0 8px; }
.login-code span.dash { width: 14px; flex: none; background: none; border: 0; }
.login-code span { width: 44px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .25); border: 1.5px solid rgba(190, 171, 254, .35); animation: loginPop .45s var(--spring) both; }
@media (max-width: 360px) { .login-code { gap: 4px; } .login-code span { flex: 1 1 0; min-width: 0; max-width: 44px; font-size: 20px; } }
.login-wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.login-wait b { color: var(--text); font-variant-numeric: tabular-nums; }
.spin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(190, 171, 254, .25); border-top-color: var(--mint); animation: spin .9s linear infinite; }
.login-note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.btn.tg-btn { background: #2AABEE; color: #fff; box-shadow: 0 12px 28px rgba(42, 171, 238, .3); }
.fade-in { animation: fadeUp .35s var(--spring) both; }
#login-code { letter-spacing: .5em; text-align: center; font-size: 22px; font-weight: 700; }

/* Кабинет в браузере на компьютере: вокруг рамки — живой фон бренда,
   а не пустота; рамка чуть приподнята при появлении. */
html.web body { background: radial-gradient(1200px 800px at 20% 10%, rgba(190, 171, 254, .10), transparent 60%), radial-gradient(900px 700px at 85% 90%, rgba(214, 155, 81, .10), transparent 60%), #08060E; }
@media (min-width: 640px) and (min-height: 700px) {
  /* На сайте — не рамка телефона, а панель приложения: мягкая светящаяся
     кромка, чуть шире и выше, чтобы на мониторе было просторно. */
  html.web #phone {
    width: 460px;
    height: min(920px, 100%);
    border-radius: 34px;
    box-shadow:
      0 0 0 1px rgba(190, 171, 254, .18),
      0 0 60px rgba(190, 171, 254, .10),
      0 40px 90px rgba(0, 0, 0, .45);
    animation: phoneIn .6s var(--spring) both;
  }
}
@keyframes phoneIn { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Ссылки на тарифы и документы внизу профиля и экрана входа. */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 6px; margin: 18px 0 6px; }
.legal-links .quiet { width: auto; min-height: 44px; margin: 0; padding: 0 8px; font-size: 13px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.legal-links a.quiet { display: inline-flex; align-items: center; text-decoration: none; }
.legal-links .quiet:hover { color: var(--mint); }
.legal-links span { color: var(--muted); opacity: .5; font-size: 13px; }

/* Профиль: тарифы и документы — плитки 2×2. */
/* Оформление — как у остальных заголовков секций (.sec), только отступ свой. */
.docs-title { margin: 22px 4px 10px; }
.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.doc-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 104px; padding: 14px; text-align: left; cursor: pointer;
  border-radius: 18px; border: 1px solid rgba(190, 171, 254, .16); color: var(--text);
  background: linear-gradient(160deg, rgba(190, 171, 254, .1), rgba(0, 0, 0, .12));
  transition: transform .18s ease, border-color .2s ease, background-color .2s ease; -webkit-tap-highlight-color: transparent; }
.doc-tile:active { transform: scale(.97); }
.doc-tile:hover { border-color: rgba(190, 171, 254, .34); }
.doc-tile b { font-size: 15px; font-weight: 600; line-height: 1.2; }
.doc-tile small { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.doc-ic { width: 36px; height: 36px; margin-bottom: 6px; border-radius: 12px; display: grid; place-items: center; color: var(--mint);
  background: rgba(190, 171, 254, .12); border: 1px solid rgba(190, 171, 254, .2); }
.doc-ic svg { width: 19px; height: 19px; }

/* Знак СБП: по центру белого квадрата, чёткие края на любом масштабе. */
/* Оба логотипа (СБП и USDT) — одного размера по центру одинаковой плитки,
   object-fit сохраняет пропорции: стоят ровно и одинаково. */

/* Мелкие кнопки на вид остаются мелкими, а палец попадает по 44px:
   невидимая зона нажатия чуть шире самой кнопки. */
.chip-pick, .chips button, .idbtn, .balance .tag { position: relative; }
.chip-pick::after, .chips button::after { content: ""; position: absolute; inset: -5px 0; }
.idbtn::after { content: ""; position: absolute; inset: -14px -6px; }
.idbtn { min-height: 32px; }
.top a.brand { min-height: 32px; display: inline-flex; align-items: center; }
.side .legal-links .quiet, .side a.quiet { min-height: 32px; }
.balance .tag::after { content: ""; position: absolute; inset: -9px -4px; }
.sheet .login-wait { margin-top: 14px; }

/* === Сайт на компьютере ==================================================
   Широкое окно браузера (не Telegram): вместо «рамки телефона» посреди
   пустого экрана — полноценная раскладка. Слева боковое меню с подписями,
   справа — основная область, содержимое по центру удобной ширины. Шторки —
   окна по центру экрана. Телефон и Telegram эти правила не задевают. */
.side { display: none; }
@media (min-width: 840px) {
  html.web #stage { padding: 0; }
  html.web #phone {
    width: 100%; height: 100%; border-radius: 0; box-shadow: none; animation: none;
    background: radial-gradient(1100px 700px at 70% -10%, rgba(190, 171, 254, .08), transparent 60%), linear-gradient(180deg, #0E0B16 0%, #18152C 50%, #0E0B16 100%);
  }
  /* Боковое меню. */
  html.web.authed .side {
    display: flex; flex-direction: column; gap: 6px;
    position: absolute; top: 0; left: 0; bottom: 0; width: 264px; z-index: 8;
    padding: 26px 18px 22px; border-right: 1px solid rgba(190, 171, 254, .1);
    background: linear-gradient(180deg, rgba(14, 11, 22, .85), rgba(14, 11, 22, .92));
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    animation: sideIn .45s var(--spring) both;
  }
  /* Telegram на компьютере во весь экран рисует свою полосу управления сверху
     (--head). Опускаем под неё боковое меню, чтобы «URBEX» и первый пункт не
     попали под кнопки клиента. Контент справа отступ уже учитывает (#screen). */
  html.web.authed body.fs .side { top: var(--head); padding-top: 18px; }
  .side-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 22px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
  .side-brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
  .side-brand b { color: var(--mint); }
  .side-brand small { font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin-left: -2px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-i {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border-radius: 14px;
    border: 1px solid transparent; background: none; color: var(--muted); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  }
  .side-i:hover { background: rgba(190, 171, 254, .06); color: var(--text); }
  .side-i.on { background: rgba(190, 171, 254, .12); border-color: rgba(190, 171, 254, .28); color: var(--mint); }
  .side-ic { width: 26px; display: grid; place-items: center; }
  .side-ic svg { width: 21px; height: 21px; }
  .side-cta { margin-top: 18px; height: 50px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
  .side-cta svg { width: 18px; height: 18px; }
  /* Низ меню: заметная строка «На сайт» и ровная сетка документов 2×2 —
     вместо кучки из пяти разнокалиберных кнопок. */
  .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(190, 171, 254, .1); display: flex; flex-direction: column; gap: 4px; }
  .side-site { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; }
  .side-site svg { color: var(--mint); flex: none; }
  .side-site:hover { background: rgba(190, 171, 254, .06); color: var(--mint); }
  .side-legal { display: flex; flex-wrap: wrap; gap: 0 2px; padding: 0 2px; }
  .side-legal button { text-align: left; min-height: 32px; padding: 4px 8px; border: 0; background: none; color: var(--muted); font-size: 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
  /* Длинная «Конфиденциальность» уходит последней — второй строкой целиком,
     а не обрезается многоточием (тот же приём, что у .legal-links). */
  .side-legal button:nth-child(3) { order: 1; }
  .side-legal button:hover { color: var(--mint); background: rgba(190, 171, 254, .06); }
  @keyframes sideIn { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* Основная область справа от меню. */
  html.web.authed #scroll, html.web.authed .top, html.web.authed .fadeTop, html.web.authed #setup .setup { left: 264px; }
  html.web.authed .nav { display: none; }
  html.web.authed .top .brand { display: none; }
  html.web #scroll { scrollbar-width: thin; scrollbar-color: rgba(190, 171, 254, .25) transparent; }
  html.web #screen { max-width: 760px; margin: 0 auto; padding: calc(64px + var(--head)) 28px 120px; }
  html.web .top { padding: 16px 28px 0; height: 64px; }
  html.web .fadeTop { height: 76px; }
  html.web .toast { left: calc(264px + (100% - 264px - 440px) / 2); right: auto; width: 440px; top: 22px; }
  /* Мастер подключения — колонка по центру, а не растянутый во всю ширину экран.
     Проценты в padding считаются от ширины всего окна, поэтому вычитаем меню. */
  html.web #setup .setup { padding: 76px max(28px, calc((100% - 264px - 520px) / 2)) 48px; }

  /* Шторки — окна по центру. Сдвиг от перетаскивания (JS пишет transform)
     складывается с центровкой (свойство translate). */
  html.web .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(520px, calc(100vw - 48px)); translate: -50% -50%; animation: modalIn .28s var(--spring) both; }
  html.web.authed .sheet { left: calc(264px + (100vw - 264px) / 2); width: min(520px, calc(100vw - 264px - 48px)); }
  html.web .sheet .body { border-radius: 26px; border-bottom: 1px solid var(--line); padding: 14px 26px 26px; max-height: 84vh; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
  html.web .sheet .grip { display: none; }
  html.web #sheet.leaving .sheet { animation: modalOut .2s ease both; }
  @keyframes modalIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes modalOut { from { transform: none; opacity: 1; } to { transform: scale(.97); opacity: 0; } }

  /* Экран входа: слева крупно о сервисе, справа карточка входа. */
  html.web:not(.authed) #screen { max-width: 1040px; }
  /* Левая колонка (URBEX, заголовок, подпись) — один блок: его середина
     совпадает с серединой карточки входа, сколько бы строк в нём ни было. */
  html.web:not(.authed) .view.login {
    display: grid; grid-template-columns: 1fr 440px; grid-template-areas: "left card";
    align-items: center; align-content: center; justify-items: center; column-gap: 64px; min-height: calc(100vh - 200px);
  }
  html.web:not(.authed) .view.login .login-left { grid-area: left; justify-self: center; text-align: center; }
  /* На шагах ввода почты, кода и ожидания Telegram заголовка под URBEX нет,
     а у его картинки снизу пустое поле под тень — без поправки он стоит
     заметно выше середины карточки. Сдвиг на половину этого поля. */
  html.web:not(.authed) .view.login .login-left:has(> .login-hero:only-child) { margin-top: 48px; }
  html.web:not(.authed) .view.login .home-title { font-size: 40px; margin-top: 12px; }
  html.web:not(.authed) .view.login .home-sub { font-size: 17px; max-width: 460px; margin-top: 6px; }
  html.web:not(.authed) .view.login .login-actions,
  html.web:not(.authed) .view.login .login-card {
    grid-area: card; align-self: center; padding: 28px; border-radius: 26px;
    background: linear-gradient(160deg, rgba(43, 35, 80, .9), rgba(24, 21, 44, .9)); border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .4); justify-self: stretch;
  }
  html.web:not(.authed) .view.login .legal-links { gap: 0 2px; }
  html.web:not(.authed) .view.login .legal-links span { display: none; }
  html.web:not(.authed) .view.login .legal-links .quiet { padding: 0 6px; }
}
/* Большой монитор: главная — в две колонки (URBEX и статус слева, карточка
   подписки справа), чтобы не было длинной ленты с огромными кнопками. */
@media (min-width: 1280px) {
  html.web.authed #screen:has(> .view.home) { max-width: 1120px; }
  html.web.authed .view.home {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 468px); column-gap: 52px;
    align-items: center;
    grid-template-areas: "sw cards" "stage cards" "title cards" "sub cards";
    /* Высоту (ровно до центра экрана) задаёт общее правило ≥840 выше. */
    align-content: center;
  }
  /* URBEX на мониторе чуть компактнее — тогда левая колонка по высоте
     совпадает с карточкой справа и обе читаются одним ровным блоком. */
  /* Левый герой (переключатель, URBEX, заголовок) — на мягкой панели, чтобы
     он читался единым блоком вровень с карточкой справа, а не висел в пустоте.
     Панель рисуем псевдоэлементом с абсолютным позиционированием поверх левой
     колонки — без обёртки в DOM, чтобы не трогать мобильную вёрстку и анимации.
     align-self: stretch тянет её на всю высоту ряда карточки справа — так обе
     колонки одной высоты и верх/низ совпадают (ровно). */
  html.web.authed .view.home::before {
    content: ""; grid-column: 1 / 2; grid-row: 1 / -1; align-self: stretch; z-index: 0;
    /* По вертикали — ровно по карточке: верх ряда = верх карточки, снизу
       под карточкой ещё точки листания (10px + 6px) и отступ ленты (4px). */
    margin: 0 -38px; border-radius: 30px;
    background: linear-gradient(158deg, rgba(43, 35, 80, .78), rgba(22, 19, 40, .82));
    border: 1px solid rgba(190, 171, 254, .18); box-shadow: 0 30px 70px rgba(0, 0, 0, .38);
  }
  html.web.authed .view.home > * { position: relative; z-index: 1; }
  /* Меню переключателя подписок — поверх URBEX: правило «> *» своей
     специфичностью опускало переключатель до z-index:1, и картинка
     перекрывала открытый список подписок. */
  html.web.authed .view.home .switcher { z-index: 8; }
  html.web.authed .view.home .subs { margin: 0; padding: 0 0 4px; scroll-padding: 0; }
  html.web.authed .view.home .switcher { grid-area: sw; justify-self: center; margin-top: 20px; }
  /* В grid-центрировании переключатель сжимается до содержимого, и клэмп
     «100% − 24px» резал бы собственное имя («Моя под…») — тут места хватает. */
  html.web.authed .view.home .switcher > button { max-width: 420px; }
  html.web.authed .view.home .home-title { grid-area: title; font-size: 33px; }
  html.web.authed .view.home .home-sub { grid-area: sub; font-size: 16px; padding-bottom: 22px; }
  /* Карточка подписки — ровно по центру своей колонки; обе колонки одной
     высоты (панель растянута), поэтому центр карточки совпадает с центром
     URBEX, а верх и низ — на одной линии с панелью. */
  html.web.authed .view.home .subs-wrap, html.web.authed .view.home .card.offer { grid-area: cards; align-self: center; }
}

/* === Ровно и плавно =======================================================
   Экран появляется не одним куском, а по очереди: блоки и строки списков
   поднимаются друг за другом. Только при переходе (in/up) — тихие
   перерисовки (still) не мигают. */
#screen.in > .view > .login-left > :not(.login-hero),
#screen.up > .view > .login-left > :not(.login-hero) { animation: fadeUp .5s var(--spring) both; }
#screen.in > .view > :nth-child(2), #screen.up > .view > :nth-child(2) { animation-delay: .04s; }
#screen.in > .view > :nth-child(3), #screen.up > .view > :nth-child(3) { animation-delay: .08s; }
#screen.in > .view > :nth-child(4), #screen.up > .view > :nth-child(4) { animation-delay: .12s; }
#screen.in > .view > :nth-child(5), #screen.up > .view > :nth-child(5) { animation-delay: .16s; }
#screen.in > .view > :nth-child(6), #screen.up > .view > :nth-child(6) { animation-delay: .2s; }
#screen.in > .view > :nth-child(7), #screen.up > .view > :nth-child(7) { animation-delay: .24s; }
#screen.in > .view > :nth-child(n+8), #screen.up > .view > :nth-child(n+8) { animation-delay: .28s; }
#screen.in .list > .li, #screen.up .list > .li { animation: fadeUp .45s var(--spring) both; }
#screen.in .list > .li:nth-child(2), #screen.up .list > .li:nth-child(2) { animation-delay: .05s; }
#screen.in .list > .li:nth-child(3), #screen.up .list > .li:nth-child(3) { animation-delay: .1s; }
#screen.in .list > .li:nth-child(n+4), #screen.up .list > .li:nth-child(n+4) { animation-delay: .15s; }

/* Отклик на нажатия и наведение: мягко, без рывков. */
.btn { transition: transform .22s var(--spring), box-shadow .25s var(--ease), filter .2s, opacity .2s, background .25s, color .25s, border-color .25s; }
.btn:active { transform: scale(.97); transition-duration: .08s; }
.li { transition: background-color .2s var(--ease), transform .18s var(--spring); }
.li:active { transform: scale(.99); }
.card, .list { transition: border-color .25s var(--ease), box-shadow .3s var(--ease), transform .3s var(--spring); }
@media (hover: hover) and (pointer: fine) {
  .btn.p:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(214, 155, 81, .42); }
  .btn.tg-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(42, 171, 238, .42); }
  .btn.g:hover:not(:disabled) { background: rgba(190, 171, 254, .07); border-color: rgba(190, 171, 254, .6); }
  .li:not(.static):hover { background: rgba(190, 171, 254, .06); }
  .list:hover, .card:hover { border-color: rgba(190, 171, 254, .26); }
  .pill-btn { transition: background-color .2s, transform .2s var(--spring); }
  .pill-btn:hover { background: rgba(255, 255, 255, .18); }
}

/* Нижнее меню телефона: содержимое уходит под него в тень, а не торчит
   текстом между кнопками. */
.nav::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-22px - var(--bottom)); height: 84px; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(18, 15, 32, .92) 48%, rgba(18, 15, 32, 0));
}

/* Ссылки на документы: без точек-разделителей, которые повисали в конце
   строки. Длинная «Конфиденциальность» переносится последней и встаёт
   ровно по центру. */
.legal-links { gap: 0 4px; }
.legal-links span { display: none; }
.legal-links .quiet:nth-of-type(3) { order: 1; }
/* Подписи переносятся ровными строками, без одинокого слова внизу. */
.home-sub, .login-note, .login-card p, .view.login p { text-wrap: balance; }

@media (min-width: 840px) {
  /* «Назад» — по левому краю колонки, а не прижата к меню. */
  html.web .top { padding-left: max(28px, calc((100% - 264px - 760px) / 2 + 28px)); padding-right: max(28px, calc((100% - 264px - 760px) / 2 + 28px)); }
  /* Итог оплаты — ровно по ширине колонки. */
  /* Кнопка в меню: подпись свободно, не впритык к краям. */
  .side-cta { font-size: 14px; padding: 0 12px; white-space: nowrap; }
  /* Выглядывающий URBEX — жест для телефона; на мониторе про друзей есть пункт меню. */
  /* Мастер подключения: всё собрано по центру экрана, а не прижато к низу
     с пустым полем сверху. */
  html.web #setup .setup, html.web .setup.detect0 { justify-content: center; }
  /* Вход: URBEX, заголовок и подпись — одной ровной колонкой по центру. */
  html.web:not(.authed) .view.login { justify-items: center; }
  html.web:not(.authed) .view.login .home-title,
  html.web:not(.authed) .view.login .home-sub { text-align: center; }
  html.web:not(.authed) .view.login .legal-links { margin: 8px 0 -10px; }
  html.web:not(.authed) .view.login .legal-links .quiet:nth-of-type(3) { order: 0; }
}
/* Кабинет на десктопе: главная — РОВНО по центру экрана. Сверху и снизу
   одинаковый запас 64px (как верхний отступ #screen), высота без прокрутки:
   64 + (100vh − 128) + 64 = 100vh. */
@media (min-width: 840px) {
  html.web.authed #screen:has(> .view.home) { padding-bottom: 64px; }
  html.web.authed .view.home { margin-top: 0; height: auto; min-height: calc(100vh - var(--head, 0px) - 128px); }
}
@media (min-width: 840px) and (max-width: 1279.98px) {
  html.web.authed .view.home { justify-content: center; }
  /* Карточка — сразу под героем, а не утянута вниз остатком высоты. */
  html.web.authed .view.home .subs-wrap, html.web.authed .view.home .card.offer { margin-top: 26px; }
}
@media (min-width: 1280px) {
  /* Карточка подписки — ровно по центру левой колонки, а не прижата вниз. */
  html.web.authed .view.home .subs-wrap { margin: 0; }
}

/* --- Поддержка: список обращений и чат -------------------------------------- */
.list.tickets { padding: 0; }
.ticket-row { display: flex; align-items: center; gap: 12px; text-align: left; }
.ticket-row .t { flex: 1; min-width: 0; }
.ticket-row .t b { display: block; font-size: 15px; font-weight: 600; }
.ticket-row .t small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.ticket-meta .chip { white-space: nowrap; }
.unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* Точка непрочитанного на нижней навигации */
.nav-badge { position: absolute; top: 9px; right: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px #18152C; }

/* Чат одного обращения: шапка, лента, поле ввода, поднимается над клавиатурой */
.chat {
  position: absolute; left: 0; right: 0; top: 0; bottom: var(--kb, 0px); z-index: 20;
  display: flex; flex-direction: column; background: #18152C;
  padding-top: calc(58px + var(--head)); transition: bottom .26s var(--ease);
}
/* Тема и статус «ждём ответа» — заметной шапкой сверху. */
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line-soft); }
.chat-head .ch-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.chat-head b { font-size: 16px; font-weight: 700; color: #fff; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.chat-msgs::-webkit-scrollbar { display: none; }
.bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; animation: fadeUp .3s var(--spring) both; }
.bubble .bubble-t { display: block; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble time { display: block; font-size: 10.5px; opacity: .6; margin-top: 4px; text-align: right; }
.bubble.me { align-self: flex-end; background: var(--mint); color: var(--ink); border-bottom-right-radius: 5px; }
.bubble.op { align-self: flex-start; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-soft); color: var(--text); border-bottom-left-radius: 5px; }
.chat-note, .chat-empty { align-self: center; max-width: 280px; text-align: center; font-size: 13px; color: var(--muted); padding: 10px 16px; }
.chat-input { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px calc(10px + var(--bottom)); border-top: 1px solid var(--line-soft); background: #18152C; }
.chat-input .area { flex: 1; margin: 0; min-height: 44px; max-height: 120px; border-radius: 16px; resize: none; }
.chat-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--mint); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .14s, opacity .2s; }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-send:active:not(:disabled) { transform: scale(.92); }

/* Заметка об исчерпании белого списка на карточке подписки */
.wl-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(214, 155, 81, .12); color: var(--pink-text, #E0AC68); font-size: 12.5px; line-height: 1.4; }
.wl-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
