/* ========= TOKENS ========= */
:root {
  --bg: #f4f5f7;
  --white: #ffffff;
  --black: #0a0a0a;
  --gray1: #f4f5f7;
  --gray2: #e8e9ed;
  --gray3: #9ca3af;
  --gray4: #6b7280;
  --violet: #7c3aed;
  --violet-light: #ede9fe;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --nav-h: 74px;
  --app-w: 430px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tg-safe-b: var(--tg-viewport-stable-height, var(--safe-b));
  /* Шапки вкладок — тот же язык, что и боковое меню */
  --hero-shell-bg: linear-gradient(165deg, #2d2b3d 0%, #1f1d2b 40%, #14131c 100%);
  --hero-shell-border: 1px solid rgba(255, 255, 255, 0.12);
  --hero-shell-shadow:
    0 12px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  /* Карточки под шапкой профиля — единый язык */
  --profile-card-border: 2px solid var(--gray2);
  --profile-card-pad: 14px 16px;
}

/* ========= FONTS (self-hosted) ========= */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/montserrat-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/montserrat-latin.woff2') format('woff2');
  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;
}

/* Coolvetica — для больших заголовков */
@font-face {
  font-family: 'Coolvetica';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/coolvetica-rg.woff2') format('woff2');
}
@font-face {
  font-family: 'Coolvetica';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/coolvetica-bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Coolvetica';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/coolvetica-heavy.woff2') format('woff2');
}

/* ========= RESET ========= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body {
  min-height: 100vh;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; }

/* OAuth callback: сообщение об ошибке после скрытия оверлея */
.callback-error {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  width: min(420px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
}
.callback-error[hidden] {
  display: none !important;
}

/* ========= LOADING OVERLAY ========= */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity .45s ease, visibility .45s ease;
}
.loading-overlay[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(248,249,252,.98) 0%, rgba(244,245,250,.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.loading-overlay__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 300px;
}

/* Визуальный блок с риплами и иконкой */
.loading-overlay__visual {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sonar-рипла: расширяющиеся кольца */
.loading-overlay__ripples {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay__ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(124,58,237,.35);
  border-radius: 50%;
  animation: loadingRipple 2.2s cubic-bezier(0.4,0,0.2,1) infinite;
}
.loading-overlay__ripple:nth-child(2) { animation-delay: .35s; }
.loading-overlay__ripple:nth-child(3) { animation-delay: .7s; }
@keyframes loadingRipple {
  0% { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Иконка молнии */
.loading-overlay__icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(124,58,237,.3));
}
.loading-overlay__svg {
  width: 100%;
  height: 100%;
}
.loading-overlay__bolt {
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: loadingBoltDraw 1.8s cubic-bezier(0.4,0,0.2,1) infinite;
}
@keyframes loadingBoltDraw {
  0% { stroke-dashoffset: 140; opacity: 1; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  50% { opacity: 1; }
  65% { stroke-dashoffset: 0; opacity: .5; }
  100% { stroke-dashoffset: 140; opacity: 1; }
}

/* Bouncing dots */
.loading-overlay__dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.loading-overlay__dots span {
  width: 8px;
  height: 8px;
  background: var(--violet);
  border-radius: 50%;
  animation: loadingDot 1.2s ease-in-out infinite both;
}
.loading-overlay__dots span:nth-child(2) { animation-delay: .15s; }
.loading-overlay__dots span:nth-child(3) { animation-delay: .3s; }
@keyframes loadingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
  40% { transform: scale(1.1); opacity: 1; }
}

.loading-overlay__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--black);
  letter-spacing: -0.2px;
  margin-bottom: 10px;
}
.loading-overlay__sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray4);
  font-weight: 500;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  min-height: 3.2em;
  transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}
.loading-overlay__sub.loading-overlay__sub--exit {
  opacity: 0;
  transform: translateY(8px);
}
@keyframes loadingSubEnter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.loading-overlay__sub.loading-overlay__sub--enter {
  animation: loadingSubEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ========= APP SHELL ========= */
/* До снятия загрузки (body.app-ready) не показываем кабинет — даже на время редиректа на account */
body:not(.app-ready) .app-shell {
  visibility: hidden;
}
body.app-ready .app-shell {
  visibility: visible;
}
.app-shell {
  min-height: 100vh;
  position: relative;
}
.app {
  max-width: var(--app-w);
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 32px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.app-main {
  min-width: 0;
}
body.app-ready .app {
  opacity: 1;
}

/* ========= TABS ========= */
.tab { display: none; }
.tab.active { display: block; }

.push-prompt-anchor:not(:empty) {
  display: block;
  margin: 0 0 14px 0;
}
.push-prompt-anchor[hidden]:empty {
  display: none !important;
}

/* ========= PROFILE HERO STACK ========= */
.profile-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ========= GREETING CARD ========= */
.greeting-card {
  background: var(--hero-shell-bg);
  border: var(--hero-shell-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--hero-shell-shadow);
}
.greeting-card__body {
  min-width: 0;
  flex: 1;
}
.greeting-card__hello {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.greeting-card__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  color: #fff;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
  white-space: normal;
  word-wrap: break-word;
}
.greeting-card__sub {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* Профиль: компактная шапка */
.greeting-card--profile {
  padding: 18px 18px 18px 20px;
  gap: 14px;
  align-items: center;
  border-radius: 22px;
}
.greeting-card--profile .greeting-card__hello {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.52);
}
.greeting-card--profile .greeting-card__title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}
.greeting-card--profile .greeting-card__sub {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.35;
}

.profile-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ddd6fe 0%, #a78bfa 52%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.14);
}
.profile-avatar__initials {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
  line-height: 1;
  user-select: none;
}

/* ========= PROFILE CARDS (общая основа под шапкой) ========= */
.profile-card {
  margin-top: 12px;
  background: var(--white);
  border: var(--profile-card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.profile-card[hidden] {
  display: none !important;
}

/* ========= PROMO COUNTDOWN (profile) ========= */
.promo-countdown {
  padding: var(--profile-card-pad);
}
.promo-countdown__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.promo-countdown__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.promo-countdown__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.25px;
  color: var(--black);
}
.promo-countdown__pct {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92em;
  color: var(--violet);
  background: var(--violet-light);
}
.promo-countdown__lead {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--gray4);
  letter-spacing: 0.1px;
}
.promo-countdown__cta.accent-btn {
  width: auto;
  height: auto;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.22);
}
.promo-countdown__cta.accent-btn:active {
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}
.promo-countdown__timer {
  flex-shrink: 0;
  width: 116px;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--gray2);
  font-variant-numeric: tabular-nums;
}
.promo-countdown__timer-cap {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray4);
  line-height: 1.2;
}
.promo-countdown__days {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}
.promo-countdown__days-num {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: var(--black);
}
.promo-countdown__days-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray4);
  transform: translateY(1px);
}
.promo-countdown__clock {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px 5px;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--violet);
  white-space: nowrap;
  border-bottom: 2px solid rgba(124, 58, 237, 0.35);
}
.promo-countdown__digits {
  font: inherit;
  color: inherit;
}
.promo-countdown__colon {
  font: inherit;
  color: inherit;
  opacity: 0.45;
  padding: 0 2px;
}

/* Маскот справа — один квадрат для всех вкладок, картинки масштабируются одинаково */
.hero-mascot {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  margin: -6px -2px -6px 0;
  box-sizing: border-box;
}
.hero-mascot picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.hero-mascot__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.32));
}
/* «Пригласи друга» — два маскота в ряд, шире квадрата, та же высота что у остальных */
.hero-mascot--referral {
  width: 122px;
  height: 100px;
  margin: -6px -4px -6px 0;
}
/* ========= PROFILE FOOTER (история + выход) ========= */
.profile-footer-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 4px;
}
.profile-footer-actions:has(.profile-logout-btn[hidden]) {
  justify-content: center;
}
.profile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 2px solid var(--gray2);
  background: var(--white);
  color: var(--gray4);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.profile-logout-btn svg {
  flex-shrink: 0;
  opacity: 0.88;
}
.profile-logout-btn:hover {
  background: var(--gray1);
  border-color: #d1d5db;
  color: var(--black);
}
.profile-logout-btn:active {
  transform: translateY(1px);
}
.profile-logout-btn[hidden] {
  display: none !important;
}

/* ========= PROFILE TOOLS (аккаунт: TG + ID) ========= */
.profile-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}
.profile-tools > .profile-card {
  margin-top: 0;
}

/* ========= PROFILE: привязка Telegram ========= */
.profile-tg-banner.profile-card {
  padding: 14px 16px;
  border-width: 1px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.profile-tg-banner {
  padding: 0;
  background: var(--white);
  overflow: visible;
}
.profile-tg-banner[hidden] {
  display: none !important;
}
.profile-tg-banner__fr {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4, #6b7280);
}
.profile-tg-banner__fr[hidden] {
  display: none !important;
}
.profile-tg-banner__btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--black);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-tg-banner__btn:hover:not(:disabled) {
  opacity: 0.92;
}
.profile-tg-banner__btn:disabled {
  opacity: 0.65;
  cursor: default;
}
.profile-tg-banner__btn:disabled .profile-tg-banner__cta {
  opacity: 0.7;
}
.profile-tg-banner__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, #2aabee 12%, var(--white));
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.profile-tg-banner__logo {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.profile-tg-banner__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-tg-banner__title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--black);
}
.profile-tg-banner__sub {
  font-size: 12px;
  color: var(--gray4, #6b7280);
  font-weight: 500;
  line-height: 1.3;
}
.profile-tg-banner__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--violet-light);
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 12%, transparent);
}
.profile-tg-banner__hint {
  margin: 10px 0 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4, #6b7280);
  line-height: 1.35;
}
.profile-tg-banner__hint[hidden] {
  display: none !important;
}

