:root {
  --bg: #000000;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-nav: #6e6e73;
  --accent: #007aff;
  --accent-hover: #0a84ff;
  --border: rgba(255, 255, 255, 0.22);
  --border-strong: rgba(255, 255, 255, 0.38);
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --header-h: 60px;
  --radius-btn: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layout-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page-home .main-home {
  overflow: hidden;
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Фон как на макете: мягкое синее свечение из центра */
.page-home .glow {
  background: radial-gradient(
    ellipse 90% 75% at 50% 46%,
    rgba(0, 90, 200, 0.24) 0%,
    rgba(0, 50, 120, 0.09) 38%,
    rgba(0, 20, 50, 0.03) 58%,
    transparent 72%
  );
}

.header,
main,
.footer {
  position: relative;
  z-index: 1;
}

/* Header — как в макете */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 40px;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  overflow: visible;
}

.logo img {
  height: 36px;
  width: 36px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

.logo-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav > a:not(.btn) {
  color: var(--text-nav);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
}

.nav > a:not(.btn):hover {
  color: var(--text-secondary);
}

.nav a.nav-active {
  color: var(--text-secondary);
}

.nav-login {
  color: var(--text) !important;
  font-weight: 400 !important;
}

.nav .btn-ghost {
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  background: transparent;
  font-weight: 400;
  padding: 8px 20px;
  font-size: 14px;
  border-radius: var(--radius-btn);
}

.nav .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.5);
}

.nav .btn-primary {
  color: #fff !important;
  font-weight: 500;
  padding: 8px 20px;
  font-size: 14px;
  background: var(--accent);
  border-radius: var(--radius-btn);
  box-shadow: 0 0 24px rgba(0, 122, 255, 0.5);
}

.nav .btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 28px rgba(0, 122, 255, 0.55);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
}

.mobile-menu[hidden] {
  display: none !important;
}

.mobile-menu.is-open {
  display: flex;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-btn);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 0 24px rgba(0, 122, 255, 0.4);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px rgba(0, 122, 255, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text) !important;
  border: 1.5px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Home — один экран по центру */
