/* Freedom VPN — кабинет, редизайн «OLED».
   Один тёмный облик: истинный чёрный фон (на OLED-экране пиксели выключены), поверхности с лёгким синим
   отливом, акцент — градиент логотипа. Главный запоминающийся элемент — голубая волна в кнопке
   «Подключиться» и её эхо: кольца вокруг логотипа наверху. Остальное намеренно спокойное. */

/* ── Шрифт ──
   SF Pro — системный на iPhone и Mac. Inter 4.1 (OFL) — на Android и Windows; на Apple-устройствах не скачивается,
   потому что -apple-system стоит раньше. size-adjust выравнивает высоту прописных под SF. */
@font-face {
  font-family: "InterVar";
  src: url("assets/fonts/inter-latcyr.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  size-adjust: 97%;
}
/* Unbounded (OFL, Google Fonts) — пробуем в заголовках. Вариативный: один файл на все начертания 200–900.
   Лежит у нас, как Inter: кириллица 31 КБ и латиница 51 КБ, качается только нужная (unicode-range) и только
   там, где есть заголовок. Сравнить с прежним видом — параметр ?hfont=sf (панель «Демо» → «Шрифт заголовков»). */
@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Тот же Unbounded для обычного текста (режим «везде»): мельче на 10% — он заметно шире SF */
@font-face {
  font-family: "UnboundedText";
  src: url("assets/fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  size-adjust: 90%;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "UnboundedText";
  src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  size-adjust: 90%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Onest (OFL, Google Fonts) — вспомогательный текст в режиме «Unbounded + Onest»: подписи, пояснения, мета-строки.
   Лежит у нас: кириллица 16 КБ, латиница 34 КБ. */
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Токены ── */
:root {
  /* примитивы — в компонентах не используются напрямую */
  --ink-0: #000000;
  --ink-1: #0A0E14;
  --ink-2: #0F151E;
  --ink-3: #161F2B;
  --ink-4: #1D2837;
  --fg-1: #F3F7FF;
  --fg-2: #A3B1C6;
  --fg-3: #8591A7;
  --blue-800: #1B45D6;
  --blue-600: #2566E8;
  --blue-500: #2F7CF6;
  --blue-300: #8CC4FF;
  --cyan-400: #33CFF5;
  --cyan-200: #9BE8FF;
  --mint-400: #4ADE9B;
  --orange-400: #FF9A4D;
  --red-400: #FF6B6B;

  /* роли */
  --color-bg: var(--ink-0);
  --color-surface: var(--ink-1);
  --color-surface-raised: var(--ink-2);
  --color-control: var(--ink-3);
  --color-control-hover: var(--ink-4);
  --color-ring: rgba(170, 200, 255, 0.08);
  --color-ring-strong: rgba(170, 200, 255, 0.14);
  --color-separator: rgba(170, 200, 255, 0.08);
  --color-text: var(--fg-1);
  --color-text-secondary: var(--fg-2);
  --color-text-tertiary: var(--fg-3);
  --color-link: var(--blue-300);
  --color-accent: var(--blue-500);
  --color-accent-text: var(--blue-300);
  --color-accent-soft: rgba(47, 124, 246, 0.16);
  --color-accent-glow: rgba(47, 124, 246, 0.5);
  --color-wave: var(--cyan-400);
  --color-wave-light: var(--cyan-200);
  --color-success: var(--mint-400);
  --color-warning: var(--orange-400);
  --color-danger: var(--red-400);
  --color-warning-soft: rgba(255, 154, 77, 0.14);   /* подложка оранжевых меток («На рассмотрении») */
  --color-neutral-soft: rgba(255, 255, 255, 0.06);  /* подложка серых меток («Отменено») */
  --color-focus: var(--cyan-200);
  /* Переливающиеся главные кнопки (владелец 15-10-2026): градиент логотипа медленно перетекает, по нему бежит блик */
  --gradient-accent-flow: linear-gradient(115deg in oklab, var(--blue-800) 0%, var(--blue-600) 22%, #3C8DFF 40%, var(--blue-600) 58%, var(--blue-800) 78%, var(--blue-600) 100%);
  --shimmer: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.05) 70%, transparent 100%);
  --color-qr-bg: #FFFFFF;                          /* подложка QR-кода: сканеры ждут тёмное на светлом */
  --gradient-accent: linear-gradient(135deg in oklab, var(--blue-800) 0%, var(--blue-600) 60%, #276FEA 100%);

  --shadow-ring: 0 0 0 1px var(--color-ring);
  --shadow-ring-strong: 0 0 0 1px var(--color-ring-strong);
  --shadow-float: 0 0 0 1px var(--color-ring-strong), 0 18px 48px rgba(0, 0, 0, 0.65);
  /* Шар: флаги-значки серверов и карточка сервера (02-10-2026) */
  --color-success-soft: rgba(74, 222, 155, 0.14);
  --color-success-line: rgba(74, 222, 155, 0.38);
  --color-success-glow: rgba(74, 222, 155, 0.5);
  --shadow-pin: 0 3px 8px rgba(0, 0, 0, 0.6);
  --shadow-pin-edge: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  --shadow-top-light: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --pin-gloss: none;                                /* 02-10-2026: флаги плоские — блик «пуговицы» владельцу казался зеркальным */
  --pin-ring: 0 0 0 1.5px rgba(4, 8, 16, 0.55);     /* 02-10-2026: вместо белой обводки (не понравилась) — тёмная кромка, чтобы флаг отделялся от точек шара */
  --pin-dim: rgba(4, 8, 16, 0.22);                  /* значок, пока выбран другой сервер: чуть темнее (02-10-2026: 0.5 делала флаги бурыми), мельче — globe.js */
  --pin-size: 36px;                                 /* кнопка значка = выбранный значок; в обзоре globe.js уменьшает до 22 px */

  /* Движение: одни кривые на весь кабинет */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);    /* появление: трогается сразу, долго и мягко доезжает */
  --ease-fade: cubic-bezier(0.33, 1, 0.68, 1);      /* прозрачность */
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);     /* листы и окна — как в iOS */
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1); /* запасная «пружина» для старых WebView, настоящая — ниже */
  --dur-spring: 620ms;

  --font-ui: -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
  --font-secondary: "Onest", -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
  --font-heading: "Unbounded", -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
  --text-caption: 11px;
  --text-sm: 13px;
  --text-body: 15px;
  --text-lg: 17px;
  --text-title: 20px;
  --text-title-lg: 22px;
  --text-num: 28px;
  --text-screen: 30px;
  --text-hero: 68px;

  --pad: 16px;
  --r-card: 26px;
  --r-inner: 12px;
  --r-btn: 16px;
  --r-dock: 26px;
  --r-lens: 18px;
  --r-sheet: 28px;
  --dock-h: 66px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* Пружина (затухание 0,72): перелёт ~4% и мягкое успокоение. linear() понимают Safari 17.2+, Chrome 113+ */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0319, 0.1116, 0.2188, 0.3384, 0.4591, 0.5733, 0.6764, 0.7657, 0.8403, 0.9004, 0.9472, 0.9821, 1.0068, 1.0231, 1.0328, 1.0375, 1.0383, 1.0366, 1.0333, 1.029, 1.0244, 1.0198, 1.0155, 1.0116, 1.0083, 1.0056, 1.0034, 1.0017, 1.0005, 0.9996, 0.999, 1);
  }
}

/* ── Основа ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--color-bg); -webkit-text-size-adjust: 100%;
  /* Элемент в фокусе не должен прятаться под плавающим доком */
  scroll-padding-bottom: calc(var(--dock-h) + 24px + var(--safe-bottom));
  scroll-padding-top: var(--safe-top);
}
body {
  font-family: var(--font-ui);
  font-optical-sizing: auto;
  font-size: var(--text-body);
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, a, .dock, .tile, .seg, .platform-card, .dur-card { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--color-link); text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
/* После нажатия пальцем или мышью рамку не показываем — она нужна тем, кто ходит клавиатурой */
[data-input="pointer"] :focus-visible { outline: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--color-text-secondary); text-wrap: pretty; }
.small { font-size: var(--text-sm); }
.center { text-align: center; }

.icon {
  width: 24px; height: 24px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Штрих задан в единицах viewBox, поэтому у мелких иконок его подтягиваем, у крупных — ослабляем */
.tile-ic .icon, .seg-btn .icon { stroke-width: 2.1; }
.tile-chev, .banner-chev, .row-chev, .faq summary .icon, .tx-ic .icon { stroke-width: 2.3; }
.platform-card .p-ic .icon, .setup-ic .icon { stroke-width: 1.55; }

/* ── Каркас ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--safe-top) var(--pad) calc(var(--dock-h) + 36px + var(--safe-bottom));
}
.screens { position: relative; }
.tab-content { display: none; }
.tab-content.active { display: block; }
/* Смена вкладки — перекрёстная: прежняя гаснет на своём месте поверх, новая проявляется сверху вниз
   (cabinet.js: leaveTab / revealTab). top ставит скрипт, чтобы прежняя не прыгнула при прокрутке наверх. */
/* Нажатия блокирует inert (cabinet.js), а не pointer-events: наследуемое pointer-events у родителя анимированных
   блоков Chromium иногда не пересчитывает, и вкладка оставалась бы некликабельной */
.tab-content.leaving { display: block; position: absolute; left: 0; right: 0; z-index: 2; }

/* ── Заставка ── */
.splash {
  --splash-bg: #040a24;                                /* фон ролика заставки и шапки Telegram; свечение ролика у краёв чуть светлее — см. маску ниже */
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; align-content: center; gap: 22px;
  pointer-events: none;
}
.splash-bg { position: absolute; inset: 0; background: var(--splash-bg); transition: opacity 500ms var(--ease-out); }
/* Ролик на весь экран «cover»: птица уходит за край экрана, а не за невидимую границу кадра */
.splash-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--splash-bg);
  transition: opacity 480ms var(--ease-out), transform 640ms var(--ease-out);
}
/* Окно почти квадратное (планшет вертикально, растянутое окно Telegram Desktop): «cover» срезает верх кадра 9:16,
   и под шапкой #040a24 оказывается свечение ролика — растворяем верхние 40 px в фоне заставки.
   На телефоне и в широком ролике не нужно: там край и так ~#040a24, а птица в 16:9 уходит через верх экрана */
@media (min-aspect-ratio: 2/3) {
  .splash:not(.is-wide) .splash-video {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px);
            mask-image: linear-gradient(to bottom, transparent, #000 40px);
  }
}
/* Окно шире 16:9 (развёрнутый Telegram Desktop, ультраширокий монитор) срезает верх и у широкого ролика —
   тот же край. Птица там и так уходит за обрез, так что 40 px растворения ей не мешают */
@media (min-aspect-ratio: 16/9) {
  .splash.is-wide .splash-video {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px);
            mask-image: linear-gradient(to bottom, transparent, #000 40px);
  }
}
.splash:not(.video-off) .splash-mark { display: none; }
.splash.video-off .splash-video { display: none; }
/* Ролик встал или оборвался — стоп-кадр гаснет вместе с подписью (260 мс, index.html), затем прежняя заставка:
   логотип проявляется, подпись возвращается уже под ним */
.splash.video-fail .splash-video { opacity: 0; transition: opacity 240ms var(--ease-out), transform 640ms var(--ease-out); }  /* уход во время затухания — тоже плавно */
.splash.video-fail .splash-word { opacity: 0; transition: opacity 240ms var(--ease-out); }
.splash.video-late .splash-mark { animation: splash-mark-in 420ms var(--ease-out) both; }
@keyframes splash-mark-in { from { opacity: 0; transform: scale(0.92); } }
/* Подпись — под логотипом ролика: остриё щита в кадре 9:16 на ~64 % высоты, подпись — на 68 %.
   Высота кадра при «cover» — большая из высоты экрана и ширины × 16/9; подпись растёт вместе с кадром
   (32 px при кадре 874 px), чтобы на планшете и в высоком окне Telegram Desktop держать пропорцию к логотипу.
   Рамка — по тексту, а не во всю ширину: под ней мягкая подложка цвета фона, и лучи и волна удара
   (1,30–1,5 с петли, как раз момент ухода заставки) проходят «под» подписью, а не режут буквы */
.splash:not(.video-off) .splash-word {
  position: absolute; left: 0; right: 0; z-index: 1;
  width: max-content; margin: 0 auto;
  top: calc(50% + 0.18 * max(100%, 100vw * 16 / 9));
  font-size: clamp(32px, 0.0366 * max(100vh, 100vw * 16 / 9), 64px);
}
.splash:not(.video-off) .splash-word::before {
  content: ""; position: absolute; inset: -0.45em -1em; z-index: -1; pointer-events: none;   /* в em — растёт вместе с подписью */
  background: radial-gradient(closest-side, rgba(4, 10, 36, 0.88) 72%, rgba(4, 10, 36, 0));
  animation: sw-plate 600ms var(--ease-out) 180ms both;
}
@keyframes sw-plate { from { opacity: 0; } }
/* Широкое окно (компьютер) — ролик 16:9: логотип на 46 % высоты кадра, остриё щита на ~17 % ниже центра,
   подпись — на 20 %. Высота кадра при «cover» — большая из высоты окна и ширины × 9/16; подпись растёт вместе
   с кадром, чтобы держать ту же пропорцию к логотипу, что и на телефоне */