/* ========= ID ROW ========= */
.id-row-card.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 48px;
  background: color-mix(in srgb, var(--violet-light) 42%, var(--white));
  border: 1px solid color-mix(in srgb, var(--violet) 10%, var(--gray2));
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.05);
}
.id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  min-height: 0;
  background: transparent;
}
.id-row__label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray4);
}
.id-row__value {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--black) 72%, var(--violet));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-row__copy.copy-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-left: 0;
  border-radius: 9px;
  background: var(--white);
  color: var(--violet);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 14%, var(--gray2));
}
.id-row__copy.copy-btn:active {
  transform: scale(0.94);
}
.id-row__copy.copy-btn.copy-success {
  background: #dcfce7;
  color: #16a34a;
  box-shadow: none;
}
.oauth-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.oauth-actions__btn {
  flex: 1 1 auto;
  min-height: 42px;
}
.copy-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
}
.copy-btn:active { transform: scale(.94); }
.copy-btn.copy-success {
  background: #16a34a;
}
.invite-btn {
  margin-top: 10px;
  width: 100%;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.invite-btn:active { transform: translateY(1px); }

/* ========= SECTION HEADER ========= */
.section-header {
  margin-top: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.3px;
  line-height: 1.05;
}
.section-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray4);
  margin-top: 4px;
  letter-spacing: 0.1px;
}

/* ========= PROFILE: collapsible sections ========= */
#routerCollapse {
  margin-top: 16px;
}
#thirdPartyCollapse {
  margin-top: 28px;
}
.profile-collapse__head-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 0 2px 10px 0;
}
.profile-collapse__head-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 14px;
}
.profile-collapse__titles {
  flex: 1;
  min-width: 0;
}
.profile-collapse__titles .section-title {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.22px;
}
.section-sub--collapse {
  margin-top: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(107,114,128,.92);
  line-height: 1.2;
  letter-spacing: 0;
}
.profile-collapse__titles .section-sub--collapse {
  margin-top: 6px;
}
.section-sub--router-two-lines {
  max-width: 220px;
}
.profile-collapse__toggle-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-collapse__toggle-only:active {
  background: rgba(15,23,42,.06);
}
.profile-collapse__chev {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray4);
  transition: transform 0.22s ease, color 0.15s ease;
}
.profile-collapse--open .profile-collapse__chev {
  transform: rotate(180deg);
  color: var(--ink);
}
.profile-collapse__head-cta {
  display: none;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 0;
}
.profile-collapse:not(.profile-collapse--open) .profile-collapse__head-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-collapse__head-cta--always {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}
.profile-collapse__panel-toolbar {
  margin-bottom: 12px;
}
.profile-collapse__panel-toolbar .accent-btn {
  width: 100%;
}
.accent-btn--compact {
  font-size: 11px;
  font-weight: 700;
  padding: 0 11px;
  min-height: 31px;
  border-radius: 999px;
  white-space: nowrap;
}
.profile-collapse__body {
  padding-bottom: 4px;
}
.profile-collapse__hint {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--gray4);
  margin: 0 0 14px;
  letter-spacing: 0.05px;
}
.profile-collapse__hint strong {
  font-weight: 800;
  color: var(--ink);
}

/* ========= HISTORY BUTTON ========= */
.history-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray4);
  letter-spacing: 0.2px;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--gray2);
  background: rgba(255,255,255,.55);
}
.profile-footer-actions .history-btn {
  border-width: 2px;
  background: var(--white);
}
.history-btn:active { background: rgba(255,255,255,.9); }
.profile-footer-actions .history-btn:active {
  background: var(--gray1);
}

/* ========= HISTORY LIST ========= */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.history-item__title {
  font-weight: 800;
  font-size: 13px;
}
.history-item__meta {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4);
}

/* ========= BUTTONS ========= */
.accent-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(124,58,237,.28);
}
.accent-btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(124,58,237,.2); }

.renew-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(22,163,74,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.renew-btn.w-full { width: 100%; }
/* display:flex выше перебивает нативный [hidden] */
.renew-btn[hidden] {
  display: none !important;
}
.renew-btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(22,163,74,.25); }
.renew-btn__icon { flex-shrink: 0; }

.ghost-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid var(--gray2);
  background: var(--white);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ghost-btn:active { background: var(--gray1); }
.ghost-btn.copy-success {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
  min-width: 44px;
  padding: 0 14px;
}

.danger-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.danger-btn:active { opacity: .9; }

.update-cfg-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.update-cfg-btn svg { display: inline-block; flex-shrink: 0; }
.update-cfg-btn:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(0,0,0,.1); }

.freeze-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd, #e0f2fe);
  color: #0284c7;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid rgba(2,132,199,.15);
  box-shadow: 0 4px 14px rgba(2,132,199,.12);
}
.freeze-btn svg { display: inline-block; flex-shrink: 0; opacity: .7; }
.freeze-btn:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(2,132,199,.1); }

.w-full { width: 100%; }

/* ========= ROUTER CARD ========= */
.router-card {
  position: relative;
  background: var(--black);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  margin-bottom: 10px;
}
.router-card--has-badge {
  margin-top: 14px;
}
.router-card:active { transform: translateY(1px); }
.router-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
  flex-shrink: 0;
}
.router-card__info { flex: 1; min-width: 0; }
.router-card__name {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.1px;
}
.router-card__pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.07);
  letter-spacing: 0.1px;
}
.router-card__arrow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 900;
  font-size: 18px;
}

/* ========= ROUTER GRID ========= */
.profile-collapse--grid-routers .profile-collapse__head-cta {
  display: none;
}
.profile-collapse--grid-routers #routerList {
  display: block;
}
.router-grid-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.router-grid-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--gray2);
  border-radius: 999px;
}
.router-grid-tabs__btn {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray4);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.router-grid-tabs__btn--active {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}
.router-grid-tabs__btn:active:not(.router-grid-tabs__btn--active) {
  color: var(--black);
}
.router-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.router-grid-empty {
  margin-bottom: 14px;
  padding: 28px 16px;
  border-radius: var(--radius-sm);
  background: var(--gray1);
  text-align: center;
}
.router-grid-empty p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
}
.router-grid-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: var(--radius-sm);
  background: var(--black);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.router-grid-card--expired {
  border-color: rgba(239, 68, 68, 0.38);
}
.router-grid-card--has-badge {
  margin-top: 10px;
}
.router-grid-card:active {
  transform: translateY(1px);
}
.router-grid-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.router-grid-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  flex-shrink: 0;
}
.router-grid-card__dot--red {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.router-grid-card__dot--orange {
  background: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
  animation: pulse-dot 2s infinite;
}
.router-grid-card__chev {
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.router-grid-card__name {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.1px;
  line-height: 1.15;
  word-break: break-word;
}
.router-grid-card__sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}
.router-grid-card__sub--expired {
  color: #f87171;
}
.router-grid-card__sub--expiring {
  color: #fdba74;
}
.router-grid-card__sub--lifetime {
  color: #c4b5fd;
  font-weight: 700;
}
.router-grid-card__promo {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #e9d5ff;
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(196, 181, 253, 0.35);
}
.router-grid-card__updated {
  position: absolute;
  top: -9px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.router-grid-activate {
  width: 100%;
  height: 48px;
  border: 1.5px dashed rgba(124, 58, 237, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.04);
  color: var(--violet);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.router-grid-activate:active {
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(1px);
}

/* ========= DRAFT ROUTER CARD ========= */
.router-card--draft {
  background: #d1d5db;
}
.router-card--draft .router-card__name {
  color: var(--black);
}
.router-card--draft .pill {
  color: var(--black);
  border-color: rgba(0,0,0,.15);
  background: rgba(0,0,0,.08);
}

/* Плейсхолдер до первого рендера списков (не «пустая страница») */
.list-mount.list-mount--pending {
  min-height: 168px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--gray1) 0%, rgba(243,244,246,.95) 50%, var(--gray1) 100%);
  background-size: 200% 100%;
  animation: listMountShimmer 1.1s ease-in-out infinite;
}
@keyframes listMountShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.router-card__dot--red {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239,68,68,.15);
}
.pill--warn {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border-color: rgba(239,68,68,.2);
}
.pill--meta {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.22);
}
.tp-delete {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(239,68,68,.15);
  color: var(--red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tp-delete:active { opacity: .7; }

/* ========= EXPIRY DOT & BANNERS ========= */
.router-card__dot--orange {
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249,115,22,.18);
  animation: pulse-dot 2s infinite;
}
.pill--expiring {
  background: rgba(249,115,22,.18);
  color: #ea580c;
  border-color: rgba(249,115,22,.35);
}
.pill--expired {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border-color: rgba(239,68,68,.2);
}
.pill--promo {
  background: rgba(124,58,237,.12);
  color: #6d28d9;
  border-color: rgba(124,58,237,.28);
  font-weight: 700;
}
.pill--lifetime {
  background: rgba(124,58,237,.14);
  color: #6d28d9;
  border-color: rgba(124,58,237,.32);
  font-weight: 700;
}

/* Тёмные карточки: светлый текст, иначе пилюли нечитаемы */
.router-card .pill--expiring {
  background: rgba(249, 115, 22, 0.22);
  color: #ffd7a8;
  border-color: rgba(251, 146, 60, 0.45);
}
.router-card .pill--expired {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}
.router-card .pill--promo {
  background: rgba(167, 139, 250, 0.2);
  color: #e9d5ff;
  border-color: rgba(196, 181, 253, 0.4);
}
.router-card .pill--lifetime {
  background: rgba(167, 139, 250, 0.22);
  color: #ede9fe;
  border-color: rgba(196, 181, 253, 0.45);
}
.router-card .pill--warn {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
}
.router-card .expiry-banner--yellow {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
}
.router-card .expiry-banner--red {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.42);
}
.router-card__dot--yellow {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,.18);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
  50% { box-shadow: 0 0 0 7px rgba(245,158,11,.10); }
}
.expiry-banner {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
}
.expiry-banner--yellow {
  background: rgba(245,158,11,.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,.25);
}
.expiry-banner--red {
  background: rgba(239,68,68,.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.2);
}
.router-card__cfg-updated {
  position: absolute;
  top: -10px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.router-card__cfg-updated::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  animation: cfgDotBlink 1.2s ease-in-out infinite;
}
@keyframes cfgDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ========= EMPTY STATE ========= */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border: 2px dashed var(--gray2);
  border-radius: var(--radius);
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--gray1);
  display: grid;
  place-items: center;
  color: var(--gray3);
}
.empty-state__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-weight: 400;
  font-size: 18px;
  margin-bottom: 6px;
}
.empty-state__sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray4);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ========= CONFIG CARD ========= */
.config-card {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.config-card__title {
  font-weight: 700;
  font-size: 14px;
}
.config-card__sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray4);
  margin-top: 3px;
  letter-spacing: 0.1px;
}