.main-home {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 24px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

.hero h1 {
  margin: 0 0 48px;
  font-size: clamp(2.375rem, 5.8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
}

.hero-actions .btn {
  min-width: 210px;
  padding: 16px 44px;
  font-size: 17px;
  border-radius: var(--radius-btn);
}

.hero-actions .btn-primary {
  box-shadow: 0 0 32px rgba(0, 122, 255, 0.55), 0 4px 24px rgba(0, 122, 255, 0.25);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.hero-note,
.hero-price {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Внутренние страницы */
.page-inner {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.page-heading {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}

.page-lead {
  margin: 0 0 32px;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

.page-back {
  margin: 40px 0 0;
  text-align: center;
  font-size: 14px;
}

.page-back a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-back a:hover {
  color: var(--text);
}

.tariffs-minimal {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.tariff-line {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 16px;
  padding: 20px 22px;
  background: rgba(28, 28, 30, 0.6);
}

.tariff-name {
  font-weight: 600;
  font-size: 17px;
}

.tariff-meta {
  grid-column: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.tariff-price {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.faq {
  margin: 0;
}

.faq > div {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
}

.faq > div:first-child {
  border-top: none;
}

.faq dt {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
}

.faq dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.page-inner.legal-doc {
  max-width: 720px;
}

.legal-doc {
  margin: 0 auto;
  text-align: left;
}

.legal-doc .page-lead {
  text-align: left;
  margin-bottom: 28px;
}

.legal-doc section {
  margin-bottom: 28px;
}

.legal-doc h2 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.legal-doc p,
.legal-doc li {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal-doc ul,
.legal-doc ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.legal-doc li {
  margin-bottom: 6px;
}

.legal-doc a {
  color: var(--accent);
  text-decoration: none;
}

.legal-doc a:hover {
  text-decoration: underline;
}

.legal-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 14px;
}

.legal-doc th,
.legal-doc td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border);
}

.legal-doc th {
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.legal-doc td {
  color: var(--text-secondary);
}

.legal-doc .legal-muted {
  font-size: 13px;
  color: var(--text-nav);
}

/* Footer — одна строка как в макете */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 32px 32px;
  font-size: 12px;
  color: var(--text-nav);
  margin-top: auto;
}

.footer--compact {
  padding: 20px 24px 28px;
}

.footer a {
  color: var(--text-nav);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-secondary);
}

.sep {
  color: var(--text-nav);
  opacity: 0.5;
  user-select: none;
}

/* Mobile */
@media (max-width: 768px) {
  .header {
    padding: 12px 20px;
  }

  .nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .hide-mobile {
    display: none !important;
  }

  .hero h1 {
    margin-bottom: 36px;
    font-size: 2rem;
    line-height: 1.15;
    max-width: 320px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
    gap: 12px;
    margin-bottom: 24px;
  }

  .hero-actions .btn {
    width: 100%;
    min-width: 0;
    padding: 15px 24px;
  }

  .footer {
    flex-direction: column;
    gap: 6px;
    padding-bottom: 24px;
  }

  .footer .sep {
    display: none;
  }

  .footer-links-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .tariff-line {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .tariff-price {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
}

@media (min-width: 769px) {
  .mobile-menu.is-open {
    display: none !important;
  }

  .footer-mobile-break {
    display: none;
  }
}

/* ——— Auth: вход + регистрация в одном блоке ——— */
.page-auth .glow {
  background: radial-gradient(
    ellipse 90% 75% at 50% 46%,
    rgba(0, 90, 200, 0.24) 0%,
    rgba(0, 50, 120, 0.09) 38%,
    rgba(0, 20, 50, 0.03) 58%,
    transparent 72%
  );
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 20, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form[hidden] {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.field input[type='email'],
.field input[type='text'],
.field input[type='password'] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: rgba(0, 122, 255, 0.6);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px rgba(12, 12, 14, 0.95) inset !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  transition: background-color 99999s ease-out;
}

.field-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.field-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.field-check a {
  color: var(--accent);
  text-decoration: none;
}

.field-check a:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
  margin-top: 4px;
}

.auth-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--text-secondary);
}

.auth-notice.is-error {
  background: rgba(255, 69, 58, 0.12);
  color: #ff6b6b;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: var(--text-nav);
  font-size: 13px;
}

.page-auth .auth-form .btn-primary {
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.28);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-nav);
  text-align: center;
}

.auth-alt {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-hint--foot {
  margin-top: 16px;
}

.auth-field-hint {
  margin: -8px 0 4px;
  font-size: 12px;
  color: var(--text-nav);
  line-height: 1.4;
}

.cabinet-card--accent {
  border-color: rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.08);
}

#credentials-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

/* Кастомная кнопка TG + невидимый виджет поверх (кликабельный) */
.tg-login-slot {
  position: relative;
  width: 100%;
  height: 48px;
}

.btn-telegram {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
  pointer-events: none;
  background: linear-gradient(180deg, #2aabee 0%, #229ed9 100%);
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.35);
  border-radius: var(--radius-btn);
}

.tg-login-widget {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: var(--radius-btn);
}

.tg-login-widget iframe {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  opacity: 0.0001;
  cursor: pointer;
  border: none !important;
}

.btn-bot {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  gap: 10px;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-btn);
}

.btn-bot:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-icon {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
}

/* ——— Личный кабинет ——— */
.page-cabinet .glow {
  background: radial-gradient(
    ellipse 90% 70% at 50% 38%,
    rgba(0, 90, 200, 0.22) 0%,
    transparent 68%
  );
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cabinet-shell {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 3vw, 32px);
  padding-right: clamp(16px, 3vw, 32px);
  box-sizing: border-box;
}

.cabinet-main {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding-top: 28px;
  padding-bottom: 56px;
}

.cabinet-head {
  margin-bottom: 20px;
}

.cabinet-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cabinet-greeting {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.cabinet-grid {
  display: grid;
  gap: 16px;
  align-items: start;
  grid-template-columns: 1fr;
  grid-template-areas:
    'sub'
    'side'
    'addon'
    'buy';
}

.cabinet-grid__sub {
  grid-area: sub;
}

.cabinet-grid__side {
  grid-area: side;
}

.cabinet-grid__addon {
  grid-area: addon;
}

.cabinet-grid__buy {
  grid-area: buy;
}

.purchase-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.purchase-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-chips--tariff .chip {
  flex: 1 1 calc(50% - 3px);
  min-width: 140px;
}

.cabinet-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 960px) {
  .cabinet-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    grid-template-areas:
      'sub side'
      'addon side'
      'buy side';
  }
}

.addon-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.pay-actions .btn {
  flex: 1 1 auto;
  min-width: 140px;
}


.cabinet-hero {
  padding: 28px 28px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    145deg,
    rgba(22, 28, 42, 0.92) 0%,
    rgba(12, 14, 18, 0.88) 100%
  );
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.btn-connect {
  font-weight: 600;
  min-width: 160px;
}

.option-chips--period .chip {
  flex: 1 1 calc(50% - 3px);
  min-width: 0;
  font-size: 13px;
  padding: 10px 10px;
}

.buy-form select,
.topup-form input,
#credentials-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
}

.buy-form select:focus,
.topup-form input:focus,
#credentials-form input:focus {
  border-color: rgba(0, 122, 255, 0.55);
}

