/* ========= 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: 80px;
  --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);
}

/* ========= 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; }

/* ========= 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) + 24px);
  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; }

/* ========= 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__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;
}
/* Маскот справа — один квадрат для всех вкладок, картинки масштабируются одинаково */
.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__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;
}
/* ========= ID ROW ========= */
.id-row {
  margin-top: 12px;
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.id-row__label {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray4);
}
.id-row__value {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.2px;
}
.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: 18px auto 0;
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray4);
  letter-spacing: 0.2px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--gray2);
  background: rgba(255,255,255,.55);
}
.history-btn:active { background: rgba(255,255,255,.9); }

/* ========= 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%; }
.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;
}

/* ========= 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);
}
.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%;
}

/* Hero header — в стиле бокового меню */
.cfg-hero {
  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);
}
.cfg-hero__body { flex: 1; min-width: 0; }
.cfg-hero__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;
}
.cfg-hero__sub {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.2px;
}
/* Длинная инструкция под шапкой «Сервера» */
.cfg-below-hero {
  margin: 12px 0 22px;
  padding: 0 2px;
}
.cfg-below-hero__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--gray4);
  letter-spacing: 0.02px;
}
/* История конфигураций — внизу страницы «Сервера», второстепенный вид */
.cfg-history-footer {
  margin-top: 28px;
  padding-top: 18px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.cfg-history-btn {
  width: auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gray4);
  background: transparent;
  border: none;
  border-radius: 8px;
  opacity: 0.82;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, opacity .18s ease, background .18s ease;
}
.cfg-history-btn:hover {
  color: var(--black);
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}
.cfg-history-btn:active {
  opacity: 0.9;
}
.cfg-history-btn svg {
  flex-shrink: 0;
  opacity: 0.75;
}
.cfg-history-btn:hover svg {
  opacity: 1;
}

/* Кнопка скачать конфиг — светящаяся оранжевая */
.cfg-download-block {
  margin-top: 16px;
  animation: cfgDownloadAppear .4s ease both;
}
@keyframes cfgDownloadAppear {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cfg-download-btn {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(234,88,12,.4), 0 0 30px rgba(249,115,22,.25);
  animation: cfgDownloadGlow 2s ease-in-out infinite;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cfg-download-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(234,88,12,.5), 0 0 40px rgba(249,115,22,.35); }
.cfg-download-btn:active { transform: translateY(0); }
@keyframes cfgDownloadGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(234,88,12,.4), 0 0 30px rgba(249,115,22,.25); }
  50% { box-shadow: 0 6px 28px rgba(234,88,12,.55), 0 0 45px rgba(249,115,22,.4); }
}
.cfg-download__hint {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gray4);
  font-weight: 500;
}

/* Sections */
.cfg-section {
  margin-top: 24px;
}
.cfg-section__eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.cfg-section__title {
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 400;
  color: var(--black);
  letter-spacing: -0.35px;
  line-height: 1.08;
  margin-bottom: 12px;
}
.cfg-select {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color .18s ease, background-color .18s ease;
}
.cfg-select:hover { border-color: var(--gray3); }
.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: 14px;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(234,88,12,.08) 0%, rgba(249,115,22,.06) 100%);
  border: 2px solid rgba(234,88,12,.25);
  border-radius: var(--radius-sm);
}
.cfg-expired-banner__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(234,88,12,.15);
  border-radius: 12px;
  color: #c2410c;
}
.cfg-expired-banner__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #9a3412;
  font-weight: 600;
}

/* 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: 130px;
  padding: 18px 12px;
  text-align: center;
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s 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__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 block — показывается только после полного выбора */
.cfg-summary-block {
  margin-top: 24px;
}
.cfg-summary-card {
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(15,23,42,.04);
}
.cfg-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.cfg-summary__row:not(:last-child) {
  border-bottom: 1px solid var(--gray2);
}
.cfg-summary__row--edit {
  flex-wrap: wrap;
}
.cfg-summary__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray4);
}
.cfg-summary__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
}
.cfg-summary__link {
  font-size: 14px;
  font-weight: 700;
  color: var(--violet);
  padding: 6px 0;
  width: 100%;
  text-align: right;
}
.cfg-summary__link:hover { text-decoration: underline; }
.cfg-summary__link:active { opacity: .8; }