/* ========= THIRD-PARTY CARD ========= */
.tp-card {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.tp-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gray1);
  display: grid;
  place-items: center;
  color: var(--gray4);
  flex-shrink: 0;
}
.tp-card__info { flex: 1; min-width: 0; }
.tp-card__name {
  font-weight: 700;
  font-size: 14px;
}
.tp-card__meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray4);
  margin-top: 3px;
  letter-spacing: 0.1px;
}
.tp-card__status {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.1);
  flex-shrink: 0;
}

/* ========= PAGE TITLE (tabs 2,3) ========= */
.page-title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.3px;
  line-height: 1.05;
}
.page-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray4);
  margin-top: 4px;
  margin-bottom: 20px;
  letter-spacing: 0.1px;
}

/* ========= CFG PAGE (Servers tab — обновление конфигурации) ========= */
.cfg-page {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* запас над плавающим dock — «Далее» не прилипает */
  padding-bottom: 28px;
}

.cfg-hero {
  background: var(--hero-shell-bg);
  border: var(--hero-shell-border);
  border-radius: 20px;
  padding: 16px 16px 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--hero-shell-shadow);
}
.cfg-hero__body {
  flex: 1;
  min-width: 0;
}
.cfg-hero__title {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.cfg-hero__sub {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}
.cfg-hero__guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: rgba(221, 214, 254, 0.9);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  opacity: 0.9;
}
.cfg-hero__guide:hover {
  color: #fff;
  opacity: 1;
}
.cfg-hero__guide svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.cfg-hero__badge {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.35) 0%, rgba(124, 58, 237, 0.45) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Wizard — без принудительного внутреннего скролла */
.cfg-wizard {
  background: var(--white);
  border: 1px solid var(--gray2);
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
}
.cfg-wizard__head {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cfg-wizard__dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.cfg-wizard__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gray2);
  transition: width .25s ease, background .25s ease;
}
.cfg-wizard__dot.is-active {
  width: 18px;
  background: var(--violet);
}
.cfg-wizard__dot.is-done {
  background: color-mix(in srgb, var(--violet) 55%, var(--gray2));
}
.cfg-wizard__title {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--black);
  line-height: 1.2;
}
.cfg-wizard__sub {
  margin: 0;
  font-size: 12px;
  font-weight: 550;
  color: var(--gray4);
  line-height: 1.35;
}
.cfg-wizard__viewport {
  width: 100%;
  overflow: hidden;
}
.cfg-wizard__track {
  display: flex;
  width: 300%;
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  align-items: flex-start;
}
.cfg-wizard__track[data-step="1"] { transform: translateX(0); }
.cfg-wizard__track[data-step="2"] { transform: translateX(-33.333%); }
.cfg-wizard__track[data-step="3"] { transform: translateX(-66.666%); }
.cfg-wizard__slide {
  width: 33.333%;
  flex-shrink: 0;
  padding-right: 4px;
  box-sizing: border-box;
  /* неактивные слайды не раздувают высоту карточки */
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.cfg-wizard__track[data-step="1"] .cfg-wizard__slide[data-slide="1"],
.cfg-wizard__track[data-step="2"] .cfg-wizard__slide[data-slide="2"],
.cfg-wizard__track[data-step="3"] .cfg-wizard__slide[data-slide="3"] {
  height: auto;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
}
.cfg-wizard__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid var(--gray2);
}
.cfg-wizard__back,
.cfg-wizard__change {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
}
.cfg-wizard__next {
  flex: 1;
  min-height: 48px;
  border-radius: 999px;
}
.cfg-wizard__next:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
}
.cfg-wizard__back[hidden],
.cfg-wizard__change[hidden],
.cfg-wizard__next[hidden] {
  display: none !important;
}

/* Компактный список роутеров — строки на всю ширину */
.cfg-router-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
}
.cfg-router-list:has(.cfg-router-card:nth-child(8)) {
  max-height: min(340px, 42vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.cfg-router-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--gray2);
  background: var(--gray1);
  color: var(--black);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.cfg-router-card:active { transform: scale(0.995); }
.cfg-router-card.is-selected {
  border-color: var(--violet);
  background: var(--violet-light);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.12);
}
.cfg-router-card.is-expired { opacity: 0.55; }
.cfg-router-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.cfg-router-card__dot--expired { background: var(--red); }
.cfg-router-card__dot--warn { background: #f59e0b; }
.cfg-router-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cfg-router-card__name {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cfg-router-card__meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4);
  line-height: 1.2;
  white-space: nowrap;
}
.cfg-router-card__check { display: none !important; }

.cfg-select--fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cfg-empty-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
}
.cfg-empty-hint[hidden] { display: none !important; }

.cfg-history-footer {
  display: flex;
  justify-content: center;
  padding: 2px 0 8px;
}
.cfg-history-btn {
  border: none;
  background: transparent;
  color: var(--gray4);
  font-size: 12px;
  font-weight: 500;
  padding: 6px;
  opacity: 0.75;
}

.cfg-download-block { margin-top: 10px; }
.cfg-download-btn {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  border: none;
  border-radius: 999px;
}
.cfg-download__hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray4);
}

.cfg-select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--gray2);
  border-radius: 12px;
  appearance: none;
  background: var(--white);
}
.cfg-select:focus {
  outline: none;
  border-color: var(--violet);
}

/* Баннер об истекшей подписке */
/* [hidden] обязателен: иначе display:flex перебивает нативное скрытие атрибута hidden */
.cfg-expired-banner[hidden] {
  display: none !important;
}
.cfg-expired-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(234,88,12,.08) 0%, rgba(249,115,22,.06) 100%);
  border: 1px solid rgba(234,88,12,.22);
  border-radius: 14px;
}
.cfg-expired-banner__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(234,88,12,.15);
  border-radius: 8px;
  color: #c2410c;
  font-weight: 800;
  font-size: 14px;
}
.cfg-expired-banner__body {
  min-width: 0;
  flex: 1;
}
.cfg-expired-banner__title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 800;
  color: #9a3412;
  letter-spacing: -0.02em;
}
.cfg-expired-banner__text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #9a3412;
  font-weight: 550;
}

/* Server grid — 2 колонки */
.cfg-server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cfg-srv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 16px 12px;
  text-align: center;
  background: var(--gray1);
  border: 2px solid var(--gray2);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.cfg-srv-card:hover {
  border-color: var(--gray3);
  background: var(--gray1);
}
.cfg-srv-card:focus-visible {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.cfg-srv-card.selected {
  border-color: var(--violet);
  background: var(--violet-light);
  box-shadow: 0 6px 20px rgba(124,58,237,.18);
}
.cfg-srv-card__flag {
  font-size: 36px;
  line-height: 1;
}
.cfg-srv-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
}
.cfg-srv-card__city {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray4);
}
.cfg-srv-card__desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--violet);
  line-height: 1.25;
  max-width: 100%;
  padding: 0 4px;
}
.cfg-srv-card__ping {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: rgba(34,197,94,.1);
  padding: 3px 8px;
  border-radius: 6px;
}
/* Скрытый сервер — 3-я карточка на всю ширину, бейдж заметный */
.cfg-srv-card--hidden {
  grid-column: 1 / -1;
  min-height: 100px;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  gap: 12px;
}
.cfg-srv-card--hidden .cfg-srv-card__flag {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background: var(--gray1);
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.cfg-srv-card--hidden .cfg-srv-card__name {
  flex: 1;
}
.cfg-srv-card--hidden .cfg-srv-card__badge {
  width: 100%;
  order: 10;
  font-size: 13px;
  font-weight: 700;
  color: var(--violet);
  background: rgba(124,58,237,.15);
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
}
.cfg-srv-card--hidden.selected .cfg-srv-card__badge {
  background: rgba(124,58,237,.3);
}

/* Summary */
.cfg-summary-card {
  background: var(--gray1);
  border: 1px solid var(--gray2);
  border-radius: 14px;
  padding: 4px 14px;
  margin-bottom: 12px;
}
.cfg-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
}
.cfg-summary__row:not(:last-child) {
  border-bottom: 1px solid var(--gray2);
}
.cfg-summary__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray4);
}
.cfg-summary__value {
  font-size: 13px;
  font-weight: 800;
  color: var(--black);
  text-align: right;
}
.cfg-cta {
  min-height: 48px;
  border-radius: 999px;
  width: 100%;
}
.cfg-cta:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Confirm modal — выше loading (9999) и welcome (10050) */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  border: none;
  padding: 0;
  cursor: pointer;
}
.confirm-modal__card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  margin: 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--white, #fff);
  color: var(--gray5, #1a1a1a);
  box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.22);
}
.confirm-modal__bar {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--gray2, #e5e7eb);
  margin: 4px auto 14px;
}
.confirm-modal__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.confirm-modal__text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--gray4, #555);
}
.confirm-modal__text strong {
  color: var(--gray5, #1a1a1a);
  font-weight: 700;
}
.confirm-modal__hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--gray4, #6b7280);
}
.confirm-modal__err {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.9rem;
  line-height: 1.4;
}
.confirm-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.confirm-modal__actions .accent-btn,
.confirm-modal__actions .ghost-btn {
  width: 100%;
  justify-content: center;
}
.cfg-confirm__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray4);
  margin-bottom: 20px;
}
.sheet--confirm-cfg .sheet__body {
  gap: 12px;
}