.splash.is-wide:not(.video-off) .splash-word {
  top: calc(50% + 0.2 * max(100%, 100vw * 9 / 16));
  font-size: clamp(32px, 0.048 * max(100vh, 100vw * 9 / 16), 64px);
}
.splash.leaving .splash-video { opacity: 0; transform: scale(1.06); }
.splash-mark { position: relative; width: 112px; height: 112px; }
.splash-logo { position: relative; width: 112px; height: 112px; will-change: transform; filter: drop-shadow(0 10px 36px rgba(47, 124, 246, 0.55)); }
.splash-ring {
  position: absolute; inset: -22px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(51, 207, 245, 0.0) 62%, var(--color-wave) 88%, var(--color-wave-light) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: spin 1.1s linear infinite;
}
/* Надпись: «Freedom» — жирная, белая с переходом в ледяной голубой; «VPN» — цвета логотипа (голубой → синий)
   с мягким свечением. Появляются по очереди: слово поднимается из размытия, «VPN» — следом, чуть сжимаясь */
.splash-word {
  position: relative;
  display: flex; align-items: baseline; justify-content: center; gap: 0.26em;
  font-family: var(--font-display); font-size: 32px; line-height: 1.15; letter-spacing: -0.025em;
  transition: opacity 250ms var(--ease-out);
}
.splash.video-off .splash-word { font-size: 26px; }
.sw-a, .sw-b { -webkit-background-clip: text; background-clip: text; color: transparent; }
.sw-a {
  font-weight: 800;
  background-image: linear-gradient(180deg, #FFFFFF 25%, #C9F3FF 100%);
  filter: drop-shadow(0 0 16px rgba(111, 243, 255, 0.28));
  animation: sw-rise 820ms var(--ease-out) 180ms both;
}
.sw-b {
  font-weight: 700; letter-spacing: 0.02em;
  background-image: linear-gradient(180deg, #6FF3FF 0%, #22D3F5 45%, #1F6BFF 100%);
  filter: drop-shadow(0 0 18px rgba(31, 107, 255, 0.55));
  animation: sw-pop 900ms var(--ease-out) 360ms both;
}
@keyframes sw-rise {
  from { opacity: 0; transform: translateY(12px); filter: blur(6px) drop-shadow(0 0 16px rgba(111, 243, 255, 0)); }
  to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 0 16px rgba(111, 243, 255, 0.28)); }
}
@keyframes sw-pop {
  from { opacity: 0; transform: scale(1.18) translateY(4px); filter: blur(5px) drop-shadow(0 0 18px rgba(31, 107, 255, 0)); }
  to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 0 18px rgba(31, 107, 255, 0.55)); }
}
.splash.leaving .splash-bg { opacity: 0; }
.splash.leaving .splash-ring, .splash.leaving .splash-word { opacity: 0; transition: opacity 200ms ease-out; }
.splash.leaving .splash-logo { opacity: 0; transform: scale(0.92); transition: opacity 360ms ease-out, transform 360ms ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-view {
  max-width: 420px; min-height: 100dvh; margin: 0 auto; padding: 0 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  text-align: center;
}
.error-logo { margin: 0 auto 8px; filter: drop-shadow(0 10px 30px rgba(47, 124, 246, 0.5)); }
.error-title { font-family: var(--font-display); font-size: var(--text-title-lg); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.error-text { color: var(--color-text-secondary); text-wrap: pretty; margin-bottom: 8px; }

/* Вход после загрузки: одна сцена, куски по очереди через 90 мс. Прозрачность короче, сдвиг и резкость — дольше */
.app-entering .enter { opacity: 0; }
.app-in .enter {
  animation: enter-fade 460ms var(--ease-fade) both, enter-move 760ms var(--ease-smooth) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes enter-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enter-move {
  from { transform: translateY(14px); filter: blur(5px); }
  to { transform: none; filter: none; }
}
.dock.enter { animation-name: enter-fade, enter-dock; }
@keyframes enter-dock {
  from { transform: translate(-50%, 18px); filter: blur(5px); }
  to { transform: translate(-50%, 0); filter: none; }
}

/* ── Сцена наверху ── */
/* Шар закреплён сзади. --p (0…1) — насколько блок поднят поверх шара: шар уменьшается к верху и темнеет. */
.hero {
  --hero-h: 252px;
  position: fixed; top: var(--safe-top); left: 50%; z-index: 0;
  width: min(100%, 480px); height: var(--hero-h);
  display: grid; place-items: center;
  overflow: hidden;
  overflow: clip;            /* не прокручивается, даже когда фокус с клавиатуры на значке у края (clip — не контейнер прокрутки) */
  pointer-events: none;
  transform-origin: 50% 0;
  transform: translateX(-50%) translateY(calc(var(--p, 0) * -14px)) scale(calc(1 - var(--p, 0) * 0.42));
  /* Низ сцены растворяется в чёрном, верх — на 14 px (приближенный шар не срезается ровной линией);
     бока — тем сильнее, чем меньше шар: уменьшенная сцена не должна
     проступать прямоугольником (свечение шара шире её краёв) */
  -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent),
    linear-gradient(90deg, transparent, #000 calc(var(--p, 0) * 22%), #000 calc(100% - var(--p, 0) * 22%), transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(transparent, #000 14px, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent),
    linear-gradient(90deg, transparent, #000 calc(var(--p, 0) * 22%), #000 calc(100% - var(--p, 0) * 22%), transparent);
          mask-composite: intersect;
}
.hero-dim { position: absolute; inset: 0; z-index: 2; background: #000; opacity: calc(var(--p, 0) * 0.82); pointer-events: none; }
/* Блок с подпиской — одно целое поверх шара. Верх прозрачный: в покое сквозь него видно низ шара. */
.main-block {
  position: relative; z-index: 1;
  margin: 0 calc(-1 * var(--pad));
  padding: 0 var(--pad);
  min-height: calc(100dvh - var(--dock-h) - 36px - var(--safe-bottom) - var(--safe-top));
  /* Прозрачный → чёрный по плавной кривой (smoothstep, 260 px): без заметной границы с шаром */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.000) 0px, rgba(0, 0, 0, 0.015) 19px, rgba(0, 0, 0, 0.055) 37px, rgba(0, 0, 0, 0.118) 56px, rgba(0, 0, 0, 0.198) 74px, rgba(0, 0, 0, 0.292) 93px, rgba(0, 0, 0, 0.394) 111px, rgba(0, 0, 0, 0.500) 130px, rgba(0, 0, 0, 0.606) 149px, rgba(0, 0, 0, 0.708) 167px, rgba(0, 0, 0, 0.802) 186px, rgba(0, 0, 0, 0.882) 204px, rgba(0, 0, 0, 0.945) 223px, rgba(0, 0, 0, 0.985) 241px, rgba(0, 0, 0, 1.000) 260px);
}
/* Отступ под шар — внутренним отступом вкладки: внешний «протекал» наружу и сдвигал фон страницы (была видна линия) */
#tab-main { padding-top: calc(252px - 34px); }
.hero-glow {
  position: absolute; left: 50%; top: 80%;
  width: 620px; height: 620px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(37, 102, 232, 0.26), rgba(27, 69, 214, 0.08) 55%, transparent 75%);
}
/* Шар из точек (globe.js). Крутится пальцем по горизонтали, вертикальная прокрутка не мешает. */
.globe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: auto; touch-action: pan-y; cursor: grab;
  opacity: 0; transition: opacity 700ms var(--ease-out);
}
.globe.on { opacity: 1; }
.globe:active { cursor: grabbing; }

/* Флаги-значки над городами серверов. Кнопки создаёт cabinet.js (SERVERS), globe.js каждый кадр ставит их центр
   над городом (transform и opacity — без перестройки страницы). Кнопка размером с выбранный значок, в обзоре
   уменьшена до 22 px: уменьшенный флаг остаётся чётким. Ножки, точки городов и тени значков рисует globe.js
   на холсте шара — под значками. */
.pins { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0;
  width: var(--pin-size); height: var(--pin-size);
  margin: calc(var(--pin-size) / -2) 0 0 calc(var(--pin-size) / -2);    /* transform двигает центр значка */
  border-radius: 50%;
  pointer-events: auto; touch-action: pan-y;
  opacity: 0;
  will-change: transform, opacity;
}
/* Палец шире значка: зона касания больше круга */
.pin::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
/* Почти погас за краем шара — не нажимается (globe.js); с клавиатуры дойти можно: шар повернётся к нему */
.pin.is-off { pointer-events: none; }
.pin-in { position: absolute; inset: 0; display: block; transition: scale 150ms ease-out; }
.pin:active .pin-in { scale: 0.88; }
.pin-disc {
  position: relative; display: block; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  background: var(--color-control);
  box-shadow: var(--pin-ring), var(--shadow-pin);
}
.pin-disc svg { display: block; width: 100%; height: 100%; }
/* Блик слева сверху и тень снизу — выпуклая «пуговица» */
.pin-disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--pin-gloss); box-shadow: var(--shadow-pin-edge);
  transition: background-color 360ms var(--ease-fade);
}
/* Пока выбран другой сервер — темнее (не прозрачнее: сквозь флаг не видно точек шара) */
.pin.is-dim .pin-disc::after { background-color: var(--pin-dim); }
.pin.is-dim .pin-new { opacity: 0.6; }
/* Выбранный: мятное кольцо и свечение вокруг флага */
.pin::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-success), 0 0 20px 4px var(--color-success-glow);
  opacity: 0; transform: scale(0.7);
  transition: opacity 220ms var(--ease-fade), transform 380ms var(--ease-out);
}
.pin.is-on { z-index: 1; }
.pin.is-on::before { opacity: 1; transform: none; transition: opacity 320ms var(--ease-fade), transform 760ms var(--ease-spring); }
/* Метка «новый» под флагом (Чехия, Македония); у выбранного прячется — «новый» есть в карточке */
.pin-new {
  position: absolute; left: 50%; top: 100%;
  transform: translate(-50%, -32%);
  padding: 3px 6px 4px; border-radius: 999px;
  background: var(--color-surface-raised); color: var(--color-success);
  box-shadow: inset 0 0 0 1.5px var(--color-success-line), var(--shadow-pin);
  font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 700; line-height: 1; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity 260ms var(--ease-fade), transform 420ms var(--ease-out);
}
.pin.is-on .pin-new { opacity: 0; transform: translate(-50%, -80%) scale(0.6); }
.pin:focus-visible { outline: none; }
:root:not([data-input="pointer"]) .pin:focus-visible .pin-disc { box-shadow: 0 0 0 2.5px var(--color-text), 0 0 0 7px var(--color-focus), var(--shadow-pin); }

/* Карточка сервера: выезжает из-под шара, когда нажат флаг, а всё ниже (карточка подписки и остальное) съезжает
   на её высоту — шар остаётся открытым целиком. Прокрутка, касание мимо или ✕ — карточка уходит, блок встаёт
   на место (cabinet.js: openServer / closeServer, сдвиг — --srv-push). Закрыта — прозрачная и inert. */