.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cabinet-notice.is-success {
  background: rgba(52, 199, 89, 0.12);
  color: #8ae08a;
}

.cabinet-loading {
  animation: cabinet-pulse 1.4s ease-in-out infinite;
}

@keyframes cabinet-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.mobile-menu .btn-outline {
  margin-top: 8px;
}

.cabinet-card {
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 20, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cabinet-card:focus-within {
  border-color: rgba(255, 255, 255, 0.16);
}

.cabinet-card--hint {
  border-color: rgba(0, 122, 255, 0.2);
  background: rgba(0, 122, 255, 0.06);
}

.cabinet-card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-nav);
}

.cabinet-value {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
}

.cabinet-value--balance {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* Hero подписки */
.sub-hero__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sub-badge--ok {
  color: #34c759;
  background: rgba(52, 199, 89, 0.14);
  border: 1px solid rgba(52, 199, 89, 0.35);
}

.sub-badge--trial {
  color: #ffd60a;
  background: rgba(255, 214, 10, 0.12);
  border: 1px solid rgba(255, 214, 10, 0.35);
}

.sub-badge--off {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sub-hero__days {
  font-size: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sub-hero__days strong {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 600;
  margin-right: 4px;
}

.sub-hero__title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sub-hero__meta {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sub-hero__meta.sub-hero__traffic {
  margin-bottom: 22px;
}

.pay-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pay-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.pay-actions--stack .btn {
  width: 100%;
  min-width: 0;
}

#card-extend .option-chips--compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

#card-extend .option-chips--compact .chip {
  flex: none;
  width: 100%;
  min-width: 0;
  font-size: 11px;
  padding: 8px 6px;
  line-height: 1.3;
  text-align: center;
}

#card-extend .pay-actions--stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
  flex-direction: unset;
}

#card-extend .pay-actions--stack .btn {
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 13px;
}

.sub-traffic {
  margin-bottom: 22px;
}

.sub-traffic__labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-nav);
}

.sub-traffic__labels strong {
  color: var(--text);
  font-weight: 600;
}

.sub-traffic__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sub-traffic__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #007aff, #5ac8fa);
  transition: width 0.4s ease;
}

.sub-traffic__fill.is-warn {
  background: linear-gradient(90deg, #ff9f0a, #ffd60a);
}

.sub-traffic__fill.is-danger {
  background: linear-gradient(90deg, #ff453a, #ff9f0a);
}

.sub-traffic__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-nav);
}