/* ========= SERVER LIST ========= */
.server-card {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.server-card__flag {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gray1);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.server-card__info { flex: 1; }
.server-card__name { font-weight: 700; font-size: 14px; }
.server-card__city { font-size: 12px; font-weight: 500; color: var(--gray4); margin-top: 2px; }
.server-card__ping {
  font-weight: 700;
  font-size: 12px;
  color: var(--green);
}

/* ========= HELP LIST ========= */
.help-list { display: flex; flex-direction: column; gap: 8px; }
.help-item {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help-item::after {
  content: '›';
  font-size: 20px;
  color: var(--gray3);
  font-weight: 800;
}
.help-item:active { background: var(--gray1); }

/* ========= HELP v2 (clean UI) ========= */
.help-hero {
  background: #2b2540;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  margin-bottom: 14px;
}
.help-hero.help-hero--article {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 0 12px;
  gap: 0;
}
.help-hero.help-hero--article .help-hero__row {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}
.help-hero.help-hero--article .hero-mascot,
.help-hero.help-hero--article .hero-mascot picture,
.help-hero.help-hero--article .hero-mascot__img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}
.help-hero.help-hero--article .help-hero__title {
  display: none !important;
}
.help-hero.help-hero--article .help-hero__body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.help-hero.help-hero--article .help-hero__sub {
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.help-hero.help-hero--article .help-hero__back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #ddd6fe;
  background: #ede9fe;
  color: #5b21b6;
  flex-shrink: 0;
}
.help-hero.help-hero--article .help-hero__search {
  display: none !important;
}
.help-hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.help-hero__back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  font-size: 22px;
  font-weight: 900;
  line-height: 0;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.help-hero__back:hover { background: rgba(255,255,255,.18); }
.help-hero__back:active { background: rgba(255,255,255,.25); }
.help-hero__back[hidden] { display: none; }
.help-hero__body { flex: 1; min-width: 0; }
.help-hero__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.3px;
  white-space: normal;
  word-wrap: break-word;
}
.help-hero__sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0;
  line-height: 1.35;
}
.help-hero__sub[hidden] { display: none; }
.help-hero__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(196, 181, 253, 0.35);
  color: rgba(255, 255, 255, 0.75);
  cursor: text;
}
.help-hero__search[hidden] { display: none; }
.help-hero:not(.is-home) .help-hero__search { display: none; }
.help-hero__search:focus-within {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(196, 181, 253, 0.55);
  color: #fff;
}
.help-hero__search-icon {
  flex-shrink: 0;
  opacity: 0.9;
}
.help-hero__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 0;
}
.help-hero__search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}
.help-hero__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.help-v2 {
  margin-top: 0;
}
.help-v2--support-open .help-v2__content {
  gap: 0;
}