.srv-card {
  position: absolute; left: var(--pad); right: var(--pad); top: -14px; z-index: 3;
  overflow: hidden;
  padding: 12px 46px 13px 12px;
  border-radius: var(--r-card);
  background:
    radial-gradient(130% 150% at 0% 0%, var(--color-success-soft), transparent 55%),
    var(--color-surface-raised);
  box-shadow: var(--shadow-float), var(--shadow-top-light);
  opacity: 0; transform: translateY(-14px) scale(0.97); transform-origin: 50% 0;
  transition: opacity 180ms var(--ease-fade), transform 240ms var(--ease-out);
}
.srv-card.open { opacity: 1; transform: none; transition: opacity 260ms var(--ease-fade) 40ms, transform 760ms var(--ease-spring); }
.main-block > :is(#has-sub, #no-sub) { transition: transform 560ms var(--ease-sheet); }
.main-block.srv-push > :is(#has-sub, #no-sub) { transform: translateY(var(--srv-push, 0px)); transition: transform 780ms var(--ease-spring); }
/* Закрыть сразу (смена вкладки, лист поверх) — без анимации */
.main-block.srv-instant > :is(#has-sub, #no-sub), .main-block.srv-instant .srv-card { transition: none !important; }
.srv-top { display: flex; align-items: center; gap: 12px; }
.srv-flag {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  box-shadow: var(--pin-ring), 0 0 0 4px var(--color-success-soft), var(--shadow-pin);
}
.srv-flag svg { display: block; width: 100%; height: 100%; }
.srv-flag::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pin-gloss); box-shadow: var(--shadow-pin-edge); }
.srv-title { min-width: 0; }
.srv-name {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
}
.srv-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-new {
  flex: none; padding: 3px 7px; border-radius: 999px;
  background: var(--color-success-soft); box-shadow: inset 0 0 0 1px var(--color-success-line);
  font-family: var(--font-ui); font-size: var(--text-caption); font-weight: 600; line-height: 1.1; letter-spacing: 0.02em; color: var(--color-success);
}
.srv-new[hidden] { display: none; }
.srv-city {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: var(--text-sm); color: var(--color-text-secondary); white-space: nowrap;
}
.srv-city > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Местное время города — после точки, с часами */
.srv-time { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.srv-time::before { content: "·"; margin-right: 2px; }
.srv-time .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.srv-time b { font-family: var(--font-ui); font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }
/* Пояснение — что это за сервер; при смене сервера высота карточки меняется плавно (cabinet.js) */
.srv-note { margin-top: 10px; font-size: var(--text-sm); line-height: 1.4; color: var(--color-text); text-wrap: pretty; }
.srv-close {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: var(--color-text-secondary);
  transition: background-color 200ms var(--ease-fade), scale 150ms ease-out;
}
.srv-close:active { scale: 0.92; background: var(--color-control); }
.srv-close .icon { width: 20px; height: 20px; stroke-width: 2.1; }
/* Появление по очереди: флаг «вспрыгивает» пружиной, текст догоняет */
.srv-flag, .srv-title, .srv-note { transition: transform 700ms var(--ease-spring), opacity 360ms var(--ease-fade); }
.srv-card:not(.open) .srv-flag { transform: scale(0.4) rotate(-24deg); opacity: 0; transition-duration: 180ms; }
.srv-card:not(.open) :is(.srv-title, .srv-note) { transform: translateY(8px); opacity: 0; transition-duration: 180ms; }
.srv-card.open .srv-flag { transition-delay: 80ms; }
.srv-card.open .srv-title { transition-delay: 130ms; }
.srv-card.open .srv-note { transition-delay: 180ms; }

/* ── Карточка статуса ── */
.status-card {
  --status: var(--color-success);
  position: relative;
  margin-top: 0;
  padding: 18px 14px 14px;
  border-radius: var(--r-card);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(47, 124, 246, 0.09), transparent 60%),
    var(--color-surface-raised);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.status-card[data-state="soon"] { --status: var(--color-warning); }
.status-card[data-state="expired"] { --status: var(--color-danger); }
.status-card[data-state="trial"] { --status: var(--color-accent-text); }
/* Заголовок карточки — как заглавие экрана в iOS: состояние выделено цветом и мягко подсвечено */
.status-title {
  margin: 0 4px;
  font-family: var(--font-display); font-size: clamp(24px, 7.4vw, var(--text-screen)); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance;
  color: var(--color-text);
}
.status-title .st-tail {
  color: var(--status);
  text-shadow: 0 0 22px color-mix(in srgb, var(--status) 32%, transparent);
  transition: color 760ms var(--ease-fade), text-shadow 760ms var(--ease-fade);
}
.status-title .st-head { color: var(--color-text); transition: color 680ms var(--ease-fade); }
.status-title.swap :is(.st-head, .st-tail) { transition: none; }          /* слово меняется — цвет встаёт тем же кадром */
/* Вход в кабинет: вся строка загорается цветом состояния, потом «Подписка» гаснет обратно в белый */
.status-title.intro :is(.st-head, .st-tail) { color: var(--color-text); text-shadow: none; }
.status-title.intro.lit :is(.st-head, .st-tail) { color: var(--status); }
.status-title.intro.lit .st-tail { text-shadow: 0 0 22px color-mix(in srgb, var(--status) 32%, transparent); }
.days { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 10px 4px 0; }
.days .chip-btn { margin-left: auto; align-self: center; }
/* Число, подпись и «Продлить» в строку не помещаются (узкое окно Telegram, трёхзначное число) — «Продлить» остаётся
   справа от числа, подпись уходит под число, а не кнопка вниз (fitDaysRow в cabinet.js) */
.days.is-stacked .chip-btn { order: 2; }
.days.is-stacked .days-label { order: 3; flex-basis: 100%; margin-top: 6px; }
.days-num {
  font-family: var(--font-display);
  font-size: var(--text-hero); font-weight: 700; line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #FFFFFF 30%, #BFD8FF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.status-card[data-state="expired"] .days-num { background: none; color: var(--color-text-tertiary); }
.days-num { display: inline-block; flex: none; text-align: start; }
.days-num.is-inf { font-size: 84px; line-height: 0.62; translate: 0 -2px; }   /* у «∞» нет выносных — иначе под заглавием дыра */     /* число не сжимается — подпись переносится под него */
.days-label { font-size: var(--text-lg); font-weight: 500; color: var(--color-text-secondary); white-space: nowrap; }
.days-meter { height: 4px; margin: 14px 4px 0; border-radius: 2px; background: var(--color-control); overflow: hidden; }
.days-meter span {
  display: block; height: 100%; width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg in oklab, var(--blue-600), var(--cyan-400));
  transition: width 1200ms var(--ease-smooth), background-color 400ms var(--ease-fade);
}
.days-meter span, .meter span { transform-origin: 0 50%; }     /* заполнение заново при возврате на главную */
.status-card[data-state="soon"] .days-meter span { background: var(--color-warning); }
.status-card[data-state="expired"] .days-meter span { background: var(--color-danger); }
.status-sub { margin: 10px 4px 0; font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: pretty; }
/* Колонка не уже 9,5em: при крупном тексте (Android «Размер шрифта») плитки сами встают в одну колонку */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap: 10px; margin-top: 16px; }
.tile {
  container-type: inline-size;              /* стрелка прячется, когда плитка слишком узкая (ниже) */
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 10px 8px 10px 12px;
  border-radius: var(--r-inner);
  background: var(--color-control);
  text-align: start;
  transition-property: background-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.tile:active { scale: 0.96; }
.tile-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); flex: none; }
.tile-ic .icon { width: 20px; height: 20px; }
.tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile-label { font-size: var(--text-sm); color: var(--color-text-tertiary); }
.tile-value { font-size: var(--text-lg); font-weight: 600; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; font-variant-numeric: tabular-nums; }   /* длинное слово переносится по слогам, а не рвётся посередине */
.tile-chev { width: 18px; height: 18px; color: var(--color-text-tertiary); }
/* Стрелка чуть уезжает вперёд, пока палец на кнопке — «сейчас откроется» */
.tile-chev, .banner-chev, .row-chev { transition: translate 220ms var(--ease-out); }
.tile:active .tile-chev, .banner:active .banner-chev,
.bypass:active .banner-chev, .row-link:active .row-chev, .pick-row:active .row-chev, .route-card:active .row-chev { translate: 3px 0; }

/* ── Кнопка с волной ── */
.wave-btn {
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 60px; margin-top: 16px; padding: 10px 18px 16px;   /* низ шире — надпись над гребнем волны */
  border-radius: 20px; overflow: hidden;
  color: #fff; font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.005em;
  background: var(--gradient-accent);
  box-shadow: inset 0 0 0 1px rgba(155, 232, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 34px -10px var(--color-accent-glow);
  transition-property: scale, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
}
.wave-btn:active { scale: 0.96; }
.wave { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.wave svg { position: absolute; left: 0; bottom: 0; width: 200%; fill: currentColor; }
/* Волна фиксированной высоты у низа: при двух строках надписи она не наползает на текст */
.wave .w1 { height: 30px; color: rgba(51, 207, 245, 0.42); animation: wave 5.2s linear infinite; }
.wave .w2 { height: 26px; color: rgba(155, 232, 255, 0.26); animation: wave 8.4s linear infinite reverse; }
.step .wave-btn .w1 { height: 27px; }
.step .wave-btn .w2 { height: 24px; }
/* Под открытым листом волна стоит — лишнее движение и батарея */
.sheet-open #app .wave svg { animation-play-state: paused; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.wave-label { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; text-align: center; text-shadow: 0 1px 3px rgba(8, 24, 80, 0.55); padding-inline-end: 4px; }
.wave-label .icon { width: 20px; height: 20px; }
.wave-btn.is-expired { background: linear-gradient(135deg in oklab, #1B45D6, #2566E8); }
/* От места касания расходится светлый круг — та же «волна» (cabinet.js: ripple) */
.ripple {
  position: absolute; z-index: -1; left: 0; top: 0;       /* над волной, под надписью */
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(155, 232, 255, 0.55), rgba(155, 232, 255, 0));
  pointer-events: none;
}

/* ── Общие элементы ── */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 24px; }
.card {
  position: relative;
  padding: 18px 16px;
  border-radius: 32px;                 /* кнопки внутри r16 + отступ 16 */
  background: var(--color-surface);
  box-shadow: var(--shadow-ring);
}
.card + .card, .card + .btn { margin-top: 12px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.card-head-row .card-title { margin: 0; }
.card-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); flex: none; }
.card-title { font-size: var(--text-title); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 12px; text-wrap: balance; }
.card-head .card-title { margin: 0; }
.card-sub { font-size: var(--text-sm); color: var(--color-text-secondary); }
.anchor { position: absolute; top: -90px; }
.list-label { margin: 18px 0 8px; font-size: var(--text-sm); font-weight: 500; color: var(--color-text-tertiary); }
.empty { padding: 18px 8px; text-align: center; font-size: var(--text-sm); color: var(--color-text-tertiary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border-radius: var(--r-btn);
  font-size: var(--text-body); font-weight: 600;
  transition-property: scale, background-color, opacity; transition-duration: 150ms; transition-timing-function: ease-out;
}
.btn:active:not(:disabled) { scale: 0.96; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.btn .icon { width: 20px; height: 20px; stroke-width: 2; }
.btn-primary { background: var(--gradient-accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 26px -12px var(--color-accent-glow); }
.btn-secondary { background: var(--color-control); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-accent-text); }
.btn-danger-ghost { background: rgba(255, 107, 107, 0.1); color: var(--color-danger); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: var(--text-lg); }
.btn-icon { width: 48px; padding: 0; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-row .btn:not(.btn-icon) { flex: 1 1 auto; }
.btn-block + .btn-block { margin-top: 10px; }
/* Прокси для Telegram: ряд кнопок сразу под шапкой карточки, подписи не прилипают к кнопкам */
#tgp-ready > .btn-row:first-child { margin-top: 0; }
#tgproxy-card .btn-row + .muted,
#tgproxy-card .muted + .btn { margin-top: 14px; }
#tgp-note { margin-top: 12px; }
@media (hover: hover) {
  .btn-secondary:hover, .tile:hover, .amount:hover, .dur-card:hover, .platform-card:hover { background-color: var(--color-control-hover); }
}

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  transition-property: scale, background-color; transition-duration: 150ms; transition-timing-function: ease-out;
  position: relative;
}
.chip-btn::after { content: ""; position: absolute; inset: -4px 0; }
.chip-btn:active { scale: 0.96; }
.chip-btn .icon { width: 16px; height: 16px; stroke-width: 2.25; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row .btn { flex: 1 1 140px; padding: 0 12px; white-space: nowrap; }

.banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 12px 14px 14px;
  border-radius: 20px;
  background: var(--color-surface); box-shadow: var(--shadow-ring);
  color: var(--color-text); text-align: start;
  transition-property: scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.banner:active { scale: 0.96; }
.banner-accent { background: linear-gradient(135deg in oklab, rgba(27, 69, 214, 0.35), rgba(51, 207, 245, 0.12)), var(--color-surface); box-shadow: 0 0 0 1px rgba(140, 196, 255, 0.22); }
.banner-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); flex: none; }
.banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: pretty; }
.banner-text b { font-size: var(--text-body); font-weight: 600; color: var(--color-text); }
.banner-chev { width: 18px; height: 18px; color: var(--color-text-tertiary); }

/* ── Темы для Happ ── */
.themes-banner, .themes-banner + .card { margin-top: 12px; }   /* кнопка не .card — отступы до и после задаём сами */
.themes-banner[hidden] { display: none; }
/* Значок кнопки — три кружка цветами тем (cabinet.js: renderThemesSwatch) */
.theme-swatch { position: relative; flex: none; width: 40px; height: 40px; }
.theme-swatch i { position: absolute; top: 11px; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-surface); background: var(--sw, #2F7CF6); }
.theme-swatch i:nth-child(1) { left: 1px; }
.theme-swatch i:nth-child(2) { left: 11px; z-index: 1; }
.theme-swatch i:nth-child(3) { left: 21px; z-index: 2; }
.themes-how { list-style: none; counter-reset: how; display: grid; gap: 6px; margin: 2px 0 14px; font-size: var(--text-sm); color: var(--color-text-secondary); }
.themes-how li { counter-increment: how; display: flex; gap: 10px; align-items: baseline; }
.themes-how li::before { content: counter(how); flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); font-size: var(--text-caption); font-weight: 700; translate: 0 -1px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 8px 8px 12px; border-radius: 20px; background: var(--color-control); text-align: start;
  box-shadow: 0 0 0 1.5px transparent;
  transition-property: scale, box-shadow, background-color; transition-duration: 180ms; transition-timing-function: ease-out;
}
.theme-card:active { scale: 0.96; }
.theme-card.is-copied { box-shadow: 0 0 0 1.5px rgba(74, 222, 155, 0.7); }
.theme-card .hp { font-size: 6.6px; }
.theme-name { display: flex; flex-direction: column; gap: 1px; padding: 0 4px; font-weight: 600; line-height: 1.25; }
.theme-name small { font-size: var(--text-caption); font-weight: 500; color: var(--color-text-tertiary); }
.theme-card.is-copied .theme-name::after { content: "Скопирована"; font-size: var(--text-caption); font-weight: 600; color: var(--color-success); }

/* Миниатюра экрана Happ в цветах темы (cabinet.js: themePreview). Всё в em — размер задаёт font-size контейнера */
.hp {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  height: 17em; padding: 2em 0.9em 0.9em; border-radius: 1.4em;
  background: var(--hp-bg); box-shadow: inset 0 0 0 0.1em rgba(255, 255, 255, 0.08);
  font-family: var(--font-display); line-height: 1.2; text-align: center;
}
.hp > span { position: relative; z-index: 1; }
.hp-glow { position: absolute; z-index: 0; width: 7.5em; height: 7.5em; border-radius: 50%; filter: blur(1.5em); opacity: 0.6; }   /* в Happ свечение приглушено */
.hp-glow.e1 { left: calc(50% - 6.4em); top: 0.8em; background: var(--hp-e1); }
.hp-glow.e2 { left: calc(50% - 1.2em); top: 0.2em; background: var(--hp-e2); }
.hp-glow.e3 { left: calc(50% - 3.75em); top: 2.8em; background: var(--hp-e3); }
.hp-top { position: absolute !important; top: 0.9em; right: 0.9em; display: flex; gap: 0.45em; }
.hp-top i { width: 0.95em; height: 0.95em; border-radius: 0.3em; box-shadow: inset 0 0 0 0.16em var(--hp-top); }
.hp-power {
  display: grid; place-items: center; flex: none; width: 5.4em; height: 5.4em; border-radius: 50%;
  background: var(--hp-btn); color: var(--hp-power);
  box-shadow: 0 0.6em 1.6em rgba(0, 0, 0, 0.28), inset 0 0 0 0.08em rgba(255, 255, 255, 0.14);
}
.hp-power .icon { width: 2.3em; height: 2.3em; stroke-width: 2.4; }
.hp-state { margin-top: 0.7em; font-size: 0.95em; font-weight: 700; color: var(--hp-btxt); }
.hp-timer { margin-top: 0.1em; font-size: 0.78em; color: var(--hp-timer); font-variant-numeric: tabular-nums; }
.hp-list { margin-top: auto; width: 100%; overflow: hidden; border-radius: 0.9em; background: var(--hp-head); text-align: start; }
.hp-head { display: block; padding: 0.45em 0.8em 0.35em; font-size: 0.72em; font-weight: 700; color: var(--hp-headtxt); }
.hp-row { display: flex; align-items: center; gap: 0.5em; padding: 0.5em 0.8em; background: var(--hp-row); }
.hp-row.sel { background: var(--hp-row-sel); }
.hp-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hp .hp-row b { font-size: 0.8em; font-weight: 600; color: var(--hp-title); }   /* сильнее .name-input-card b */
.hp-row small { font-size: 0.66em; color: var(--hp-sub); }
.hp-row .icon { flex: none; width: 0.95em; height: 0.95em; color: var(--hp-chev); stroke-width: 2.6; }
/* В карточке текст — полосками: мелкие буквы читались бы как мусор */
.hp.is-mini :is(.hp-state, .hp-timer, .hp-head, .hp-row b, .hp-row small) { color: transparent; border-radius: 1em; }
.hp.is-mini .hp-state { width: 8em; height: 0.8em; background: var(--hp-btxt); opacity: 0.9; }
.hp.is-mini .hp-timer { width: 5em; height: 0.6em; margin-top: 0.45em; background: var(--hp-timer); opacity: 0.6; }
.hp.is-mini .hp-head { width: 6em; height: 0.55em; margin: 0.6em 0.8em 0.5em; padding: 0; background: var(--hp-headtxt); opacity: 0.8; }
.hp.is-mini .hp-row b { width: 60%; height: 0.7em; background: var(--hp-title); opacity: 0.9; }
.hp.is-mini .hp-row small { width: 35%; height: 0.55em; margin-top: 0.3em; background: var(--hp-sub); opacity: 0.7; }
/* Окно темы: превью как экран телефона, по центру */
.theme-dlg-prev { width: min(100%, 250px); margin: 0 auto 16px; }
.theme-dlg-prev .hp { height: 19.5em; font-size: 11.5px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), inset 0 0 0 0.1em rgba(255, 255, 255, 0.1); }
.name-input-overlay.visible .theme-dlg-prev { animation: pop var(--dur-spring) var(--ease-spring) 120ms both; }