.sub-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sub-hero__actions .btn-primary {
  flex: 1 1 160px;
}

.sub-empty {
  text-align: center;
  padding: 12px 0 8px;
}

.sub-empty .cabinet-muted {
  margin-bottom: 20px;
}

.topup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chip.is-active {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.18);
  color: #fff;
}

.addon-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-chips .chip {
  flex: 1 1 calc(50% - 3px);
  min-width: 120px;
  text-align: center;
  line-height: 1.3;
  padding: 10px 12px;
  font-size: 13px;
}

.option-chips--devices .chip {
  flex: 1 1 calc(25% - 5px);
  min-width: 0;
  padding: 8px 6px;
  font-size: 12px;
}

.option-chips--traffic .chip {
  flex: 1 1 calc(33.333% - 4px);
  min-width: 0;
  font-size: 12px;
  padding: 8px 8px;
}

.addon-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.addon-footer .btn {
  min-width: 200px;
}

.buy-form--addon {
  gap: 0;
}

.option-chips .chip.is-current:not(.is-active) {
  opacity: 0.72;
}

@media (max-width: 640px) {
  .option-chips--devices .chip {
    flex: 1 1 calc(50% - 3px);
  }

  .option-chips--traffic .chip {
    flex: 1 1 calc(50% - 3px);
  }

  .addon-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .addon-footer .btn {
    width: 100%;
    min-width: 0;
  }
}

.cabinet-muted {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

#telegram-status.is-linked {
  color: #34c759;
}

.cabinet-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-nav);
  line-height: 1.45;
}

.cabinet-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.cabinet-list strong {
  color: var(--text);
  font-weight: 500;
}

.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-user {
  font-size: 13px;
  color: var(--text-nav);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cabinet-notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--text-secondary);
}

.cabinet-notice.is-error {
  background: rgba(255, 69, 58, 0.12);
  color: #ff6b6b;
}

.topup-form,
.buy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.topup-form input,
.buy-form select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

/* Без стрелок у number (Chrome, Safari, Edge, Firefox) */
input[type='number'],
.topup-form input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button,
.topup-form input[type='number']::-webkit-outer-spin-button,
.topup-form input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.cabinet-price-line {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.cabinet-price-line strong {
  color: var(--text);
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .cabinet-main {
    padding: 24px 16px 40px;
  }

  .cabinet-hero {
    padding: 22px 18px 20px;
  }

  .sub-hero__actions .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .nav-user {
    display: none;
  }
}

/* ——— Кабинет v2 (sidebar + виджеты) ——— */
.page-cabinet-v2 .header,
.page-cabinet-v2 .mobile-menu {
  display: none;
}

.page-cabinet-v2 {
  --cabinet-accent: #34c759;
  --cabinet-accent-dim: rgba(52, 199, 89, 0.15);
}

.page-cabinet-v2 .glow {
  background: radial-gradient(
    ellipse 80% 60% at 30% 20%,
    rgba(52, 199, 89, 0.12) 0%,
    transparent 65%
  );
}

.cabinet-app {
  display: flex;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
}

.cabinet-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(8, 8, 10, 0.6);
}

.cabinet-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.cabinet-sidebar__user {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

.cabinet-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cabinet-nav__item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cabinet-nav__item:hover,
.cabinet-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cabinet-nav__item.is-active {
  background: var(--cabinet-accent);
  color: #0a0a0a;
  font-weight: 600;
}

.cabinet-nav__item.is-hidden {
  display: none;
}

.cabinet-sidebar__logout {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.cabinet-sidebar__logout:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.cabinet-main-v2 {
  flex: 1;
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 32px) 32px;
  display: flex;
  flex-direction: column;
}

.cabinet-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.cabinet-top__kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cabinet-accent);
}