/* Полноэкранный чат поддержки: как в референсе — без шапки вкладки и без нижнего/rail-меню */
body:has(.tab[data-tab="help"].active .help-v2--support-open) {
  padding: 0;
  background: #f4f5f7;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) {
  padding-left: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .nav {
  display: none !important;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .tab[data-tab="help"].active .help-hero {
  display: none !important;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding: max(0px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(0px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .tab[data-tab="help"].active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-v2.help-v2--support-open {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-v2--support-open .help-v2__content {
  flex: 1;
  min-height: 0;
  animation: none;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-chat-screen {
  flex: 1;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-chat-screen--enter.is-expanded {
  max-height: none;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-chat-screen__log {
  min-height: 0;
  max-height: none;
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-chat-screen__top {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .help-chat-screen__composer {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .toast {
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.help-v2__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: helpFade .24s ease both;
}
@keyframes helpFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.help-v2__hero {
  background: var(--hero-shell-bg);
  border: var(--hero-shell-border);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--hero-shell-shadow);
}
.help-v2__hero-title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
}
.help-v2__hero-sub {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.78);
  line-height: 1.4;
  font-weight: 600;
}
.help-v2__hero-actions {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.help-v2__hero-item {
  min-height: 56px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: transform .14s ease, background .18s ease, border-color .18s ease;
}
.help-v2__hero-item:active { transform: scale(.98); }
.help-v2__hero-item.active {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.35);
}
.help-v2__hero-item-title {
  font-size: 14px;
  font-weight: 800;
}
.help-v2__hero-item-sub {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  font-weight: 600;
}
.help-v2__hero-arrow {
  font-size: 18px;
  font-weight: 900;
  color: rgba(255,255,255,.75);
}
.help-v2__section-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--gray4);
  letter-spacing: .2px;
}
.help-v2__ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #ddd6fe;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
}
.help-v2__ticket--open {
  border-color: #a78bfa;
  background: #f5f3ff;
}
.help-v2__ticket-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #7c3aed;
  color: #fff;
}
.help-v2__ticket--open .help-v2__ticket-icon {
  background: #7c3aed;
  color: #fff;
}
.help-v2__ticket-main {
  min-width: 0;
  flex: 1;
}
.help-v2__ticket-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.help-v2__ticket-dot {
  display: none;
}
.help-v2__ticket-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
  min-width: 0;
}
.help-v2__ticket-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.help-v2__ticket-sub {
  margin-top: 3px;
  margin-left: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.3;
}
.help-v2__ticket-btn {
  height: 36px;
  padding: 0 14px;
  flex-shrink: 0;
  font-size: 12px;
  box-shadow: none;
}
.help-v2__faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.help-v2__faq-head {
  padding: 0 2px;
}
.help-v2__faq-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}
.help-v2__faq-hint {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.35;
}
.help-v2__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.help-v2__chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.help-v2__chip:active { transform: scale(.97); }
.help-v2__chip.is-active {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
  box-shadow: none;
}
.help-v2__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
  background: #fff;
  border: 1px solid #ddd6fe;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.06);
}
.help-v2__search-empty {
  text-align: center;
  padding: 16px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.4;
}
.help-v2__list-shell {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.help-v2__support-cta-wrap {
  position: relative;
  margin-bottom: 0;
}
.help-v2__support-pill {
  display: none;
}
.help-v2__support-open {
  height: 56px;
  margin-bottom: 0;
  border-radius: 16px;
}
.help-v2__list-intro {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.35;
  padding: 2px 4px 0;
}
.help-v2__item {
  min-height: 62px;
  width: 100%;
  background: #fff;
  border: none;
  border-bottom: 1px solid #ede9fe;
  border-radius: 0;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: none;
  transition: background .14s ease;
}
.help-v2__item:last-child {
  border-bottom: none;
}
.help-v2__item:active {
  transform: none;
  filter: none;
  background: #f5f3ff;
  border-color: #ede9fe;
  box-shadow: none;
}
.help-v2__item-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.help-v2__item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: #111827;
}
.help-v2__item-sub {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #6d28d9;
  line-height: 1.25;
}
.help-v2__item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.help-v2__item-copy {
  min-width: 0;
  flex: 1;
}
.help-v2__item-index {
  display: none;
}
.help-v2__chev {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  color: #7c3aed;
  background: #ede9fe;
  flex-shrink: 0;
}

/* Guide article */
.help-guide {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 0 8px;
  width: 100%;
  box-sizing: border-box;
}
.help-guide__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help-guide__title {
  margin: 0;
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: #111827;
}
.help-guide__meta-line {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.3;
}
.help-guide__meta,
.help-guide__badge {
  display: none;
}
.help-guide__steps {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
}
.help-guide__step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 16px;
  border-bottom: 1px solid #eef0f3;
}
.help-guide__step:last-child {
  border-bottom: none;
}
.help-guide__num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #7c3aed;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  margin: 0;
}
.help-guide__step-body {
  min-width: 0;
  padding-top: 4px;
}
.help-guide__step-title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
}
.help-guide__step-text {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.45;
}
.help-guide__step-action {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.help-guide__step-action--block {
  width: 100%;
  min-height: 44px;
}
.help-guide__tip {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.help-guide__link-btn {
  display: none;
}
.help-guide__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}
.help-guide__support {
  height: 48px;
  border-radius: 14px;
  font-size: 14px;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
  order: 0;
}
.help-guide__feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  border: none;
  background: transparent;
  order: 1;
}
.help-guide__feedback-q {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  margin: 0;
}
.help-guide__feedback-actions {
  display: contents;
}
.help-guide__feedback-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}
.help-guide__feedback-btn:active {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.help-guide__feedback-done {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
}
.help-v2__card {
  background: var(--white);
  border: 1px solid #e3e5ec;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}
.help-v2__article-title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.2px;
}
.help-v2__article-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-v2__p {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.5;
}
.help-v2__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-v2__step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.help-v2__step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--gray1);
  border: 2px solid var(--gray2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #111827;
  flex-shrink: 0;
  margin-top: 1px;
}
.help-v2__card--router-web {
  margin-bottom: 10px;
  border: 1px solid #dfe3ea;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}
.help-v2__router-steps {
  display: grid;
  gap: 8px;
}
.help-v2__router-step {
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #0f172a;
  box-shadow: inset 3px 0 0 rgba(124,58,237,.18);
}
.help-v2__router-step strong {
  margin-right: 6px;
}
.help-v2__router-grid {
  display: grid;
  gap: 10px;
}
.help-v2__router-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: none;
}
.help-v2__router-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #111827;
}
.help-v2__router-line {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 6px;
}
.help-v2__router-line span {
  color: rgba(255,255,255,.65);
  font-weight: 700;
}
.help-v2__router-line strong,
.help-v2__router-value {
  color: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.help-v2__router-link {
  color: #ddd6fe;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.help-v2__router-link:hover {
  color: #c4b5fd;
}
.help-v2__router-section + .help-v2__router-section {
  margin-top: 10px;
}
.help-v2__router-kv {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.35;
  color: #fff;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
}
.help-v2__router-kv span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}
.help-v2__router-kv strong {
  color: #111827;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.help-v2__qa-link {
  color: #6d28d9;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.help-v2__router-step--accent {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #4c1d95;
  box-shadow: none;
  font-weight: 800;
}
.help-v2__qa-accent {
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 800;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
}
.help-v2__qa-footnote {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
  font-style: italic;
}
.help-v2__inline-action {
  min-height: 48px;
  height: auto;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  padding: 10px 14px;
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.help-v2__support {
  margin-top: 0;
  display: grid;
  gap: 10px;
}
.help-v2__support-title {
  font-size: 14px;
  font-weight: 900;
}
.help-v2__support-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
  line-height: 1.4;
}
.help-v2__tg-secondary {
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  transition: transform .14s ease, background .18s ease;
}
.help-v2__tg-secondary:active {
  transform: scale(.985);
  background: rgba(255,255,255,.15);
}
.help-v2__support-cta {
  background: linear-gradient(160deg, #0f172a 0%, #111827 58%, #1f2937 100%);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(15,23,42,.24);
}
.help-v2__support-cta .help-v2__support-sub {
  color: rgba(255,255,255,.76);
}
.help-v2__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-v2__label {
  font-size: 12px;
  font-weight: 900;
  color: var(--gray4);
}
.help-v2__select,
.help-v2__textarea,
.help-v2__file {
  width: 100%;
  border: 1px solid #dfe3ea;
  border-radius: 16px;
  background: var(--white);
  font-size: 14px;
  font-weight: 700;
  padding: 14px 14px;
  outline: none;
}
.help-v2__select { height: 56px; padding: 0 14px; }
.help-v2__textarea { min-height: 140px; resize: none; font-weight: 600; line-height: 1.45; }
.help-v2__select:focus,
.help-v2__textarea:focus { border-color: rgba(42,171,238,.65); box-shadow: 0 0 0 3px rgba(42,171,238,.14); }
.help-v2__ok {
  background: rgba(22,163,74,.12);
  border: 2px solid rgba(22,163,74,.35);
  color: #166534;
  border-radius: 16px;
  padding: 14px 14px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
}
.help-v2__chat-bot {
  background: var(--gray1);
  border: 1px solid #dde2ea;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.45;
  margin-bottom: 16px;
}
.help-v2__chat-tag {
  display: inline-block;
  margin-bottom: 6px;
  border-radius: 999px;
  border: 1px solid #d5dbe6;
  background: #f8fafc;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  color: #334155;
}

.help-chat-screen {
  min-height: calc(100vh - 260px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid #e3e5ec;
  background: #f4f5f7;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transform-origin: top center;
}
.help-chat-screen--enter {
  transform: translateY(-10px) scaleY(0.78);
  opacity: 0;
  max-height: 0;
}
.help-chat-screen--enter.is-expanded {
  animation: helpSupportExpand .34s cubic-bezier(.2,.9,.25,1) forwards;
}
@keyframes helpSupportExpand {
  from {
    transform: translateY(-10px) scaleY(0.78);
    opacity: 0;
    max-height: 140px;
  }
  to {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    max-height: 1200px;
  }
}

/* Живой чат: фиксируем панель на весь экран, лента растягивается, ввод снизу */
html.help-support-live {
  height: 100%;
  overflow: hidden;
}
html.help-support-live body {
  height: 100%;
  overflow: hidden;
}
html.help-support-live .help-chat-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  max-height: none !important;
  z-index: 220;
  gap: 0;
  transform: none !important;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #f4f5f7;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  animation: helpSupportLiveIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.help-support-live .help-chat-screen--enter {
  opacity: 1;
  transform: none;
  max-height: none !important;
}
html.help-support-live .help-chat-screen--enter.is-expanded {
  animation: none;
}
@keyframes helpSupportLiveIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
html.help-support-live .help-chat-screen__log {
  flex: 1 1 0;
  min-height: 0 !important;
  max-height: none !important;
}
html.help-support-live .help-chat-screen__top,
html.help-support-live .help-chat-screen__closed-banner,
html.help-support-live .help-chat-screen__resolution:not([hidden]),
html.help-support-live .help-chat-screen__files,
html.help-support-live .help-chat-screen__composer {
  flex-shrink: 0;
}

.help-chat-screen__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eceef3;
  background: #fff;
}
.help-chat-screen__top-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.help-chat-screen__avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ede9fe;
  color: #7c3aed;
}
.help-chat-screen__top-copy {
  min-width: 0;
}
.help-chat-screen__top-title {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.help-chat-screen__top-sub {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
.help-chat-screen__close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}
.help-chat-screen__close:active {
  background: #f3f4f6;
}
.help-chat-screen__closed-banner {
  margin: 10px 12px 0;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
}
.help-chat-screen__closed-banner[hidden] {
  display: none !important;
}
.help-closed-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.help-closed-card__glow {
  display: none;
}
.help-closed-card__icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #ede9fe;
  color: #7c3aed;
  border: none;
  box-shadow: none;
}
.help-closed-card__body {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.help-closed-card__title {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 4px;
}
.help-closed-card__text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #6b7280;
}
.help-closed-card__text strong {
  color: #5b21b6;
  font-weight: 800;
}
.help-chat-screen__resolution {
  margin: 0 0 8px;
}
.help-chat-screen__resolution[hidden] {
  display: none !important;
}
.help-resolution-prompt {
  margin: 0 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 14px 16px;
}
.help-resolution-prompt__q {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 12px;
  line-height: 1.35;
}
.help-resolution-prompt__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-resolution-prompt__btn {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.help-resolution-prompt__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.help-resolution-prompt__btn--yes {
  background: var(--violet);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}
.help-resolution-prompt__btn--yes:active:not(:disabled) {
  transform: scale(0.99);
}
.help-resolution-prompt__btn--no {
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.help-resolution-prompt__btn--no:active:not(:disabled) {
  transform: scale(0.99);
  background: #ede9fe;
}
.help-chat-screen__log {
  flex: 1;
  min-height: 320px;
  max-height: calc(100vh - 430px);
  overflow: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 10px;
}
.help-chat-att {
  margin-top: 6px;
  display: block;
  max-width: 100%;
}
.help-chat-att__img {
  display: block;
  max-width: min(100%, 280px);
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e3e5ec;
  object-fit: contain;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.help-support-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  overscroll-behavior: none;
  touch-action: none;
}
.help-support-img-lightbox.is-open {
  /* Подстраховка от «протягивания» скролла под оверлей (iOS / WebView). */
  overscroll-behavior: none;
}
.help-support-img-lightbox[hidden] {
  display: none !important;
}
.help-support-img-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.help-support-img-lightbox__close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.help-support-img-lightbox__close:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.2);
}
.help-support-img-lightbox__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 12px 20px;
  box-sizing: border-box;
  pointer-events: none;
}
.help-support-img-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  cursor: zoom-out;
  -webkit-tap-highlight-color: transparent;
}
html.help-support-img-lightbox-open,
body.help-support-img-lightbox-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.help-chat-att__ph,
.help-chat-att__err {
  font-size: 12px;
  color: #6b7280;
}
.help-chat-att__dl {
  margin-top: 2px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e3e5ec;
  background: #fff;
  color: #5b21b6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.help-chat-screen__files {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 14px 0;
  background: #fff;
}
.help-chat-file-chip {
  position: relative;
  min-width: 84px;
  width: 84px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.help-chat-file-chip__thumb {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.help-chat-file-chip__icon {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: #ede9fe;
}
.help-chat-file-chip__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 15px;
  line-height: 1;
}
.help-chat-file-chip__name {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.help-chat-screen__composer--locked {
  opacity: 0.92;
  pointer-events: none;
}
.help-chat-screen__composer {
  display: block;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eceef3;
  background: #fff;
}
.help-chat-screen__composer-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 4px 4px 4px 4px;
  border-radius: 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.help-chat-screen__input-file {
  display: none;
}
.help-chat-screen__attach {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: #7c3aed;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
}
.help-chat-screen__attach:active {
  background: #ede9fe;
}
.help-chat-screen__message {
  width: 100%;
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  padding: 0 4px;
  outline: none;
  box-shadow: none;
}
.help-chat-screen__message::placeholder {
  color: #9ca3af;
  font-weight: 600;
}
.help-chat-screen__message:focus {
  border: none;
  background: transparent;
}
.help-chat-screen__send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--violet);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: none;
  padding: 0;
}
.help-chat-screen__send:active {
  filter: brightness(0.96);
}
.help-v2__chat-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 86%;
}
.help-v2__chat-row--user {
  align-self: flex-end;
  align-items: flex-end;
}
.help-v2__chat-row--bot {
  align-self: flex-start;
  align-items: flex-start;
}
.help-v2__chat-row--system {
  align-self: center;
  align-items: center;
  max-width: 100%;
  width: 100%;
  margin: 2px 0;
  padding: 0 4px;
}
.help-v2__chat-daysep {
  align-self: center;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}