.meter { height: 8px; margin: 10px 0 14px; border-radius: 4px; background: var(--color-control); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg in oklab, var(--blue-600), var(--cyan-400)); transition: width 1000ms var(--ease-smooth); }
.gb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gb-big { font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-used { font-size: var(--text-sm); color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; text-align: end; }

/* ── Списки устройств и строки ── */
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 12px 12px;
  border-radius: 20px;
  background: var(--color-control);
}
.item + .item { margin-top: 8px; }
.item-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: var(--color-text-secondary); flex: none; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; overflow-wrap: anywhere; }
.item-meta { display: block; font-size: var(--text-sm); color: var(--color-text-tertiary); text-wrap: pretty; }
/* Метка своего приложения в строке устройства («устройство = вход», 15-11-2026): отключить такое устройство — значит выйти из приложения */
.item-tag { align-self: flex-start; margin: 3px 0 2px; padding: 2px 8px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent-text); font-size: var(--text-caption); font-weight: 600; white-space: nowrap; }
.item-act {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none;
  color: var(--color-text-tertiary);
  transition-property: background-color, color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.item-act .icon { width: 20px; height: 20px; }
@media (hover: hover) { .item-act:hover { background: rgba(255, 255, 255, 0.05); color: var(--color-text); } }
.item-act.danger { color: var(--color-danger); }
.item-act + .item-act { margin-left: -10px; }                  /* карандаш и корзина — парой, цели касания не сжимаются */
.rename-hint { margin-top: 8px; }
.online { color: var(--color-success); }
.legacy-dev { padding: 12px; border-radius: 28px; background: var(--color-control); }
.legacy-dev + .legacy-dev { margin-top: 10px; }
.legacy-dev .item { padding: 0; background: none; }
.legacy-dev .btn-row { margin-top: 12px; }
.legacy-dev .btn-secondary { background: rgba(255, 255, 255, 0.06); }

.limit {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 10px;
  border-radius: 20px; background: var(--color-control);
}
.limit-val { text-align: center; }
.limit-val b { display: block; font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.limit-val span { font-size: var(--text-sm); color: var(--color-text-tertiary); }
.round-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; flex: none;
  background: rgba(255, 255, 255, 0.06); color: var(--color-text);
  transition-property: scale, background-color, opacity; transition-duration: 150ms; transition-timing-function: ease-out;
}
.round-btn:active:not(:disabled) { scale: 0.96; }
.round-btn:disabled { opacity: 0.35; cursor: default; }
.round-btn.accent { background: var(--gradient-accent); color: #fff; }
.round-btn .icon { stroke-width: 2.25; }
.danger-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 12px; padding: 12px;
  border-radius: 16px; background: rgba(255, 107, 107, 0.07);
  color: var(--color-text); text-align: start;
}
.danger-row .icon { color: var(--color-danger); }
.danger-row span { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.danger-row small { font-size: var(--text-sm); font-weight: 400; color: var(--color-text-tertiary); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 0; }
.row + .row { border-top: 1px solid var(--color-separator); }
.row > span:first-child { color: var(--color-text-secondary); }
.row-val { text-align: end; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row-ic { display: inline-flex; align-items: center; gap: 10px; }
.row-ic .icon { width: 20px; height: 20px; color: var(--color-text-tertiary); }
.row-link { color: var(--color-text); }
.row-link > span:first-child { color: var(--color-text); }
.row-chev { width: 18px; height: 18px; color: var(--color-text-tertiary); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--text-sm); font-weight: 600; }
.badge-green { background: rgba(74, 222, 155, 0.12); color: var(--color-success); }
.badge-red { background: rgba(255, 107, 107, 0.12); color: var(--color-danger); }
.badge-blue { background: var(--color-accent-soft); color: var(--color-accent-text); }
.badge-orange { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-muted { background: var(--color-neutral-soft); color: var(--color-text-secondary); }

.toggle { position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--color-control-hover); transition: background-color 300ms var(--ease-fade); flex: none; }
.toggle::after { content: ""; position: absolute; inset: -6px -4px; }
/* Кружок едет пружиной; пока палец держит — чуть вытягивается в сторону хода, как в iOS */
.toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: translate var(--dur-spring) var(--ease-spring), width 260ms var(--ease-out);
}
.toggle:active .knob { width: 32px; }
.toggle.on { background: var(--color-accent); }
.toggle.on .knob { translate: 20px 0; }
.toggle.on:active .knob { translate: 14px 0; }

/* Сегменты: вкладки приложений и платформ, период продления */
.seg {
  position: relative; display: grid; gap: 4px; grid-auto-rows: 1fr;   /* ряды поровну — линза одной высоты во всех рядах */
  padding: 4px; border-radius: 16px; background: var(--color-control);
}
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* Android: Freedom VPN, Happ, INCY (cabinet.js: renderSetup) */
.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Подписи не влезли (крупный текст, узкий экран) — четыре пункта встают сеткой 2×2 (cabinet.js: segSelect) */
.seg-4.is-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; min-height: 44px; padding: 0 6px; border-radius: 12px;
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-secondary);
  transition-property: color, background-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
  text-align: center; line-height: 1.15;
}
.seg-btn:active { scale: 0.96; }
.seg-btn .icon { width: 18px; height: 18px; }
.seg-btn[aria-checked="true"] { color: var(--color-text); }
/* Подсветка выбранного — одна «линза», переезжает пружиной. Место задают --n (сколько пунктов) и --i (какой) */
.seg-thumb {
  position: absolute; z-index: 0; top: 4px; left: 4px;
  width: calc((100% - 8px - (var(--cols, 2) - 1) * 4px) / var(--cols, 2));
  height: calc((100% - 8px - (var(--rows, 1) - 1) * 4px) / var(--rows, 1));
  border-radius: 12px;
  background: rgba(47, 124, 246, 0.28);
  box-shadow: inset 0 0 0 1.5px rgba(140, 196, 255, 0.6);
  transform: translate(calc(var(--col, 0) * (100% + 4px)), calc(var(--row, 0) * (100% + 4px)));
  transition: transform var(--dur-spring) var(--ease-spring), width var(--dur-spring) var(--ease-spring);   /* ширина — при переходе в ряд с другим числом пунктов */
}
/* Многорядный переключатель: линза по пикселям выбранной кнопки (cabinet.js: segSelectRows) */
.seg.seg-px .seg-thumb {
  width: var(--w); height: var(--h); transform: translate(var(--x), var(--y));
  transition: transform var(--dur-spring) var(--ease-spring), width var(--dur-spring) var(--ease-spring), height var(--dur-spring) var(--ease-spring);
  pointer-events: none;
}
.seg-btn .disc { font-size: var(--text-caption); font-weight: 700; color: var(--color-success); }
#renewal-options .seg-btn { flex-direction: column; gap: 0; line-height: 1.15; min-height: 48px; }

/* Сроки */
.duration-list { display: grid; gap: 10px; }
.dur-card {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  width: 100%; padding: calc(1em - 1px) 16px 14px;   /* сверху — от кегля: при крупном шрифте плашки не ложатся на название */
  border-radius: 18px;
  background: var(--color-control);
  box-shadow: 0 0 0 1px transparent;
  text-align: start;
  transition-property: scale, background-color, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
}
.dur-card:active { scale: 0.96; }
/* Самый частый выбор — 3 месяца: обводка цветом бренда и плашка «Популярный» слева (скидка — справа) */
.dur-card.popular {
  background: linear-gradient(180deg, rgba(47, 124, 246, 0.13), rgba(47, 124, 246, 0.03) 72%), var(--color-control);
  box-shadow: 0 0 0 1.5px rgba(76, 148, 255, 0.7), 0 14px 30px -18px rgba(47, 124, 246, 0.8);
}
.dur-pop {
  position: absolute; top: -9px; left: 14px; padding: 2px 9px; border-radius: 999px;
  background: linear-gradient(90deg, #1B4FD0, #2361E0); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(37, 102, 232, 0.8);
  font-size: var(--text-caption); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
}
.dur-name { font-size: var(--text-lg); font-weight: 600; }
.dur-name, .dur-meta { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.dur-meta { grid-column: 1; display: flex; flex-direction: column; gap: 1px; font-size: var(--text-sm); color: var(--color-text-tertiary); }
.dur-price { grid-column: 2; grid-row: 1; font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.dur-old { grid-column: 2; grid-row: 2; align-self: start; font-size: var(--text-sm); color: var(--color-text-tertiary); text-decoration: line-through; text-align: end; font-variant-numeric: tabular-nums; }
.dur-badge { position: absolute; top: -9px; right: 14px; padding: 2px 8px; border-radius: 999px; background: #123A2B; color: var(--color-success); box-shadow: inset 0 0 0 1px rgba(74, 222, 155, 0.35); font-size: var(--text-caption); font-weight: 700; }
.dur-traffic { display: inline-flex; align-items: center; gap: 4px; }
.dur-traffic .icon { width: 14px; height: 14px; stroke-width: 2.6; }

.summary { padding: 16px; border-radius: 18px; background: var(--color-control); }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--text-lg); font-weight: 600; }
.summary-price { font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; text-align: end; transform-origin: 100% 50%; transition: opacity 200ms var(--ease-fade); }
.summary-price s { font-size: var(--text-body); font-weight: 500; color: var(--color-text-tertiary); margin-inline-end: 6px; }
.summary .muted { margin-top: 6px; }
.promo { display: flex; gap: 10px; margin-top: 14px; }
.promo .field { flex: 1; }
.promo-result { min-height: 20px; margin: 8px 2px 14px; font-size: var(--text-sm); }
.promo-result span { display: inline-block; }         /* чтобы строка могла въехать сдвигом */
.promo-result .ok { color: var(--color-success); }
.promo-result .err { color: var(--color-danger); }
.stepper-ctl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 20px; background: var(--color-control); }
.stepper-val { display: flex; flex-direction: column; align-items: center; }
.stepper-val > span:first-child { font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stepper-ctl + .muted { margin-top: 8px; }

/* Поля */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: var(--text-sm); color: var(--color-text-secondary); }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 0; border-radius: 14px;
  background: var(--color-control);
  box-shadow: inset 0 0 0 1px rgba(170, 200, 255, 0.45);
  font-size: 16px; color: var(--color-text);
  transition: box-shadow 150ms ease-out;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
/* Ошибка поля — красная рамка и строка под полем (cabinet.js: setTicketErr) */
.field-wrap { display: grid; }
.field-err { min-height: 0; font-size: var(--text-sm); color: var(--color-danger); }
.field-err:not(:empty) { margin-top: 6px; }
.field.is-invalid input, .field.is-invalid textarea { box-shadow: inset 0 0 0 2px var(--color-danger); }
/* Кнопка ждёт окончания паузы: тихая, с отсчётом */
.btn.is-wait { background: var(--color-control); color: var(--color-text-secondary); box-shadow: none; opacity: 1; font-size: var(--text-body); line-height: 1.25; padding-block: 8px; text-wrap: balance; }
.btn-label { display: inline-block; }
/* Куда отправить обращение: два варианта — карточки со значком, описанием и стрелкой */
.route-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 12px 14px 14px; border-radius: 18px;
  background: var(--color-control); color: var(--color-text); text-align: start;
  transition-property: scale, background-color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.route-card + .route-card { margin-top: 10px; }
.route-card:active { scale: 0.97; }
.route-card[aria-disabled="true"] { opacity: 0.6; }
.route-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--color-accent-soft); color: var(--color-accent-text); }
.route-ic .icon { width: 20px; height: 20px; }
.route-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.route-text b { font-weight: 600; }
.route-text small { font-size: var(--text-sm); color: var(--color-text-tertiary); text-wrap: pretty; }
.route-card .row-chev { flex: none; width: 18px; height: 18px; color: var(--color-text-tertiary); }
@media (hover: hover) { .route-card:hover { background-color: var(--color-control-hover); } }
.field input::placeholder, .field textarea::placeholder { color: var(--color-text-tertiary); }
.field input:focus, .field textarea:focus { outline: 2px solid transparent; outline-offset: -2px; box-shadow: inset 0 0 0 2px var(--color-accent); }
.field.is-invalid input:focus, .field.is-invalid textarea:focus { box-shadow: inset 0 0 0 2px var(--color-danger); }   /* ошибка видна и под курсором */
.code-input { text-align: center; letter-spacing: 0.4em; font-variant-numeric: tabular-nums; font-size: 22px !important; }
.inline-form { display: flex; gap: 10px; margin-top: 10px; }
.inline-form .field { flex: 1; }
.sub-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-separator); }
.sub-block > .muted { margin-bottom: 10px; }