/* CTA */
.cfg-cta {
  height: 52px;
  font-size: 15px;
  font-weight: 700;
}
.cfg-cta:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Confirm modal */
.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: 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);
  margin-bottom: 16px;
}
.help-hero__back {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 2px 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: 30px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
  white-space: normal;
  word-wrap: break-word;
}
.help-hero__sub {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.2px;
}
.help-hero__sub[hidden] { display: none; }
.help-v2 {
  margin-top: 0;
}
.help-v2__content {
  display: flex;
  flex-direction: column;
  gap: 24px; /* section spacing */
  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__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.help-v2__list-shell {
  background: var(--white);
  border: 1px solid #e3e5ec;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.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: 64px;
  width: 100%;
  background: linear-gradient(160deg, #171627 0%, #111827 60%, #1f2937 100%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: 0 12px 22px rgba(15,23,42,.17);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease;
}
.help-v2__item:active {
  transform: scale(.985);
  filter: brightness(1.04);
  box-shadow: 0 8px 16px rgba(15,23,42,.2);
}
.help-v2__item--support {
  border-color: rgba(124,58,237,.35);
  background: linear-gradient(180deg, rgba(124,58,237,.08) 0%, rgba(124,58,237,.03) 100%);
  box-shadow: 0 8px 18px rgba(124,58,237,.12);
}
.help-v2__item--support .help-v2__item-title {
  color: #4c1d95;
}
.help-v2__item--support .help-v2__chev {
  color: #6d28d9;
}
.help-v2__support-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #7c3aed;
  box-shadow: 0 6px 14px rgba(124,58,237,.3);
  flex-shrink: 0;
}
.help-v2__item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}
.help-v2__item-sub {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.68);
  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;
}
.help-v2__item-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: #ede9fe;
  background: rgba(124,58,237,.35);
  border: 1px solid rgba(196,181,253,.35);
  flex-shrink: 0;
}
.help-v2__chev {
  font-size: 20px;
  font-weight: 900;
  color: #c4b5fd;
}
.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: linear-gradient(160deg, #171627 0%, #111827 60%, #1f2937 100%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 22px rgba(15,23,42,.18);
}
.help-v2__router-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}
.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: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 800;
}
.help-v2__router-kv strong {
  color: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.help-v2__qa-link {
  color: #ddd6fe;
  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-msg {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.help-v2__chat-msg--user {
  border-color: rgba(99,102,241,.25);
  background: #f8faff;
}
.help-v2__chat-msg--bot {
  border-color: #e2e8f0;
  background: #fff;
}
.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;
}

/* removed legacy support block in Help */

/* ========= BOTTOM NAV ========= */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 12px var(--safe-b);
  background: linear-gradient(180deg, rgba(255,255,255,.64) 0%, rgba(255,255,255,.8) 100%);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-top: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 -10px 24px rgba(15,23,42,.08);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 100;
}
.nav-items {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.nav__glider {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 14px;
  background: rgba(124,58,237,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 8px 18px rgba(124,58,237,.22);
  transition: opacity .18s ease;
  will-change: transform, opacity;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
}
.nav__glider.is-flowing {
  opacity: .92;
}
.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  border-radius: 14px;
  color: var(--gray3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color .15s, background .15s, box-shadow .15s, transform .12s;
}
.nav__item.active {
  color: var(--violet);
  background: rgba(124,58,237,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 12px rgba(124,58,237,.14);
}
.nav__item:active {
  transform: translateY(1px);
}
.nav__item--multiline span {
  line-height: 1.2;
  text-align: center;
}

.nav-mascot {
  display: none;
  flex-shrink: 0;
  text-align: center;
  margin: 0 0 10px;
}
.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);
  padding: 0 20px calc(var(--safe-b) + 16px);
  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: 10px 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: 16px 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: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray1);
  display: grid;
  place-items: center;
  color: var(--gray4);
}
.close-btn:active { background: var(--gray2); }
.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.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__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);
}

/* ========= ACTIVATE SHEET ========= */
.sheet--activate .sheet__body {
  gap: 14px;
}
.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;
  }
}
.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 ========= */
.wiz-step { display: none; flex-direction: column; gap: 14px; }
.wiz-step.active { display: flex; }
.wiz-step[data-step="1"] { gap: 18px; }

/* 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);
}

/* Тарифы в мастере подключения: сетка 2×2, тот же светлый язык, что у wiz-option / wiz-progress */
.wiz-tariff-panel {
  background: var(--gray1);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--gray2);
}
.tariff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tariff-card {
  position: relative;
  min-height: 0;
  background: var(--white);
  border: 2px solid var(--gray2);
  border-radius: 12px;
  padding: 8px 8px 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--black);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tariff-card.selected {
  background: linear-gradient(145deg, #8b5cf6 0%, #6d28d9 55%, #5b21b6 100%);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 6px 18px rgba(109,40,217,.32);
}
.tariff-card__period {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--black);
}
.tariff-card.selected .tariff-card__period {
  color: #fff;
}
.tariff-card__lines {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.tariff-card.selected .tariff-card__lines {
  color: rgba(255,255,255,.88);
}
.tariff-card__dot { opacity: .55; font-weight: 500; }
.tariff-card.selected .tariff-card__dot {
  opacity: .65;
}
.tariff-card__per-num { font-weight: 700; }
.tariff-card__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 30px;
  padding: 2px 6px;
  background: var(--violet);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(124,58,237,.25);
}
.tariff-card.selected .tariff-card__badge {
  background: rgba(255,255,255,.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: none;
}
.tariff-card:active { transform: translateY(1px); }

.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__label { font-weight: 700; font-size: 15px; }

/* 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%);
    border-radius: 20px 20px 0 0;
  }
}

/* ========= 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__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;
  }

  .cfg-below-hero {
    margin: 16px 0 28px;
  }

  .section-title,
  .cfg-section__title {
    font-size: 36px;
    letter-spacing: -0.45px;
    line-height: 1.06;
  }

  .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;
  }
  .nav__glider {
    display: none;
  }

  .nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: auto;
    transform: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    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;
  }

  .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, #7c3aed 0%, #6366f1 48%, #4f46e5 100%);
    box-shadow: 0 8px 28px rgba(99,102,241,.45);
  }

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

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

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

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

  .toast {
    bottom: 24px;
  }

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

  .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);
  }
}

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