.help-v2__chat-daysep span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
}
.help-v2__chat-thread-hdr {
  align-self: center;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 6px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: #6b7280;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.help-v2__chat-thread-hdr__label {
  font-weight: 700;
  color: #4b5563;
  margin-right: 4px;
}
.help-v2__chat-thread-hdr__no {
  font-weight: 800;
  color: #7c3aed;
}
.help-v2__chat-thread-hdr__dot {
  margin: 0 5px;
  opacity: 0.45;
}
.help-v2__chat-thread-hdr__dt {
  font-weight: 600;
  color: #6b7280;
}
.help-v2__chat-meta {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: #9ca3af;
  padding: 0 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.help-v2__chat-meta--user {
  justify-content: flex-end;
  color: #9ca3af;
}
.help-v2__chat-meta--bot {
  justify-content: flex-start;
}
.help-v2__chat-meta--system {
  justify-content: center;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}
.help-v2__chat-read {
  font-size: 11px;
  font-weight: 800;
  color: #c4b5fd;
  letter-spacing: -0.06em;
}
.help-v2__chat-read--seen {
  color: #7c3aed;
}
.help-v2__chat-readlabel {
  font-size: 10px;
  font-weight: 600;
  color: #7c3aed;
}
.help-v2__chat-readlabel--muted {
  color: #9ca3af;
}
.help-v2__chat-msg {
  box-sizing: border-box;
  width: max-content;
  max-width: min(300px, calc(100vw - 64px));
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: 0;
  overflow-wrap: normal;
  word-wrap: normal;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
}
.help-v2__chat-msg--user .help-v2__chat-msg__text,
.help-v2__chat-msg--bot .help-v2__chat-msg__text {
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  word-break: normal !important;
  white-space: normal;
}
.help-v2__chat-msg--user {
  align-self: flex-end;
  margin-left: 0;
  color: #fff;
  background: var(--violet);
  border-bottom-right-radius: 6px;
  box-shadow: none;
}
.help-v2__chat-msg--bot {
  align-self: flex-start;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
  box-shadow: none;
}
.help-v2__chat-msg--system {
  align-self: center;
  max-width: min(92%, 340px);
  width: auto;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  color: #4b5563;
  padding: 7px 12px;
  border-radius: 12px;
  background: #eef0f4;
  border: none;
  box-shadow: none;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
}
.help-v2__chat-msg__text--system {
  display: block;
}

/* removed legacy support block in Help */

/* ========= BOTTOM NAV (mobile: плавающий dock) ========= */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: auto;
  min-height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 14px calc(10px + var(--safe-b));
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  z-index: 100;
  pointer-events: none;
}
.nav-items {
  flex: 1;
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  position: relative;
  padding: 5px;
  border-radius: 24px;
  background: rgba(20, 19, 28, 0.9);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.05) inset;
}
.nav__glider {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.34) 0%, rgba(109, 40, 217, 0.24) 100%);
  border: 1px solid rgba(167, 139, 250, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 18px rgba(124, 58, 237, 0.28);
  transition: opacity 0.2s ease;
  will-change: transform, opacity;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
}
.nav__glider.is-settled,
.nav__glider.is-flowing {
  opacity: 1;
}
.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 4px 7px;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, transform 0.12s ease;
}
.nav__item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.86;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}
.nav__item-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
  padding: 0 2px;
}
.nav__item.active {
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.nav__item.active svg {
  opacity: 1;
  color: #ddd6fe;
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 8px rgba(167, 139, 250, 0.42));
}
.nav__item.active .nav__item-label {
  font-weight: 800;
  color: #fff;
}
.nav__item:active:not(.active) {
  transform: scale(0.96);
}
.nav__item--multiline .nav__item-label {
  line-height: 1.2;
  text-align: center;
}
.nav__blocked-stack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 20px;
  margin-top: 9px;
  flex-shrink: 0;
}
.nav__blocked-stack svg {
  display: block;
}
.nav__blocked-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
}
.nav__soon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 45%, #5b21b6 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 2px 10px rgba(91, 33, 182, 0.5);
  flex-shrink: 0;
}
.nav__soon-badge--tab {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 1px;
  font-size: 7px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.nav__soon-badge--rail {
  display: none;
  font-size: 10px;
  padding: 4px 10px;
  letter-spacing: 0.05em;
}
.nav__item--blocked,
.nav__item--blocked:disabled {
  pointer-events: none;
  cursor: not-allowed;
}
.nav__item--blocked .nav__blocked-stack svg,
.nav__item--blocked .nav__item-label {
  opacity: 0.45;
  filter: grayscale(0.32);
}

.nav-mascot {
  display: none;
  flex-shrink: 0;
  text-align: center;
  margin: 0 0 10px;
}
.nav-mascot picture {
  display: block;
  margin: 0 auto;
}
.nav-mascot__img {
  width: 100px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(124,58,237,.3));
  pointer-events: none;
}

.nav-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
/* Полный логотип, ~половина ширины колонки — пропорции исходника */
.nav-brand__logo {
  display: block;
  width: 50%;
  max-width: 50%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(167,139,250,.22));
}
.nav-brand__sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: none;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1;
  max-width: 100%;
  padding: 0 4px;
}
.nav-brand__sub-part {
  display: inline-block;
  line-height: 1.2;
}
.nav-brand__sub-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.4em;
  font-size: 0.55em;
  line-height: 1;
  font-weight: 700;
  color: rgba(255,255,255,.38);
  transform: translateY(-0.06em);
}
/* ========= OVERLAY ========= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 1;
  transition: opacity .2s;
}
.overlay[hidden] { display: none; }

/* ========= BOTTOM SHEET ========= */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: var(--app-w);
  margin: 0 auto;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
  /* Крестик и шапка: не под динамический UI браузера / вырез (svh + safe-area + буфер) */
  padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 10px));
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(var(--safe-b) + 16px);
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 36px);
  max-height: min(92dvh, calc(100svh - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 300;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.sheet.open { transform: translateY(0); }
.sheet__bar {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--gray2);
  margin: 4px auto 0;
  flex-shrink: 0;
  touch-action: none;
  cursor: grab;
}
.sheet__bar:active {
  cursor: grabbing;
}
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 16px;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sheet__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.2px;
  line-height: 1.1;
}
.sheet__sub {
  font-size: 12px;
  color: var(--gray4);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.1px;
}
.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gray1);
  display: grid;
  place-items: center;
  color: var(--gray4);
  flex-shrink: 0;
}
.close-btn:active { background: var(--gray2); }
.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet__divider {
  height: 1px;
  background: var(--gray2);
  margin: 6px 0;
}
.sheet__actions-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

/* ========= META ROWS ========= */
.meta {
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 4px 0;
}
.meta__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}
.meta__row + .meta__row {
  border-top: 1px solid var(--gray2);
}
.meta__k {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray4);
  letter-spacing: 0.1px;
}
.meta__v {
  font-size: 13px;
  font-weight: 700;
}
.meta__row--until {
  align-items: flex-start;
}
.meta__v--until {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  max-width: min(100%, 220px);
  font-weight: 500;
  text-align: right;
  line-height: 1.35;
}
.meta__until-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray4);
  letter-spacing: 0.01em;
}
.meta__until-countdown {
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.meta__until-countdown[hidden] {
  display: none !important;
}
.meta__until-countdown--urgent {
  color: #c2410c;
}
.meta__until-countdown--expired {
  color: var(--red);
}
.meta__v--copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background .15s;
}
.meta__v--copy { font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif; }
.meta__v--copy svg { opacity: .4; flex-shrink: 0; }
.meta__v--copy:hover { background: var(--gray2); }
.meta__v--copy:active { background: var(--gray2); transform: scale(.97); }
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(34,197,94,.12);
  color: var(--green);
}
.status-badge.paused {
  background: rgba(239,68,68,.1);
  color: var(--red);
}
.status-badge.lifetime {
  background: rgba(124,58,237,.14);
  color: #6d28d9;
}

/* ========= ACTIVATE SHEET ========= */
.sheet--activate .sheet__body {
  gap: 14px;
}
.sheet--activate.is-activating .activate-instruction,
.sheet--activate.is-activating .mac-input-wrap,
.sheet--activate.is-activating #submitActivate {
  display: none;
}
.activate-instruction {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray1);
}
.activate-instruction__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}
@media (min-width: 900px) {
  .sheet--activate .activate-instruction__img {
    max-height: 520px;
    object-fit: contain;
    object-position: top center;
    background: #fff;
  }
  .section-sub--collapse {
    font-size: 14px;
    line-height: 1.35;
  }
}
/* Компактный статус активации — в духе profile-tg-banner */
.activate-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--gray2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.activate-progress[hidden] {
  display: none !important;
}
.activate-progress__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.activate-progress__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--violet-light);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.activate-progress__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(124, 58, 237, 0.22);
  border-top-color: var(--violet);
  animation: activateSpin 0.75s linear infinite;
}
.activate-progress.is-done .activate-progress__spinner {
  animation: none;
  border-color: transparent;
  background: var(--violet);
  box-shadow: inset 0 0 0 2px var(--violet-light);
  position: relative;
}
.activate-progress.is-done .activate-progress__spinner::after {
  content: "";
  position: absolute;
  inset: 3px 5px 5px 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
@keyframes activateSpin {
  to { transform: rotate(360deg); }
}
.activate-progress__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.activate-progress__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--black);
}
.activate-progress__status {
  margin: 0;
  min-height: 1.35em;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray4);
  line-height: 1.35;
  transition: opacity .2s ease;
}
.activate-progress__status.is-fading {
  opacity: 0;
}
.activate-progress__pct {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--violet);
  background: var(--violet-light);
  font-variant-numeric: tabular-nums;
}
.activate-progress__track {
  height: 6px;
  border-radius: 999px;
  background: var(--gray1);
  overflow: hidden;
}
.activate-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
  transition: width .4s ease-out;
}
.mac-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mac-input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray4);
  letter-spacing: 0.1px;
}
.mac-input {
  height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray2);
  background: var(--white);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--black);
  outline: none;
  transition: border-color .15s;
  text-transform: uppercase;
}
.mac-input::placeholder {
  color: var(--gray3);
  font-weight: 500;
  letter-spacing: 1.5px;
}
.mac-input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

/* ========= CONFIRM NOTICE ========= */
.confirm-notice {
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 18px;
}
.confirm-notice__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 10px;
}
.confirm-notice__hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray4);
  line-height: 1.5;
}

/* ========= REFERRAL TAB ========= */
.referral-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}
.referral-hero .greeting-card__title {
  margin: 0;
}
.referral-hero__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 4px;
}
.referral-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ref-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}
.ref-stat-pill--accent {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(124, 58, 237, 0.22));
  border-color: rgba(255, 255, 255, 0.22);
}
.ref-stat-pill__k {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}
.ref-stat-pill__v {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #fff;
}

/* Карточка-ссылка на сайт */
.ref-site-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--white);
  border: 2px solid var(--gray2);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.ref-site-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12);
}
.ref-site-card:active {
  transform: translateY(1px);
}
.ref-site-card:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35);
}
.ref-site-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ede9fe, #f5f3ff);
  color: var(--violet);
}
.ref-site-card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ref-site-card__title {
  font-weight: 800;
  font-size: 14px;
  color: var(--black);
}
.ref-site-card__url {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
}
.ref-site-card__go {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--violet);
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--violet-light);
}