/* Ссылки и шаги */
.link-box {
  padding: 12px 14px; border-radius: 14px;
  background: var(--color-control);
  font-size: var(--text-sm); color: var(--color-text-secondary);
  overflow-wrap: anywhere;
  -webkit-user-select: all; user-select: all;
}
.steps-mini { list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps-mini li { counter-increment: s; position: relative; min-height: 26px; padding: 2px 0 0 38px; color: var(--color-text-secondary); text-wrap: pretty; }
.steps-mini li::before {
  content: counter(s); display: grid; place-items: center;
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-size: var(--text-sm); font-weight: 700;
}
.steps-mini li span { color: var(--color-text); font-weight: 600; }

/* ── Экраны вкладок ── */
.screen-head { padding: 20px 4px 16px; }
.screen-title { font-family: var(--font-display); font-size: var(--text-screen); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }

/* ── Друзья: промоакция вверху ── */
.ref-promo {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px;
  padding: 14px 16px 16px 10px;
  border-radius: 32px;                                   /* кнопка внутри r16 + отступ 16 */
  background: radial-gradient(90% 130% at 0% 0%, rgba(47, 124, 246, 0.24), transparent 62%), var(--color-surface);
  box-shadow: var(--shadow-ring);
}
.ref-promo-duck { width: 92px; height: 92px; object-fit: contain; }
.ref-promo-title { font-family: var(--font-display); font-size: var(--text-title-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.ref-promo-desc { margin-top: 4px; font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: pretty; }
.ref-promo-desc b { color: var(--color-text); font-weight: 600; white-space: nowrap; }
.ref-promo-cta { grid-column: 1 / -1; margin-top: 12px; margin-left: 6px; width: calc(100% - 6px); }
.ref-promo + .card { margin-top: 12px; }

/* «Пригласить друга»: синяя кнопка с золотой волной. Нажатие — делится на две (Telegram / ссылка на сайт),
   удержание — тянется и пытается разделиться, но не может. Форму рисует cabinet.js (gs): два прямоугольника
   в SVG-маске с «клейким» фильтром — пока они близко, между ними перетяжка, дальше она лопается. */
.gs { position: relative; height: 60px; isolation: isolate; -webkit-tap-highlight-color: transparent; }
.gs::before {                                                    /* свечение под кнопкой — без фильтров, дёшево */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -10px; height: 34px; z-index: -1;
  background: radial-gradient(closest-side, rgba(47, 124, 246, 0.55), transparent);
  filter: blur(10px); pointer-events: none;
}
.gs-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* Грани в покое: целая кнопка или две половинки. Фон и волна — в координатах всей кнопки (--bgx, --wx ставит
   cabinet.js), поэтому совпадают с SVG-слоем до пикселя и подмена слоёв не видна */
.gs-faces { position: absolute; inset: 0; pointer-events: none; }
.gs-face {
  position: absolute; top: 0; height: 100%; border-radius: 20px; overflow: hidden; opacity: 0;
  background: linear-gradient(90deg, #1B45D6, #2566E8 60%, #276FEA) no-repeat;
  background-size: var(--gs-w, 100%) 100%; background-position: var(--bgx, 0px) 0;
}
.gs-face-one { left: 0; width: 100%; }
.gs-face-l { left: 0; width: calc(50% - 6px); }
.gs-face-r { right: 0; width: calc(50% - 6px); }
.gs[data-phase="rest"][data-state="one"] .gs-face-one,
.gs[data-phase="rest"][data-state="two"] :is(.gs-face-l, .gs-face-r) { opacity: 1; }
.gs-fw { position: absolute; bottom: 0; left: var(--wx, 0px); width: calc(var(--gs-w, 360px) * 2); overflow: visible; will-change: transform; }
.gs-fw1 { height: 30px; }
.gs-fw2 { height: 26px; opacity: 0.7; }
/* Оранжевая волна: плотный градиент (полупрозрачный оранжевый на синем стал бы грязно-серым) */
.gs-fw1 use, .gs-sw1 use { fill: url(#gs-or-a); }
.gs-fw2 use, .gs-sw2 use { fill: url(#gs-or-b); }
.gs-sw2 { opacity: 0.7; }
.gs-btn {
  position: absolute; top: 0; height: 100%; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.005em;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.gs-main { left: 0; width: 100%; }
.gs-tg, .gs-web { width: calc(50% - 6px); font-size: var(--text-body); }
.gs-tg { left: 0; }
.gs-web { right: 0; }
.gs-btn:focus-visible { outline-offset: 3px; }
.gs-label {
  display: inline-flex; align-items: center; gap: 8px; padding-bottom: 6px;   /* над гребнем волны */
  text-shadow: 0 1px 3px rgba(8, 24, 80, 0.55); white-space: nowrap; will-change: transform;
  max-width: calc(100% - 12px);          /* подпись не шире своей половинки даже при крупном системном шрифте */
}
.gs-label .icon { flex: none; width: 20px; height: 20px; stroke-width: 2; }
.gs-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* не влезла — многоточие, а не наружу */
.gs-tg .gs-label, .gs-web .gs-label { opacity: 0; }
/* Узкая половинка: полные подписи не помещаются (меряет gsSize в cabinet.js) — короче и мельче */
.gs[data-narrow] .gs-tg, .gs[data-narrow] .gs-web { font-size: var(--text-sm); }
.gs[data-narrow] .gs-label { gap: 6px; }
.gs[data-narrow] .gs-label .icon { width: 18px; height: 18px; }

/* ── Друзья: рефералы. Стопка из трёх последних → по нажатию лента, как кинолента (cabinet.js: reel) ──
   Режимы в data-mode: loading · empty · stack · opening (плёнка раскрывается, боковые встают в ряд) ·
   reel (лента едет) · closing (доезжает до ровного места) · folding (плёнка сворачивается, снова стопка) */
.stat-num { display: block; font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--text-sm); color: var(--color-text-tertiary); }
.ref-people { padding-bottom: 16px; }
.ref-people .card-title { margin-bottom: 0; }
.reel { --ava: 60px; --film: #000; position: relative; margin: 2px -16px 0; }
.reel-hit {
  position: relative; display: block; width: 100%; height: 124px;
  touch-action: pan-y;                                   /* страница листается, по горизонтали ленту тянет палец */
}
.reel-hit:focus-visible { outline-offset: -4px; border-radius: 20px; }
.reel-film {
  position: absolute; left: 0; right: 0; top: 50%; height: 100px; margin-top: -54px; overflow: hidden;
  background: var(--film);
  box-shadow: inset 0 1px 0 rgba(170, 200, 255, 0.14), inset 0 -1px 0 rgba(170, 200, 255, 0.14);   /* кромки плёнки */
  opacity: 0; transform: scaleY(0.35);
  transition: opacity 300ms var(--ease-fade), transform 560ms var(--ease-sheet);
}
/* Перфорация: по кусочку на ячейку ленты (две дырки сверху и снизу), сжимается к краям вместе с плёнкой (cabinet.js: reelLayout) */
.reel-perf {
  position: absolute; left: 0; top: 0; width: 46px; height: 100%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23' height='6'%3E%3Crect x='6.5' width='10' height='6' rx='1.6' fill='%23AAC8FF' fill-opacity='.2'/%3E%3C/svg%3E") 0 9px / 23px 6px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23' height='6'%3E%3Crect x='6.5' width='10' height='6' rx='1.6' fill='%23AAC8FF' fill-opacity='.2'/%3E%3C/svg%3E") 0 calc(100% - 9px) / 23px 6px repeat-x;
  will-change: transform;
}
/* Края плёнки и ленты уходят в темноту */
.reel-film, .reel-track {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
}
.reel-track { position: absolute; inset: 0; opacity: 0; transition: opacity 280ms var(--ease-fade); }
.reel-item { position: absolute; left: 0; top: 50%; margin-top: calc(var(--ava) / -2 - 4px); will-change: transform; }
.reel-stack { position: absolute; left: 50%; top: calc(50% - 4px); width: 0; height: 0; transition: opacity 280ms var(--ease-fade); }
.reel-stack .ava {
  position: absolute; left: calc(var(--ava) / -2); top: calc(var(--ava) / -2);
  transition: transform 640ms var(--ease-spring), opacity 300ms var(--ease-fade), box-shadow 300ms var(--ease-fade), background-color 300ms var(--ease-fade);
}
/* Стопка: центральный выше, боковые ниже на одной высоте и чуть под ним. Центральный стоит на линии ленты */
.reel-stack .s-left { transform: translate(-46px, 20px) scale(0.9); z-index: 1; }
.reel-stack .s-center { transform: none; z-index: 2; }
.reel-stack .s-right { transform: translate(46px, 20px) scale(0.9); z-index: 1; }
/* Ряд: боковые поднимаются к центральному — ровно туда, где их ждёт лента */
/* --row-x / --row-s ставит cabinet.js (reelRowVars): у центра ленты шаг шире, поэтому боковые выезжают из-под
   центральной, а при сворачивании плавно заезжают под неё обратно — перекрытие появляется анимацией */
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"], [data-mode="folding"]) .s-left { transform: translate(calc(-1 * var(--row-x, 62px)), 0) scale(var(--row-s, 0.98)); }
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"], [data-mode="folding"]) .s-center { transform: none; }
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"], [data-mode="folding"]) .s-right { transform: translate(var(--row-x, 62px), 0) scale(var(--row-s, 0.98)); }
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"]) .reel-film { opacity: 1; transform: none; }
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"]) .reel-track { opacity: 1; }
.reel:is([data-mode="reel"], [data-mode="closing"]) .reel-stack { opacity: 0; transition: none; }   /* подмена на ленту — мгновенно, картинки совпадают */
.reel[data-mode="folding"] .reel-stack { transition: none; }                                         /* и обратно — тоже мгновенно */
.reel[data-mode="loading"] .reel-stack { opacity: 0.45; }
/* Пока плёнка видна, кольца стопки — цвета плёнки: подмена на ленту и обратно без скачка цвета */
.reel:is([data-mode="opening"], [data-mode="reel"], [data-mode="closing"]) .reel-stack .ava { --ring: var(--film); }

/* Аватарка: фото или буква на цвете, как в Telegram; кольцо цвета фона отделяет наложенные друг на друга */
.ava {
  --ring: var(--color-surface);
  position: relative; display: grid; place-items: center; width: var(--ava); height: var(--ava); border-radius: 50%;
  background: linear-gradient(160deg, var(--a, #72D5FD), var(--b, #2A9EF1)) center / cover;
  color: #fff; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  box-shadow: 0 0 0 3px var(--ring), 0 6px 14px -6px rgba(0, 0, 0, 0.7);
  -webkit-user-select: none; user-select: none;
}
.ava .icon { width: 24px; height: 24px; stroke-width: 1.9; }
.ava.has-photo { color: transparent; text-shadow: none; }            /* буква под фото — запасная, если фото не загрузится */
.ava.has-photo .icon { display: none; }
.reel-track .ava { --ring: var(--film); }
/* Пустое место — для следующего друга */
.ava.is-ghost { background: var(--ring); color: var(--color-text-tertiary); box-shadow: 0 0 0 3px var(--ring); }
.ava.is-ghost::before { content: ""; position: absolute; inset: 1px; border-radius: 50%; border: 1.5px dashed rgba(170, 200, 255, 0.5); }
.ava.is-ghost .icon { width: 22px; height: 22px; stroke-width: 2; }
.reel-caption { min-height: 20px; margin-top: 2px; padding: 0 8px; text-align: center; font-size: var(--text-sm); color: var(--color-text-tertiary); text-wrap: balance; }
.reel-caption b { display: block; margin-bottom: 2px; font-size: var(--text-body); font-weight: 600; color: var(--color-text); }
/* Подсказка у ленты — в одну строку: при раскрытии и сворачивании всё ниже не прыгает */
.reel:not([data-mode="empty"]) + .reel-caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Две колонки поровну; при крупном шрифте вторая цифра переносится на новую строку, а не вылезает за карточку */
.ref-stats { display: flex; flex-wrap: wrap; row-gap: 12px; overflow: hidden; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-separator); }
.ref-stat { flex: 1 1 0; min-width: max-content; display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.ref-stat:first-child { padding-right: 16px; }
.ref-stat + .ref-stat { padding-left: 16px; box-shadow: -1px 0 0 var(--color-separator); }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 22px 4px 18px; }
.avatar {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: var(--gradient-accent); color: #fff;
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  box-shadow: 0 10px 26px -12px var(--color-accent-glow);
}
.profile-name { font-family: var(--font-display); font-size: var(--text-title-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.faq details { border-top: 1px solid var(--color-separator); }
.faq details:first-child { border-top: 0; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 0;
  font-weight: 600; cursor: pointer; list-style: none;
  transition: opacity 150ms ease-out;
}
.faq summary:active { opacity: 0.6; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 18px; height: 18px; color: var(--color-text-tertiary); transition: rotate 420ms var(--ease-sheet); }
/* Ответ раскрывается по высоте (cabinet.js: toggleDetails); стрелка разворачивается сразу по нажатию */
.faq details[open]:not(.is-closing) summary .icon { rotate: 180deg; }
.faq details p { padding: 0 0 14px; color: var(--color-text-secondary); text-wrap: pretty; }

.guide-steps { margin-top: 6px; }

/* Тикеты */
.ticket-item {
  display: block; width: 100%; padding: 12px 14px;
  border-radius: 16px; background: var(--color-control);
  text-align: start;
}
.ticket-item + .ticket-item { margin-top: 8px; }
.ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ticket-subject { font-weight: 600; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ticket-date { margin-top: 2px; font-size: var(--text-sm); color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.ticket-badge { flex: none; padding: 2px 9px; border-radius: 999px; font-size: var(--text-caption); font-weight: 700; }
.ticket-badge.open { background: var(--color-accent-soft); color: var(--color-accent-text); }
.ticket-badge.in_progress { background: rgba(255, 154, 77, 0.14); color: var(--color-warning); }
.ticket-badge.closed { background: rgba(255, 255, 255, 0.06); color: var(--color-text-secondary); }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: var(--text-body); line-height: 1.4; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; background: var(--gradient-accent); color: #fff; border-bottom-right-radius: 6px; transform-origin: 100% 100%; }
.msg-admin { align-self: flex-start; background: var(--color-control); border-bottom-left-radius: 6px; transform-origin: 0 100%; }
.msg-time { margin-top: 4px; font-size: var(--text-caption); font-variant-numeric: tabular-nums; }
.msg-user .msg-time { color: #fff; }
.msg-admin .msg-time { color: var(--color-text-secondary); }
.reply-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--color-separator); background: var(--color-surface-raised); }
.reply-input { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 14px; border: 0; border-radius: 22px; background: var(--color-control); box-shadow: inset 0 0 0 1px rgba(170, 200, 255, 0.45); color: var(--color-text); font-size: 16px; resize: none; }
.reply-input::placeholder { color: var(--color-text-tertiary); }
.reply-input:focus { outline: 2px solid transparent; outline-offset: -2px; box-shadow: inset 0 0 0 2px var(--color-accent); }
.reply-send { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gradient-accent); color: #fff; flex: none; }
.reply-send .icon { width: 20px; height: 20px; }

/* История */
.tx-list { display: flex; flex-direction: column; }
.tx-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; }
.tx-row + .tx-row { border-top: 1px solid var(--color-separator); }
.tx-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--color-control); color: var(--color-text-secondary); flex: none; }
.tx-ic .icon { width: 18px; height: 18px; }
.tx-desc { flex: 1; min-width: 0; font-size: var(--text-sm); text-wrap: pretty; }
.tx-date { display: block; color: var(--color-text-tertiary); font-size: var(--text-caption); font-variant-numeric: tabular-nums; }
.tx-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-positive { color: var(--color-success); }
.tx-negative { color: var(--color-text); }

.balance-big { padding: 8px 0 6px; }
.balance-big > span { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amount { min-height: 48px; border-radius: 14px; background: var(--color-control); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition-property: scale, background-color; transition-duration: 150ms; transition-timing-function: ease-out; }
.amount:active { scale: 0.96; }
.state-box { display: grid; justify-items: center; gap: 10px; padding: 18px 0 6px; text-align: center; }
.state-box .btn-block { width: 100%; }
.state-title { font-size: var(--text-lg); font-weight: 600; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.12); border-top-color: var(--color-wave); animation: spin 0.8s linear infinite; }
/* Ждём оплату: у заголовка пульсирует точка — видно, что кабинет сам проверяет */
.waiting { display: inline-flex; align-items: center; gap: 10px; }
.waiting::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-wave);
  animation: wait-pulse 1.6s var(--ease-fade) infinite;
}
@keyframes wait-pulse {
  0% { box-shadow: 0 0 0 0 rgba(51, 207, 245, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(51, 207, 245, 0); }
}

/* Заготовки вместо «Загрузка…»: форма будущих строк, по ним пробегает блик */
.skel { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; }
.skel + .skel { border-top: 1px solid var(--color-separator); }
.skel-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--color-control); flex: none; }
.skel-lines { flex: 1; display: grid; gap: 8px; }
.skel-lines span { height: 10px; border-radius: 5px; background: var(--color-control); }
.skel-lines span:first-child { width: 64%; }
.skel-lines span:last-child { width: 36%; }
.skel-card { min-height: 64px; padding: 12px 14px; border-radius: 14px; background: var(--color-control); }
.skel-card + .skel-card { margin-top: 8px; border-top: 0; }
.skel-card .skel-lines span { background: rgba(255, 255, 255, 0.06); }
.skel-bubble { min-height: 58px; width: 64%; border-radius: 18px; background: var(--color-control); }
.skel-bubble.me { align-self: flex-end; width: 50%; background: rgba(47, 124, 246, 0.22); }
.skel::after, .skel-bubble::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(170, 200, 255, 0.07) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.5s var(--ease-fade) infinite;
}
.skel-bubble { position: relative; overflow: hidden; }
@keyframes shimmer { to { transform: translateX(100%); } }
/* Цена пересчитывается — старая бледнеет, пока не пришла новая */
.is-updating { opacity: 0.45; transition: opacity 200ms var(--ease-fade); }

/* ── Док ── */
.dock {
  position: fixed; left: 50%; bottom: calc(12px + var(--safe-bottom)); z-index: 50;
  transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--pad)), 448px); height: var(--dock-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 8px;
  border-radius: var(--r-dock);
  background: rgba(12, 17, 24, 0.74);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 0 0 1px var(--color-ring-strong), 0 18px 44px rgba(0, 0, 0, 0.7);
}
.dock-lens {
  position: absolute; top: 8px; bottom: 8px; left: 0;
  width: var(--lens-w, 0px);
  transform: translateX(var(--lens-x, 0px));
  border-radius: var(--r-lens);
  background: linear-gradient(180deg, rgba(47, 124, 246, 0.26), rgba(27, 69, 214, 0.12));
  box-shadow: inset 0 0 0 1px rgba(140, 196, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform-origin: 50% 50%;
  pointer-events: none;
}
.dock-item {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: var(--r-lens);
  color: var(--color-text-secondary);   /* над кнопкой с волной «третичный» опускался ниже 4,5:1 */
  font-size: var(--text-caption); font-weight: 600; letter-spacing: 0.01em;
  transition-property: color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.dock-item:active { scale: 0.96; }
.dock-item.active { color: var(--color-text); }
.dock-item { min-width: 0; }
.dock-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* крупный текст — многоточие, а не наезд */
.dock-icon { position: relative; width: 24px; height: 24px; }
/* Залитая иконка «вспрыгивает» пружиной, контурная тает — смена читается и без подписи */
.dock-icon .icon {
  position: absolute; inset: 0;
  transition: opacity 260ms var(--ease-fade), scale var(--dur-spring) var(--ease-spring), filter 300ms var(--ease-fade);
}
.dock-icon .i-fill { opacity: 0; scale: 0.4; filter: blur(4px); color: var(--color-accent-text); }
.dock-item.active .i-fill { opacity: 1; scale: 1; filter: blur(0); }
.dock-item.active .i-out { opacity: 0; scale: 0.4; filter: blur(4px); transition-duration: 200ms, 260ms, 200ms; }
.dock-label { transition: color 300ms var(--ease-fade); }

/* ── Листы ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 280ms var(--ease-fade);
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; transition-duration: 420ms; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 90;
  width: min(100%, 480px);
  max-height: min(90dvh, 860px);
  display: flex; flex-direction: column;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--color-surface-raised);
  box-shadow: 0 0 0 1px var(--color-ring-strong), 0 -24px 60px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, 105%);
  visibility: hidden;
  transition: transform 300ms var(--ease-sheet), visibility 0s linear 300ms;
  overscroll-behavior: contain;
}
.sheet.active { transform: translate(-50%, 0); visibility: visible; transition: transform 460ms var(--ease-sheet), visibility 0s; }
/* Высота листа меняется плавно при смене шага (cabinet.js: morphSheet). Селектор сильнее .sheet.active —
   иначе его transition перебивает высоту и лист прыгает. */
.sheet.active.resizing { transition: transform 460ms var(--ease-sheet), height 420ms var(--ease-sheet); overflow: hidden; }
.sheet.dragging { transition: none; }
.sheet-tall { height: min(90dvh, 860px); }
.sheet-grabber { flex: none; width: 38px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.sheet-head { position: relative; flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px 6px 20px; touch-action: none; }
.sheet-head.has-back { padding-left: 14px; }          /* стрелка «назад» стоит так же, как крестик справа */
.sheet-back[hidden] { display: none; }
.sheet:focus-visible { outline: none; }
.sheet-head-text { flex: 1; min-width: 0; }
.sheet-title { font-family: var(--font-display); font-size: var(--text-title-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
#ticket-view-title { font-size: var(--text-lg); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#ticket-view-badge { display: flex; align-items: center; gap: 8px; }
.sheet-sub { margin-top: 2px; font-size: var(--text-sm); color: var(--color-text-secondary); }
.sheet-close, .sheet-back {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--color-control); color: var(--color-text-secondary);
}
.sheet-close::after, .sheet-back::after { content: ""; position: absolute; inset: -4px; }
.sheet-close .icon, .sheet-back .icon { width: 20px; height: 20px; stroke-width: 2; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 20px calc(22px + var(--safe-bottom)); }
.sheet-body > .btn-lg:first-child { margin-top: 0; }
.sheet-body .btn-lg { margin-top: 16px; }

/* Подключение: две «страницы» в одном листе */
.panes { position: relative; display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
/* Уходящая «страница» гаснет за 100 мс, новая проявляется следом — два заголовка разом не видны */
.pane {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  transition: transform 420ms var(--ease-sheet), opacity 260ms var(--ease-fade) 100ms, visibility 0s;
}
/* Скрытая «страница» выходит из потока, чтобы высота листа шла по видимой */
.panes[data-pane="device"] #pane-setup,
.panes[data-pane="setup"] #pane-device {
  position: absolute; top: 0; left: 0; right: 0;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: transform 420ms var(--ease-sheet), opacity 100ms ease-out, visibility 0s linear 420ms;
}
.panes[data-pane="device"] #pane-setup { transform: translateX(40px); }
.panes[data-pane="setup"] #pane-device { transform: translateX(-40px); }
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.platform-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 116px; padding: 14px 10px;
  border-radius: 20px;
  background: var(--color-control);
  box-shadow: 0 0 0 1px transparent;
  font-weight: 600;
  transition-property: scale, background-color, box-shadow; transition-duration: 200ms; transition-timing-function: var(--ease-out);
}
.platform-card:active { scale: 0.96; }
.platform-card .p-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); color: var(--color-text-secondary); transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out); }
.platform-card .p-ic .icon { width: 28px; height: 28px; }
.platform-card .p-hint { font-size: var(--text-caption); font-weight: 600; color: var(--color-accent-text); min-height: 14px; }
.platform-card[aria-checked="true"] {
  background: linear-gradient(160deg in oklab, rgba(47, 124, 246, 0.26), rgba(27, 69, 214, 0.1)), var(--color-control);
  box-shadow: 0 0 0 1.5px rgba(140, 196, 255, 0.55), 0 12px 30px -14px var(--color-accent-glow);
}
.platform-card[aria-checked="true"] .p-ic { background: var(--gradient-accent); color: #fff; }
.platform-card .p-check {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-accent); color: #fff;
  opacity: 0; scale: 0.25; filter: blur(4px);
  transition-property: opacity, scale, filter; transition-duration: 300ms; transition-timing-function: var(--ease-out);
}
.platform-card .p-check .icon { width: 14px; height: 14px; stroke-width: 3; }
.platform-card[aria-checked="true"] .p-check { opacity: 1; scale: 1; filter: blur(0); }
.platform-card.detected-pulse { animation: detected 1.2s var(--ease-out) 1; }
@keyframes detected {
  0% { box-shadow: 0 0 0 0 rgba(51, 207, 245, 0.55), 0 0 0 1.5px rgba(140, 196, 255, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(51, 207, 245, 0), 0 0 0 1.5px rgba(140, 196, 255, 0.55); }
}

.setup-platform { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.setup-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--color-accent-soft); color: var(--color-accent-text); box-shadow: inset 0 0 0 1px rgba(140, 196, 255, 0.24); }
.setup-ic .icon { width: 28px; height: 28px; }
.setup-name { font-size: var(--text-body); font-weight: 600; color: var(--color-text); }
#pane-setup .sheet-head { align-items: flex-start; padding-left: 14px; }

.stepper { list-style: none; margin-top: 18px; }
.step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.step:last-child { padding-bottom: 6px; }
/* Кружок и линия шага — в em: при крупном тексте растут вместе с цифрой */
.step:not(:last-child)::before { content: ""; position: absolute; left: calc(1.075em - 1px); top: calc(2.15em + 4px); bottom: 4px; width: 2px; border-radius: 1px; background: linear-gradient(180deg in oklab, rgba(140, 196, 255, 0.35), rgba(140, 196, 255, 0.08)); }
.step-num {
  display: grid; place-items: center; width: 2.15em; height: 2.15em; border-radius: 50%; flex: none;
  background: var(--color-accent-soft); color: var(--color-accent-text);
  font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(140, 196, 255, 0.24);
}
.step-body { flex: 1; min-width: 0; padding-top: 4px; }
.step-title { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.step-sub { margin-top: 2px; font-size: var(--text-sm); color: var(--color-text-tertiary); }
.step-actions { display: grid; gap: 8px; margin-top: 12px; }
/* Шаг по устройствам: «на телевизоре» / «на телефоне» отдельными строками */
.step-list { display: grid; gap: 6px; margin-top: 4px; list-style: none; }
.step-list b { font-weight: 600; color: var(--color-text-secondary); }
.cmd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.95em; padding: 1px 5px; border-radius: 6px; background: var(--color-control); color: var(--color-text-secondary); word-break: keep-all; -webkit-box-decoration-break: clone; box-decoration-break: clone; -webkit-user-select: all; user-select: all; }
.step-actions .btn { justify-content: flex-start; padding-inline: 14px 12px; }
.step-actions .btn .grow { flex: 1; text-align: start; }
.step .wave-btn { min-height: 54px; margin-top: 12px; border-radius: var(--r-btn); font-size: var(--text-body); }
.step-actions .btn-primary { justify-content: center; }
.step-actions .btn-primary .grow { flex: none; }
#step2-actions .item { flex-wrap: wrap; row-gap: 10px; border-radius: 28px; }
#step2-actions .item-body { flex: 1 1 calc(100% - 52px); }
#step2-actions .item .btn { flex: 1 1 auto; }
.copy-field {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 6px 6px 6px 14px;
  border-radius: 16px; background: var(--color-control);
}
.copy-field .url { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; }
.copy-field .btn { min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: var(--text-sm); background: rgba(255, 255, 255, 0.07); }
.own-app-pair { margin-top: 12px; }
/* Вход по ссылке из кабинета (Android): подсказка под кнопкой «Войти в приложение» — появляется после нажатия */
.app-login-btn { margin-top: 12px; }
.app-login-btn[disabled] { opacity: 0.7; }
.app-login-hint { display: grid; gap: 8px; margin-top: 10px; }
.app-login-hint:empty { display: none; }
.app-login-hint .btn-row { margin-top: 0; }
.or { margin-top: 10px; text-align: center; font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: balance; }
.bypass {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 8px; padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg in oklab, rgba(51, 207, 245, 0.16), rgba(27, 69, 214, 0.12));
  box-shadow: inset 0 0 0 1px rgba(155, 232, 255, 0.24);
  text-align: start;
  transition-property: scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.bypass:active { scale: 0.96; }
.bypass .banner-ic { background: rgba(51, 207, 245, 0.16); color: var(--cyan-200); }
.bypass-text { display: flex; flex-direction: column; flex: 1; font-size: var(--text-sm); color: var(--color-text-secondary); }
.bypass-text b { font-size: var(--text-body); color: var(--color-text); font-weight: 600; }

/* ── Диалоги подтверждения ── */
.name-input-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: end center; padding: 0;
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 240ms var(--ease-fade);
}
.name-input-overlay.visible { opacity: 1; transition-duration: 380ms; }
/* Окно не выше экрана: при длинном списке сжимается список, кнопки остаются видны */
.name-input-card {
  display: flex; flex-direction: column; max-height: 100dvh; overflow: hidden;
  width: 100%; max-width: 480px;
  padding: 26px 20px calc(18px + var(--safe-bottom));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--color-surface-raised);
  box-shadow: 0 0 0 1px var(--color-ring-strong), 0 -24px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
  transform: translateY(100%); transition: transform 460ms var(--ease-sheet);
}
.name-input-card > * { flex: none; }
.name-input-card > #mig-list, .name-input-card > #lim-rm-list { flex: 0 1 auto; min-height: 96px; }
.name-input-overlay.closing .name-input-card { transition-duration: 260ms; }
.name-input-desc { margin-top: 6px; }
.name-input-overlay.visible .name-input-card { transform: none; }
.name-input-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--color-accent-soft); color: var(--color-accent-text); font-size: 26px; }
/* Значок окна «вспрыгивает», когда лист почти доехал */
.name-input-overlay.visible .name-input-icon { animation: pop var(--dur-spring) var(--ease-spring) 140ms both; }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.name-input-icon .icon { width: 28px; height: 28px; }
.name-input-title { font-size: var(--text-title); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.name-input-subtitle { margin-top: 6px; font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: pretty; }
.name-input-card b { color: var(--color-text); }
.name-input-field { width: 100%; min-height: 50px; margin-top: 14px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--color-control); box-shadow: inset 0 0 0 1px rgba(170, 200, 255, 0.45); color: var(--color-text); font-size: 16px; }
.name-input-field::placeholder { color: var(--color-text-tertiary); }
.name-input-field:focus { outline: 2px solid transparent; outline-offset: -2px; box-shadow: inset 0 0 0 2px var(--color-accent); }
.name-input-hint { margin-top: 6px; font-size: var(--text-caption); color: var(--color-text-tertiary); }
.name-input-buttons { display: flex; gap: 10px; margin-top: 18px; }
.name-input-btn { flex: 1; min-height: 52px; border-radius: 16px; font-weight: 600; transition-property: scale, opacity; transition-duration: 150ms; transition-timing-function: ease-out; }
.name-input-btn:active:not(:disabled) { scale: 0.96; }
.name-input-btn.cancel { background: var(--color-control); color: var(--color-text); }
.name-input-btn.confirm { background: var(--gradient-accent); color: #fff; }
.name-input-btn.danger { background: rgba(255, 107, 107, 0.16); color: var(--color-danger); box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.35); }
.is-danger .name-input-icon { background: rgba(255, 107, 107, 0.12); color: var(--color-danger); }
.name-input-btn:disabled { opacity: 0.4; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--color-control); margin-bottom: 8px; cursor: pointer; box-shadow: 0 0 0 1.5px transparent; text-align: start; width: 100%; }
.pick-row[aria-checked="true"] { box-shadow: 0 0 0 1.5px rgba(140, 196, 255, 0.6); }
.pick-row .radio { flex: none; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--color-text-tertiary); margin-inline-start: auto; transition: box-shadow 360ms var(--ease-spring); }
.pick-row[aria-checked="true"] .radio { box-shadow: inset 0 0 0 6px var(--color-accent); }