.cabinet-top__title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cabinet-top__user {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.cabinet-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 199, 89, 0.35);
  background: var(--cabinet-accent-dim);
  font-size: 13px;
  color: var(--cabinet-accent);
  white-space: nowrap;
}

.cabinet-status.is-trial {
  border-color: rgba(255, 149, 0, 0.35);
  background: rgba(255, 149, 0, 0.12);
  color: #ffb340;
}

.cabinet-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.cabinet-panel {
  display: none;
  flex: 1;
}

.cabinet-panel.is-active {
  display: block;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.panel-lead {
  margin: 0 0 20px;
}

.panel-subtitle {
  margin: 0 0 8px;
  font-size: 1rem;
}

.balance-hero {
  margin: 0 0 20px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--cabinet-accent);
}

.cabinet-card--nested {
  margin-top: 20px;
}

.cabinet-footer-v2 {
  margin-top: 32px;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  color: var(--text-nav);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cabinet-footer-v2 a {
  color: var(--text-nav);
  text-decoration: none;
}

.cabinet-footer-v2 a:hover {
  color: var(--text-secondary);
}

.plan-hero {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(24, 28, 24, 0.95), rgba(10, 10, 12, 0.9));
  margin-bottom: 16px;
}

.plan-hero__kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-nav);
}

.plan-hero__name {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
}

.plan-tag {
  font-size: 12px;
  font-weight: 600;
  color: #ffb340;
  vertical-align: middle;
}

.plan-hero__date,
.plan-hero__meta {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.plan-hero__cta {
  text-align: center;
  min-width: 200px;
}

.plan-hero__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-nav);
}

.page-cabinet-v2 .btn-primary {
  background: var(--cabinet-accent);
  color: #0a0a0a;
  box-shadow: 0 4px 24px rgba(52, 199, 89, 0.35);
}

.page-cabinet-v2 .btn-primary:hover {
  filter: brightness(1.08);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

.days-ring {
  --progress: 0.5;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--cabinet-accent) calc(var(--progress) * 360deg),
    rgba(255, 255, 255, 0.08) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.days-ring__inner {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #0c0c0e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.days-ring__inner strong {
  font-size: 1.75rem;
  font-weight: 700;
}

.days-ring__inner span {
  font-size: 12px;
  color: var(--text-secondary);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.widget-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 20, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-card__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-nav);
}

.widget-card__lead {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.widget-card__foot {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.widget-stat {
  margin: 0;
  font-size: 2rem;
  color: var(--text);
}

.widget-stat strong {
  color: var(--cabinet-accent);
}

.widget-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.widget-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.widget-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.widget-btn--full {
  grid-column: 1 / -1;
}

.traffic-ring-sm {
  --progress: 0;
  width: 72px;
  height: 72px;
  margin: 4px auto;
  border-radius: 50%;
  background: conic-gradient(
    var(--cabinet-accent) calc(var(--progress) * 360deg),
    rgba(255, 255, 255, 0.08) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.traffic-ring-sm__inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0c0c0e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.sub-empty-v2 {
  padding: 48px 24px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

#panel-extend .option-chips--compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 480px;
}

#panel-extend .option-chips--compact .chip {
  flex: none;
  width: 100%;
  font-size: 13px;
}

#panel-extend .pay-actions--stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 480px;
}

.cabinet-burger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(12, 12, 14, 0.9);
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.cabinet-burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.page-cabinet-v2 .chip.is-active {
  border-color: var(--cabinet-accent);
  background: var(--cabinet-accent-dim);
  color: var(--cabinet-accent);
}

@media (max-width: 1024px) {
  .plan-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .plan-hero__cta {
    margin: 0 auto;
  }

  .days-ring {
    margin: 0 auto;
  }

  .widget-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .cabinet-burger {
    display: flex;
  }

  .cabinet-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }

  .cabinet-sidebar.is-open {
    transform: translateX(0);
  }

  .cabinet-main-v2 {
    padding-top: 72px;
  }
}