.referral-how {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.05);
}
.referral-how__heading {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--black);
  margin: 0 0 16px;
}
.ref-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ref-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  position: relative;
}
.ref-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 44px;
  bottom: -2px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.35), rgba(124, 58, 237, 0.08));
}
.ref-step__num {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(145deg, #8b5cf6 0%, #6d28d9 55%, #5b21b6 100%);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
  flex-shrink: 0;
}
.ref-step__text {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #1f2937;
}

.ref-share-grid {
  display: grid;
  gap: 12px;
}
.ref-code-panel {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
.ref-code-panel__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray4);
  margin-bottom: 10px;
}
.ref-code-panel__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray1);
  border: 1px solid var(--gray2);
}
.ref-code-panel__code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--black);
  background: none;
}
.ref-code-panel__copy {
  margin-left: 0;
  flex-shrink: 0;
}

.ref-link-panel {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
.ref-link-panel__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray4);
  margin-bottom: 8px;
}
.ref-link-panel__url {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}
.ref-link-panel__a {
  color: var(--violet);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 58, 237, 0.35);
}
.ref-link-panel__a:active {
  opacity: 0.85;
}
.ref-link-panel__btn {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: 2px solid var(--gray2);
  background: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--black);
  transition: border-color 0.15s, background 0.15s;
}
.ref-link-panel__btn:active {
  background: var(--gray1);
}
.ref-link-panel__btn.copy-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

@media (min-width: 640px) {
  .ref-share-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .ref-link-panel {
    display: flex;
    flex-direction: column;
  }
  .ref-link-panel__btn {
    margin-top: auto;
  }
}
.ref-inline-percent {
  font-weight: 900;
  color: var(--violet);
}
.invite-link {
  color: #f472b6;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.invite-link:active { opacity: .8; }
.invite-link--mono-dark {
  color: #111827;
  font-weight: 800;
  text-decoration-color: rgba(17,24,39,.35);
}
.ref-payout {
  position: relative;
  margin-top: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f172a 0%, #111827 55%, #1f2937 100%);
  border: 1px solid #1f2937;
  box-shadow: 0 10px 24px rgba(15,23,42,.24);
  padding: 14px 16px;
}
.ref-payout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ref-payout__label {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.ref-payout__value {
  margin-top: 2px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  color: #fff;
}
.ref-payout__hint {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}
.ref-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
}
.ref-info-btn:active {
  transform: scale(.96);
}
.ref-info-pop {
  position: absolute;
  top: 42px;
  right: 16px;
  width: min(260px, calc(100% - 32px));
  background: #fff;
  color: #111827;
  border: 1px solid var(--gray2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 12px 26px rgba(2,6,23,.25);
  z-index: 3;
}

/* ========= WIZARD STEPS ========= */
.sheet--connect .sheet__body {
  overflow: hidden;
  gap: 12px;
}
.sheet--connect .wiz-progress {
  flex-shrink: 0;
}
.wiz-step { display: none; flex-direction: column; gap: 14px; }
.wiz-step.active { display: flex; }
.sheet--connect .wiz-step.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.wiz-step[data-step="1"] { gap: 14px; }
.sheet--connect .wiz-step[data-step="1"] .wiz-tariff-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet--connect .wiz-step[data-step="1"] .pay-tariff-btn {
  flex-shrink: 0;
  margin-top: auto;
}
.sheet--connect .wiz-step[data-step="2"] .wiz-options,
.sheet--connect .wiz-step[data-step="3"] .wiz-options,
.sheet--connect .wiz-step[data-step="4"] .wiz-summary {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet--connect .wiz-step .accent-btn.w-full {
  flex-shrink: 0;
  margin-top: auto;
}
.wiz-server-msg {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
  line-height: 1.4;
}
.wiz-server-msg--error { color: #b42318; }

/* Wizard progress */
.wiz-progress {
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--gray2);
}
.wiz-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.wiz-progress__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: 0.2px;
}
.wiz-progress__hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray4);
}
.wiz-progress__dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.wiz-dot {
  height: 6px;
  border-radius: 999px;
  background: #d7d9df;
}
.wiz-dot.active {
  background: var(--violet);
  box-shadow: 0 6px 18px rgba(124,58,237,.25);
}

/* Тарифы в мастере: вертикальный список (как в макете), стиль Resilix */
.wiz-tariff-panel {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}
.tariff-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tariff-grid__empty {
  margin: 0;
  padding: 12px 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--gray5, #666);
  text-align: center;
}
.tariff-card {
  position: relative;
  width: 100%;
  min-height: 0;
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: 14px;
  padding: 14px 14px 14px 16px;
  text-align: left;
  color: var(--black);
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-sizing: border-box;
}
.tariff-card__body {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.tariff-card__info {
  flex: 1;
  min-width: 0;
}
.tariff-card__period {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--black);
}
.tariff-card__equiv {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray4);
}
.tariff-card__equiv[hidden] {
  display: none;
}
.tariff-card__price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.tariff-card__total {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}
.tariff-card__list {
  font-size: 12px;
  font-weight: 600;
  text-decoration: line-through;
  color: var(--gray4);
  line-height: 1.1;
}
.tariff-card__check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
  opacity: 0;
  transform: scale(.92);
  transition: opacity .15s, transform .15s;
}
.tariff-card.selected {
  border-color: var(--violet);
  background: var(--violet-light);
  box-shadow: 0 4px 16px rgba(124,58,237,.12);
}
.tariff-card.selected .tariff-card__check {
  opacity: 1;
  transform: scale(1);
}
.tariff-card__badge--hit {
  position: absolute;
  top: -9px;
  left: 14px;
  z-index: 1;
  padding: 3px 8px;
  background: var(--violet);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 7px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  box-shadow: 0 4px 10px rgba(124,58,237,.25);
}
.tariff-card__badge--best {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 1;
  padding: 3px 8px;
  background: rgba(124,58,237,.1);
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  line-height: 1.2;
}
.tariff-card:has(.tariff-card__badge--best) {
  padding-bottom: 30px;
}
.tariff-card:active:not(.tariff-card--short) {
  transform: translateY(1px);
}

.tariff-short {
  margin-top: 2px;
}
.tariff-short__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed var(--gray2);
  border-radius: 14px;
  background: var(--white);
  box-sizing: border-box;
}
.tariff-short__label {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
  line-height: 1.3;
}
.tariff-short__opts {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
}
.tariff-short__sep {
  color: var(--gray3);
  font-weight: 600;
  user-select: none;
}
.tariff-card--short {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.tariff-card--short.selected {
  color: var(--violet);
  background: none;
  border: none;
  box-shadow: none;
}
.tariff-card--short:active {
  opacity: .75;
}
.tariff-short__chev {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--gray4);
  opacity: .85;
}

.pay-tariff-btn__old {
  text-decoration: line-through;
  opacity: .72;
  font-weight: 600;
  margin-right: 2px;
}

/* Способ оплаты выбирается на странице PaymentService (/pay/renew) */
.sheet--connect .pay-method-label,
.sheet--connect #payMethodList {
  display: none;
}

.pay-method-label {
  margin: 14px 0 6px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray4);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.pay-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray2);
  background: var(--white);
  background-image: none;
  color: var(--black);
  transition: border-color .15s, background .15s, background-color .15s, box-shadow .15s, color .15s;
}
/* Двойной класс — явная заливка выбранного способа (не только обводка) */
.pay-method.pay-method--selected {
  border-color: rgba(255,255,255,.2);
  background-color: #6d28d9;
  background-image: linear-gradient(145deg, #8b5cf6 0%, #6d28d9 55%, #5b21b6 100%);
  box-shadow: 0 6px 18px rgba(109,40,217,.28);
  color: #fff;
}
.pay-method.pay-method--selected .pay-method__title {
  color: #fff;
}
.pay-method.pay-method--selected .pay-method__sub {
  color: rgba(255,255,255,.85);
}
.pay-method.pay-method--selected .pay-method__mark {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.pay-method__marks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.pay-method__mark {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--gray1);
  color: var(--gray4);
  border: 1px solid var(--gray2);
  line-height: 1;
}
.pay-method__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pay-method__title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.pay-method__sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4);
}

.pay-tariff-btn {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  background: var(--violet);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  box-shadow: 0 6px 20px rgba(124,58,237,.28);
  box-sizing: border-box;
}
.pay-tariff-btn:disabled {
  opacity: .45;
  box-shadow: none;
  cursor: not-allowed;
}
.pay-tariff-btn:disabled .pay-tariff-btn__icon {
  opacity: .6;
}
.pay-tariff-btn__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .95;
}
.pay-tariff-btn__center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-tariff-btn__lead {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.pay-tariff-btn__sum {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pay-tariff-btn__term {
  font-size: 13px;
  font-weight: 700;
  opacity: .88;
  white-space: nowrap;
}
.pay-tariff-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(124,58,237,.2);
}

/* Wizard options (server, protocol) */
.wiz-options { display: flex; flex-direction: column; gap: 10px; }
.wiz-option {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.wiz-option.selected {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.wiz-option:active { transform: translateY(1px); }
.wiz-option__flag { font-size: 24px; line-height: 1; }
.wiz-option__icon { color: var(--violet); display: flex; }
.wiz-option__col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-items: flex-start;
}
.wiz-option__label { font-weight: 700; font-size: 15px; }
.wiz-option__desc {
  font-size: 12px;
  font-weight: 600;
  color: var(--violet);
  line-height: 1.3;
}

/* Wizard summary */
.wiz-summary {
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 6px 0;
}
.wiz-summary__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
}
.wiz-summary__row + .wiz-summary__row {
  border-top: 1px solid var(--gray2);
}
.wiz-check { flex-shrink: 0; }

/* Disabled button */
.accent-btn:disabled {
  opacity: .45;
  pointer-events: none;
}

/* ========= TOAST ========= */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  white-space: nowrap;
}
.toast[hidden] { display: none; }