/* Всплывающая подсказка */
.toast-msg {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 28px + var(--safe-bottom)); z-index: 250;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: rgba(22, 31, 43, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm); font-weight: 600;
  opacity: 0; transform: translate(-50%, 14px) scale(0.94);
  transition: opacity 220ms var(--ease-fade), transform 260ms var(--ease-out);
  pointer-events: none;
}
/* Галочка прорисовывается штрихом, когда подсказка доехала */
.toast-msg .icon {
  width: 18px; height: 18px; color: var(--color-success); stroke-width: 2.25;
  stroke-dasharray: 20; stroke-dashoffset: 20;
  transition: stroke-dashoffset 420ms var(--ease-smooth) 160ms;
}
.toast-msg.show { opacity: 1; transform: translate(-50%, 0); transition: opacity 260ms var(--ease-fade), transform var(--dur-spring) var(--ease-spring); }
.toast-msg.show .icon { stroke-dashoffset: 0; }
.toast-msg .icon.info { color: var(--color-accent-text); stroke-dasharray: none; }
/* Когда открыт лист, подсказка сверху — чтобы не закрывать его содержимое */
.sheet-open .toast-msg { top: calc(14px + var(--safe-top)); bottom: auto; transform: translate(-50%, -14px) scale(0.94); }
.sheet-open .toast-msg.show { transform: translate(-50%, 0); }