/* ========= DESKTOP CONSTRAINT ========= */
@media (min-width: 480px) {
  .nav {
    max-width: var(--app-w);
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========= DESKTOP WEB MODE ========= */
@media (min-width: 900px) {
  :root {
    --app-w: min(1180px, calc(100vw - 56px));
    --nav-rail-w: 260px;
  }

  body {
    background:
      radial-gradient(900px 520px at 6% -10%, rgba(124,58,237,.11), transparent 65%),
      radial-gradient(760px 460px at 92% 108%, rgba(17,24,39,.09), transparent 68%),
      var(--bg);
    padding: 20px 28px 20px 0;
  }

  .app-shell {
    min-height: 100vh;
    padding-left: var(--nav-rail-w);
    box-sizing: border-box;
  }

  .app {
    min-height: calc(100vh - 40px);
    display: block;
    max-width: min(1180px, calc(100vw - var(--nav-rail-w) - 56px));
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    border-radius: 30px;
    background: rgba(255,255,255,.78);
    box-shadow:
      0 28px 64px rgba(15,23,42,.14),
      0 2px 0 rgba(255,255,255,.55) inset;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .app-main {
    flex: 1;
    min-width: 0;
  }

  .tab.active { display: block; }

  .greeting-card__title,
  .cfg-hero__title,
  .help-hero__title {
    font-size: 42px;
    line-height: 1.08;
    letter-spacing: -0.45px;
    max-width: 100%;
  }

  .greeting-card--profile .greeting-card__title {
    font-size: 26px;
    line-height: 1.14;
    letter-spacing: -0.03em;
  }
  .greeting-card--profile {
    padding: 20px 22px;
    border-radius: 24px;
  }
  .greeting-card--profile .greeting-card__hello {
    font-size: 14px;
  }
  .greeting-card--profile .greeting-card__sub {
    font-size: 13px;
    margin-top: 6px;
  }
  .profile-avatar {
    width: 64px;
    height: 64px;
  }
  .profile-avatar__initials {
    font-size: 19px;
  }

  .greeting-card__sub,
  .cfg-hero__sub,
  .help-hero__sub {
    font-size: 14px;
    margin-top: 10px;
  }

  .hero-mascot {
    width: 120px;
    height: 120px;
    margin: -8px -4px -8px 0;
  }

  .hero-mascot--referral {
    width: 146px;
    height: 120px;
    margin: -8px -6px -8px 0;
  }

  .hero-mascot--servers {
    width: 96px;
    height: 96px;
  }

  .profile-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .profile-tools > .promo-countdown {
    width: 100%;
  }
  .promo-countdown__body {
    gap: 20px 28px;
    align-items: center;
  }
  .promo-countdown__lead {
    max-width: 320px;
  }
  .promo-countdown__timer {
    width: auto;
    min-width: 128px;
    padding: 4px 0 4px 22px;
  }
  .promo-countdown__days-num {
    font-size: 38px;
  }
  .promo-countdown__clock {
    font-size: 17px;
  }
  .profile-tg-banner.profile-card {
    padding: 16px 18px;
  }
  .id-row-card.profile-card {
    padding: 14px 16px;
  }
  .id-row__value {
    font-size: 12px;
  }

  .nav-mascot {
    display: block;
  }

  .nav-brand {
    display: flex;
  }

  .nav-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    flex: 1;
    position: static;
    min-height: 0;
    overflow-y: hidden;
    padding: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    pointer-events: auto;
  }
  .nav__glider {
    display: none;
  }

  .nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: auto;
    transform: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    width: var(--nav-rail-w);
    flex-shrink: 0;
    margin-bottom: 0;
    padding: 20px 14px 24px;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    border: none;
    border-radius: 0;
    border-right: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(180deg, #2d2b3d 0%, #1f1d2b 38%, #14131c 100%);
    box-shadow: 12px 0 40px rgba(0,0,0,.28);
    z-index: 40;
    overflow: hidden;
    pointer-events: auto;
  }

  .nav-mascot__img {
    max-height: min(112px, 22vh);
  }

  .nav__item {
    flex: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 48px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,.72);
    letter-spacing: 0.02px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    position: relative;
    overflow: visible;
  }

  .nav__item::before {
    display: none;
  }

  .nav__item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .88;
  }

  .nav__item.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.92) 0%, rgba(109, 40, 217, 0.88) 100%);
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.32);
  }

  .nav__item.active svg {
    opacity: 1;
    color: inherit;
    transform: none;
    filter: none;
  }

  .nav__item.active .nav__item-label {
    font-weight: 700;
  }

  .nav__item.active::before {
    display: none;
  }

  .nav__item--multiline .nav__item-label {
    text-align: left;
    line-height: 1.15;
  }

  .nav__blocked-stack {
    position: static;
    width: auto;
    height: auto;
    margin-top: 0;
    flex-shrink: 0;
  }

  .nav__soon-badge--tab {
    position: static;
    transform: none;
    margin-bottom: 0;
  }

  .nav__blocked-stack svg {
    display: block;
  }

  .nav__blocked-end {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
  }

  .nav__soon-badge--tab {
    display: none;
  }

  .nav__soon-badge--rail {
    display: inline-flex;
    margin-left: auto;
  }

  .nav__item:hover:not(.active):not(.nav__item--blocked):not(:disabled) {
    background: rgba(255,255,255,.08);
  }

  .nav__item--blocked,
  .nav__item--blocked:disabled {
    pointer-events: none;
    cursor: not-allowed;
  }

  .nav__item--blocked .nav__blocked-stack svg,
  .nav__item--blocked .nav__item-label {
    opacity: 0.42;
    filter: grayscale(0.4);
  }

  .toast {
    bottom: 24px;
  }

  #routerList:not(:has(.router-grid-view)),
  #thirdPartyList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .profile-collapse--grid-routers #routerList {
    display: block;
  }

  .router-card,
  .router-card--draft {
    margin-bottom: 0;
    min-height: 184px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .router-card__info {
    width: 100%;
  }

  .router-card__name {
    font-size: 20px;
    line-height: 1.16;
    letter-spacing: -0.2px;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .router-card__pills {
    margin-top: 12px;
    gap: 8px;
  }

  .router-card .pill {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
  }

  .router-card__arrow {
    margin-top: auto;
    align-self: flex-end;
  }

  .router-card__cfg-updated {
    top: 10px;
    right: 10px;
  }

  .sheet {
    max-width: min(760px, calc(100vw - 120px));
    border-top: 1px solid rgba(226,232,240,.9);
    box-shadow: 0 -10px 30px rgba(15,23,42,.12);
  }

  /* Поверх правил десктопного .app / .tab — полноэкранный чат поддержки */
  body:has(.tab[data-tab="help"].active .help-v2--support-open) {
    padding: 0;
    background: #f4f5f7;
  }
  .app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) {
    padding-left: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  .app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding: max(0px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(0px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .app-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .app-shell:has(.tab[data-tab="help"].active .help-v2--support-open) .tab[data-tab="help"].active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
}

@media (min-width: 1320px) {
  #routerList:not(:has(.router-grid-view)),
  #thirdPartyList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ========= FIRST-VISIT ONBOARDING ========= */
.onboard {
  position: fixed;
  inset: 0;
  z-index: 420;
  pointer-events: none;
}
.onboard:not([hidden]) {
  pointer-events: auto;
}
.onboard[hidden] {
  display: none !important;
}
.onboard__dim {
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 1;
}
.onboard__spot {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 16px;
  box-shadow:
    0 0 0 9999px rgba(10, 8, 20, 0.58),
    0 0 0 3px rgba(167, 139, 250, 0.95),
    0 0 28px 4px rgba(124, 58, 237, 0.45);
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition:
    left 0.38s cubic-bezier(.22,1,.36,1),
    top 0.38s cubic-bezier(.22,1,.36,1),
    width 0.38s cubic-bezier(.22,1,.36,1),
    height 0.38s cubic-bezier(.22,1,.36,1),
    border-radius 0.3s ease,
    opacity 0.25s ease,
    transform 0.38s cubic-bezier(.22,1,.36,1);
  z-index: 1;
}
.onboard.is-ready .onboard__spot {
  opacity: 1;
  transform: scale(1);
  animation: onboard-pulse 1.8s ease-in-out infinite;
}
.onboard.is-moving .onboard__spot {
  animation: none;
}
@keyframes onboard-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 9999px rgba(10, 8, 20, 0.58),
      0 0 0 3px rgba(167, 139, 250, 0.95),
      0 0 24px 2px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 9999px rgba(10, 8, 20, 0.58),
      0 0 0 5px rgba(196, 181, 253, 1),
      0 0 36px 8px rgba(124, 58, 237, 0.55);
  }
}
.onboard__card {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  z-index: 2;
  max-width: 400px;
  margin: 0 auto;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.3s ease,
    transform 0.38s cubic-bezier(.22,1,.36,1),
    top 0.38s cubic-bezier(.22,1,.36,1),
    bottom 0.38s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
}
.onboard.is-ready .onboard__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.onboard__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.onboard__step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
  background: var(--violet-light);
  padding: 4px 9px;
  border-radius: 999px;
}
.onboard__skip {
  border: none;
  background: transparent;
  color: var(--gray4);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.onboard__skip:active {
  color: var(--black);
}
.onboard__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: linear-gradient(145deg, #ede9fe 0%, #ddd6fe 100%);
  color: var(--violet);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.12);
}
.onboard__icon svg {
  display: block;
}
.onboard__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--black);
}
.onboard__text {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
  color: var(--gray4);
}
.onboard__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.onboard__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gray2);
  transition: width 0.25s ease, background 0.25s ease;
}
.onboard__dot.is-active {
  width: 18px;
  background: var(--violet);
}
.onboard__next {
  min-height: 46px;
  border-radius: 999px;
}
body.onboard-lock {
  overflow: hidden;
}
.onboard-target-glow {
  position: relative;
  z-index: 421 !important;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.85), 0 8px 24px rgba(124, 58, 237, 0.28) !important;
  animation: onboard-target-breathe 1.8s ease-in-out infinite;
}
@keyframes onboard-target-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

@media (min-width: 900px) {
  .onboard__card {
    left: calc(var(--nav-rail-w, 260px) + 24px);
    right: auto;
    bottom: 28px;
    width: min(400px, calc(100vw - var(--nav-rail-w, 260px) - 64px));
  }
}