/* ── Лендинг ── */
.landing { padding-top: 4px; }
.landing-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; text-align: center; text-wrap: balance; }
.landing-sub { max-width: 32ch; margin: 10px auto 0; text-align: center; color: var(--color-text-secondary); text-wrap: pretty; }
.features { list-style: none; display: grid; gap: 4px; margin-top: 22px; padding: 8px 14px; border-radius: 22px; background: var(--color-surface); box-shadow: var(--shadow-ring); }
.features li { display: flex; align-items: center; gap: 14px; padding: 10px 0; font-size: var(--text-sm); color: var(--color-text-tertiary); }
.features li + li { border-top: 1px solid var(--color-separator); }
.features li > span:last-child { display: flex; flex-direction: column; text-wrap: pretty; }
.features b { font-size: var(--text-body); font-weight: 600; color: var(--color-text); }
.feat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent-text); flex: none; }
.landing-price { margin-top: 22px; text-align: center; color: var(--color-text-secondary); }
.landing-price b { font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; margin: 0 2px; }
/* 15-11-2026: обе кнопки закреплены над доком одним блоком — «Попробовать бесплатно» раньше стояла в конце страницы,
   и до неё приходилось листать (владелец: «кнопку не видно»). Подложка-затухание — чтобы текст под блоком не мешал. */
.landing-actions { margin-top: 12px; position: sticky; bottom: calc(var(--dock-h) + 16px + var(--safe-bottom)); z-index: 2; display: grid; gap: 8px; }
.landing-actions::before { content: ""; position: absolute; inset: -28px -16px -10px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--color-bg) 34%); }
.landing #trial-btn { width: 100%; background: var(--color-surface); box-shadow: var(--shadow-ring); }

/* ── Узкий экран ── */
@media (max-width: 429px) {
  #guide-platforms .seg-btn .icon { display: none; }
}
@media (max-width: 399px) {
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Две узкие плитки рядом (360–429): значок, текст и стрелка в строку, как на широком экране, только плотнее */
@media (min-width: 340px) and (max-width: 429px) {
  .tile { gap: 8px; padding: 10px 6px 10px 10px; }
  .tile-ic { width: 28px; height: 28px; }
  .tile-ic .icon { width: 18px; height: 18px; }
  .tile-chev { width: 16px; height: 16px; }
}
/* Совсем узкая плитка (внутри меньше 142 px — окна 360–389): со стрелкой «Устройства» и «Продлите» не помещаются —
   стрелку убираем, плитка и так кнопка. Без поддержки запросов к контейнеру стрелка остаётся, текст переносится */
@container (max-width: 141px) {
  .tile-chev { display: none; }
}
@media (max-width: 374px) {
  #ticket-view-title { -webkit-line-clamp: 5; }
}
@media (max-width: 359px) {
  .btn { padding-inline: 14px; }
  .btn-icon { width: 44px; }
  .btn-row { gap: 8px; }
  .copy-field .btn { width: 44px; padding: 0; gap: 0; }
  .copy-field .copy-label { display: none; }
  .days-num { font-size: 56px; }
  .days-num.is-inf { font-size: 70px; }
  /* Строка устройства с карандашом и корзиной: под название остаётся больше места */
  .item { gap: 10px; padding-left: 10px; }
  .item-ic { width: 36px; height: 36px; }
}

/* ── Отклик на нажатие ── */
.sheet-close, .sheet-back, .item-act, .ticket-item, .danger-row, .pick-row, .reply-send {
  transition-property: scale, background-color, color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.sheet-close:active, .sheet-back:active, .item-act:active, .ticket-item:active, .danger-row:active, .pick-row:active, .reply-send:active { scale: 0.96; }
@media (hover: hover) {
  .banner:hover, .ticket-item:hover, .pick-row:hover, .bypass:hover { background-color: var(--color-control); }
  .wave-btn:hover, .reply-send:hover { filter: brightness(1.08); }
  .btn-primary:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 10px 26px -12px var(--color-accent-glow); }
  .chip-btn:hover { background-color: rgba(47, 124, 246, 0.24); }
  .sheet-close:hover, .sheet-back:hover { background-color: var(--color-control-hover); color: var(--color-text); }
}

/* ── Высокий контраст (Windows, Telegram Desktop) ── */
@media (forced-colors: active) {
  .seg-btn[aria-checked="true"], .platform-card[aria-checked="true"] { outline: 2px solid Highlight; }
  .btn, .amount, .seg, .tile, .dur-card, .platform-card, .banner, .card, .status-card, .sheet, .name-input-card, .dock, .chip-btn, .route-card, .theme-card { border: 1px solid ButtonText; }
  .field input, .field textarea, .reply-input, .name-input-field { border: 1px solid CanvasText; }
  .name-input-field:focus, .field input:focus, .field textarea:focus, .reply-input:focus { outline: 2px solid Highlight; }
}

/* ── Широкий экран: колонка шириной с телефон ── */
/* На компьютере фон тоже чисто чёрный: синеватый фон вокруг колонки давал видимые границы у блоков */

/* ── Меньше движения ── */
@media (prefers-reduced-motion: reduce) {
  /* При прокрутке шар только темнеет — без масштаба */
  .hero { transform: translateX(-50%) !important; }
  .wave svg, .platform-card.detected-pulse { animation: none !important; }
  .splash-ring, .spinner { animation-duration: 1.8s !important; }
  .dock-icon .icon, .platform-card .p-check { scale: 1 !important; filter: none !important; transition-property: opacity !important; }
  .name-input-card { transform: none !important; transition: none !important; }
  .toast-msg, .toast-msg.show, .sheet-open .toast-msg { transform: translate(-50%, 0) !important; }
  .app-in .enter, .dock.enter { animation-name: fade-only !important; }
  .sheet, .pane, .dock-lens, .days-meter span, .meter span, .seg-thumb, .toggle .knob { transition-duration: 0ms !important; }
  .splash-logo { transition: none !important; }
  .splash-video { display: none !important; }
  .sw-a, .sw-b { animation: none !important; }
  /* Постоянное движение — выключено; состояние видно по цвету */
  .skel::after, .skel-bubble::after, .waiting::before, .name-input-overlay.visible .name-input-icon { animation: none !important; }
  .toast-msg .icon { stroke-dashoffset: 0 !important; transition: none !important; }
  .faq summary .icon { transition-duration: 0ms !important; }
  .reel-stack .ava, .reel-film { transition-property: opacity !important; }
  .reel-track { transition: none !important; }
  .status-title :is(.st-head, .st-tail) { transition: none !important; }   /* загорание — только в обычном режиме */
  /* Шар стоит; выбор сервера — без пружин: карточка и кольцо значка только проявляются */
  .srv-card, .srv-card.open, .srv-flag, .srv-title, .srv-note { transform: none !important; transition: opacity 160ms var(--ease-fade) !important; }
  .pin::before, .pin.is-on::before, .pin-new, .pin.is-on .pin-new { transition: opacity 160ms var(--ease-fade) !important; }
  .pin::before, .pin.is-on::before { transform: none !important; }
  .main-block > :is(#has-sub, #no-sub), .main-block.srv-push > :is(#has-sub, #no-sub) { transition: none !important; }
}
@keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }

/* ── Unbounded везде (проба) ──
   Режим по умолчанию: весь текст — Unbounded (обычный — «текстовым», мельче на 10%), крупное — полным.
   data-heading-font="headings" — только заголовки, "sf" — ровно прежний вид. */
:root:not([data-heading-font="sf"]):not([data-heading-font="headings"]) {
  --font-ui: "UnboundedText", -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
  --font-display: "Unbounded", -apple-system, BlinkMacSystemFont, "InterVar", Roboto, "Segoe UI", sans-serif;
}

/* ── Заголовки — Unbounded (проба) ──
   Только заголовки: крупные числа (баланс, дни, цены, гигабайты) остаются на --font-display. Unbounded широкий,
   поэтому жирность 600 вместо 700 и почти без отрицательной разрядки. Прежние правила не тронуты: при
   data-heading-font="sf" на <html> всё выглядит ровно как раньше. */
:root:not([data-heading-font="sf"]) :is(.status-title, .screen-title, .sheet-title, .ref-promo-title,
  .profile-name, .landing-title, .error-title, .srv-name) {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}
:root:not([data-heading-font="sf"]) .splash-word { font-family: var(--font-heading); letter-spacing: -0.01em; }
:root:not([data-heading-font="sf"]) .sw-a { font-weight: 700; }

/* Вспомогательный текст — Onest: серые подписи, пояснения, мета-строки («Автопродление …», «Лимит …»,
   «Устройства»/«Баланс» в плитках, «iOS 18.6, Happ, с 17 августа» у устройств и подобное).
   Значения, кнопки, заголовки и «использовано … ГБ из … ГБ» (.gb-used) остаются Unbounded. */
:root:not([data-heading-font="sf"]):not([data-heading-font="headings"]) :is(.muted, .error-text, .days-label, .status-sub, .tile-label, .card-sub,
  .list-label, .empty, .banner-text, .themes-how, .item-meta,
  .dur-meta, .dur-old, .ref-promo-desc, .stat-label, .reel-caption, .ticket-date,
  .tx-date, .sheet-sub, .step-sub, .or, .bypass-text, .name-input-subtitle,
  .name-input-hint, .landing-sub, .landing-price, .srv-city, .srv-note,
  .partner-link, .pm-meta, .pp-reason) {
  font-family: var(--font-secondary);
}

/* ── Подключить устройство по QR (docs/context/qr-connect.md) ──
   Рамка с живой камерой и бегущей «волной» (эхо волны кнопки «Подключиться»), под ней «Код» и «Файл»;
   «Мой QR» — белая карточка с кодом; внизу переключатель режимов. */
.pair-entry { margin-bottom: 14px; }
#sheet-pair .sheet-body { display: flex; flex-direction: column; gap: 14px; }
.pair-pane { display: flex; flex-direction: column; gap: 14px; }
.pair-pane[hidden] { display: none; }
.pair-frame, .pair-qr-card {
  position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 0 auto;
  border-radius: var(--r-card); overflow: hidden; background: var(--color-surface-raised);
  box-shadow: var(--shadow-ring-strong);
}
.pair-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 420ms var(--ease-fade); }
.pair-frame.live video { opacity: 1; }
/* Уголки видоискателя: дышат, пока ищем код, и сжимаются к центру, когда нашли */
.pair-corners { position: absolute; inset: 14%; pointer-events: none; transition: inset 520ms var(--ease-spring); }
.pair-corners i { position: absolute; width: 22%; height: 22%; border: 3px solid var(--color-wave-light); border-radius: 6px; }
.pair-corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.pair-corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.pair-corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.pair-corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.pair-frame.live .pair-corners { animation: pair-breathe 2.4s var(--ease-smooth) infinite alternate; }
.pair-frame.found .pair-corners { inset: 22%; animation: none; }
.pair-frame.found .pair-corners i { border-color: var(--color-success); }
@keyframes pair-breathe { from { inset: 14%; } to { inset: 12%; } }
.pair-scanline {
  position: absolute; left: 14%; right: 14%; top: 14%; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--color-wave), transparent);
  box-shadow: 0 0 18px 2px var(--color-accent-glow);
}
.pair-frame.live:not(.found) .pair-scanline { opacity: 1; animation: pair-scan 2.2s var(--ease-smooth) infinite alternate; }
@keyframes pair-scan { from { transform: translateY(0); } to { transform: translateY(calc(min(340px, 100vw - 2 * var(--pad)) * 0.72)); } }
/* Сообщение поверх рамки: нет камеры, нашли код, готово */
.pair-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 22px; text-align: center; background: var(--color-surface-raised);
  font-size: var(--text-body); color: var(--color-text-secondary); text-wrap: balance;
}
.pair-msg[hidden] { display: none; }
.pair-msg b { color: var(--color-text); font-family: var(--font-heading); font-size: var(--text-lg); font-weight: 600; }
.pair-msg .icon { width: 40px; height: 40px; color: var(--color-accent-text); }
.pair-msg.ok .icon { color: var(--color-success); }
.pair-msg .btn { min-height: 46px; }
.pair-hint { text-align: center; font-family: var(--font-secondary); font-size: var(--text-sm); color: var(--color-text-secondary); text-wrap: balance; }
.pair-hint b { color: var(--color-text); font-weight: 600; }
.pair-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pair-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px;
  border-radius: var(--r-btn); background: var(--color-control); font-weight: 600; font-size: var(--text-sm);
  transition: scale 150ms ease-out, background-color 150ms;
}
.pair-tool:active { scale: 0.96; background: var(--color-control-hover); }
.pair-tool .icon { width: 26px; height: 26px; color: var(--color-accent-text); }
.pair-qr-card { background: var(--color-qr-bg); padding: 16px; }
.pair-qr svg { display: block; width: 100%; height: 100%; }
.pair-qr.fresh { animation: pair-qr-in 620ms var(--ease-spring) both; }
@keyframes pair-qr-in { from { opacity: 0; transform: scale(0.92); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.pair-timer { text-align: center; font-size: var(--text-sm); color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; min-height: 1.45em; }
.pair-tv { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: var(--text-sm); color: var(--color-link); }
.pair-tv .icon { width: 20px; height: 20px; }
.pair-seg { margin-top: 2px; }
.pair-code-field { text-transform: uppercase; letter-spacing: 0.18em; text-align: center; font-family: var(--font-heading); font-size: var(--text-title); }
@media (prefers-reduced-motion: reduce) {
  .pair-frame.live .pair-corners, .pair-frame.live:not(.found) .pair-scanline { animation: none; }
  .pair-qr.fresh { animation: none; }
}

/* ── Переливающиеся кнопки (владелец 15-10-2026: «надо кнопки сделать переливающиеся в лк») ──
   Главные синие кнопки и «подтвердить» в окнах: градиент логотипа перетекает (8 с туда-обратно), раз в ~4 с
   по кнопке пробегает блик. «Подключиться» (.wave-btn) не трогаем — у неё своя волна. Блик двигается
   transform-ом (не перерисовывает кнопку); при «Уменьшить движение» — обычная статичная кнопка. */
.btn-primary, .name-input-btn.confirm {
  position: relative; isolation: isolate; overflow: hidden;
  background-image: var(--gradient-accent-flow); background-size: 300% 100%; background-position: 0% 50%;
  animation: btn-flow 8s ease-in-out infinite alternate;
}
.btn-primary::after, .name-input-btn.confirm::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 55%; z-index: 1; pointer-events: none;
  background: var(--shimmer); transform: translateX(-120%) skewX(-18deg);
  animation: btn-shimmer 4.2s var(--ease-smooth) infinite;
}
.btn-primary:disabled::after, .name-input-btn.confirm:disabled::after { animation: none; opacity: 0; }
@keyframes btn-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes btn-shimmer {
  0%, 55% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(260%) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary, .name-input-btn.confirm { animation: none; background-image: var(--gradient-accent); background-size: auto; }
  .btn-primary::after, .name-input-btn.confirm::after { display: none; }
}

/* hidden у кнопок: .btn, .route-card и .pair-tool задают display — без этого атрибут не прятал
   (15-10-2026: «Подключить устройство» видели все, а не только те, кому включено) */
.btn[hidden], .route-card[hidden], .pair-tool[hidden] { display: none !important; }

/* «Подключиться» → «Выберите устройство»: под сеткой — «Подключить другое устройство» (QR) */
.pair-other { margin: 10px 0 14px; }

/* ── Кабинет партнёра (docs/context/partners.md) ──
   Кнопка на вкладке «Друзья» (только партнёрам) и лист: ссылка и промокод, доход плитками, по месяцам, заявки.
   Движение — только через anim()/enter()/stagger()/countTo() в cabinet.js; своих CSS-анимаций здесь нет. */
.partner-banner { margin-bottom: 12px; }
#partner-share > .list-label:first-child { margin-top: 4px; }
.partner-ended { padding-top: 6px; }
.partner-link-row {
  display: flex; align-items: center; gap: 8px; min-height: 52px;
  padding: 6px 6px 6px 14px; border-radius: var(--r-btn);
  background: var(--color-control);
}
.partner-link-row + .partner-link-row { margin-top: 8px; }
.partner-link {
  flex: 1; min-width: 0; direction: ltr;
  font-size: var(--text-sm); color: var(--color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.partner-share-btn { margin-top: 10px; }
.partner-code {
  flex: 1; min-width: 0;
  font-family: var(--font-display); font-size: var(--text-title-lg); font-weight: 700; letter-spacing: 0.04em; line-height: 1.2;
  color: var(--color-text); overflow-wrap: anywhere;
}
.partner-hint { margin-top: 8px; }
.partner-hint:empty { display: none; }
.partner-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }   /* 2×3: суммы в десятки тысяч не упираются в край */
.partner-stat {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 12px; border-radius: var(--r-inner);
  background: var(--color-control);
}
.partner-stat .stat-num { font-size: var(--text-title); white-space: nowrap; overflow-wrap: normal; }
.partner-stat.is-key { background: var(--color-success-soft); box-shadow: inset 0 0 0 1px var(--color-success-line); }
.partner-stat.is-key .stat-num { color: var(--color-success); }
/* Совсем узкий экран — числа на ступень мельче, «100 000 ₽» помещается в плитку */
@media (max-width: 350px) { .partner-stat .stat-num { font-size: var(--text-lg); } }
#partner-payout-btn { margin-top: 14px; }
.partner-month > span:first-child { color: var(--color-text); font-weight: 500; }
.partner-month-val { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.partner-month-val b { font-weight: 600; color: var(--color-success); }
.pm-meta { font-size: var(--text-caption); color: var(--color-text-tertiary); }
.partner-payout { align-items: flex-start; padding: 10px 0; }
.pp-ic.is-requested { background: var(--color-warning-soft); color: var(--color-warning); }
.pp-ic.is-paid { background: var(--color-success-soft); color: var(--color-success); }
.pp-ic.is-rejected { color: var(--color-danger); }
.pp-title { display: block; font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }
.pp-reason { display: block; margin-top: 4px; color: var(--color-text-secondary); font-size: var(--text-caption); overflow-wrap: anywhere; }
.pp-hash {
  position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 28px;
  font-size: var(--text-caption); font-variant-numeric: tabular-nums; color: var(--color-link);
}
.pp-hash::after { content: ""; position: absolute; inset: -8px -6px; }   /* палец попадает с запасом */
.pp-hash .icon { width: 14px; height: 14px; }
.pp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.pp-side .badge { padding: 2px 9px; font-size: var(--text-caption); font-weight: 700; white-space: nowrap; }
.pp-side .chip-btn { min-height: 32px; padding: 0 12px; }
.partner-form { display: grid; gap: 12px; }
.partner-form .list-label { margin: 4px 0 -4px; }
.partner-form .partner-hint { margin-top: 6px; }
.partner-networks .seg-btn { letter-spacing: 0.02em; }
