/* Мини-апп для Telegram: mobile first, одна колонка, тёмная тема.
   Слои различаются только светлотой (фон → карточка → вложенное), без рамок и теней.
   Лайм — единственный цвет: тарифная карточка, «://» в логотипе и оплаченный статус.
   Главная кнопка — инверсия: белая заливка, чёрный текст. Админка живёт на admin.css. */

:root {
  --ground: #1c1c1d;
  --surface: #2a2a2b;
  --raised: #363637;
  --pressed: #414142;

  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #969696;

  /* Фирменный кислотный лайм: светлый, поэтому только как фон под тёмным текстом
     или как цвет текста на почти чёрном. */
  --accent: #daff01;
  --accent-motif: #e8ff6b;
  --accent-ink: #12141a;
  --accent-ink-muted: #3d4a00;

  --primary: #ffffff;
  --primary-pressed: #dcdcdc;
  --primary-ink: #111111;

  --positive: var(--accent);
  --pill-positive-bg: #2e3606;
  --negative: #ff6f61;
  --pill-negative-bg: #3a2120;
  --pill-bg: #3a3a3b;

  --radius-card: 20px;
  --radius-control: 14px;
  --gutter: 16px;
  --gap: 12px;
  --section-gap: 32px;

  --font: "Google Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Telegram выставляет эти переменные сам в полноэкранном режиме; вне него — нули. */
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, dl, dd, ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

.num {
  font-variant-numeric: tabular-nums;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* --- каркас --- */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--safe-top) var(--gutter) 0;
}

.bar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  height: 60px;
}

.bar-side-end {
  justify-self: end;
}

.bar-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wordmark-scheme {
  color: var(--accent);
  font-weight: 400;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.icon-btn:hover {
  background: var(--raised);
}

.icon-btn:active {
  background: var(--pressed);
  transform: scale(0.94);
}

.screen {
  padding: 12px 0 calc(32px + var(--safe-bottom));
}

.screen.has-dock {
  padding-bottom: calc(108px + var(--safe-bottom));
}

.block {
  margin-top: var(--section-gap);
}

.block-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.block-note {
  margin: 12px 4px;
  color: var(--muted);
  font-size: 14px;
}

.screen-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.screen-lead {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.screen-lead strong {
  color: var(--text);
  font-weight: 500;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
}

.account {
  margin-top: var(--section-gap);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}

/* --- тарифная карточка: «://» как крупный мотив, как звезда на референсе --- */

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
  padding: 24px 22px 22px;
  border-radius: var(--radius-card);
  background: var(--accent);
  color: var(--accent-ink);
  overflow: hidden;
  isolation: isolate;
}

.plan-motif {
  position: absolute;
  z-index: -1;
  right: -14px;
  top: 50%;
  transform: translateY(-58%);
  color: var(--accent-motif);
  font-size: 236px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.08em;
  pointer-events: none;
  user-select: none;
}

.plan-title {
  max-width: 11ch;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.plan-sub {
  max-width: 24ch;
  margin-top: 12px;
  color: var(--accent-ink-muted);
  font-size: 15px;
  font-weight: 500;
}

.plan-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.plan-facts dt {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.plan-facts dd {
  margin-top: 4px;
  color: var(--accent-ink-muted);
  font-size: 14px;
  font-weight: 500;
}

.plan-compact {
  min-height: 0;
}

.plan-compact .plan-title {
  max-width: none;
  font-size: 30px;
}

.plan-compact .plan-motif {
  font-size: 180px;
}

/* --- выбор периода: два поля как на референсе, второе — промокод --- */

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.option {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  transition: background-color 0.15s;
}

.option-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
}

.option-mark .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.option-label {
  color: var(--muted);
  font-size: 15px;
  line-height: 32px;
}

.option-value {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.option-sub {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 14px;
}

.option-promo {
  cursor: text;
}

.option-promo:focus-within {
  background: var(--raised);
}

.option-input {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  outline: none;
}

.option-input::placeholder {
  color: var(--faint);
  text-transform: none;
  font-weight: 500;
}

/* --- кнопки --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-control);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: #f0f0f0;
}

.btn-primary:active {
  background: var(--primary-pressed);
}

.btn[disabled],
.btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.btn-quiet {
  background: var(--raised);
  color: var(--text);
}

.btn-quiet:hover {
  background: var(--pressed);
}

.btn-sm {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
}

.btn-sm .icon {
  width: 18px;
  height: 18px;
}

.btn-block {
  width: 100%;
}

/* Кнопка действия прибита к низу экрана, как на референсе. */
.dock {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px var(--gutter) calc(16px + var(--safe-bottom));
  background: var(--ground);
}

.dock > * {
  display: flex;
  max-width: calc(480px - 2 * var(--gutter));
  margin: 0 auto;
}

/* --- подключение --- */

.connect {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.qr {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 12px;
  background: #fff;
  image-rendering: pixelated;
}

.connect-body {
  min-width: 0;
}

.connect-label {
  color: var(--muted);
  font-size: 14px;
}

.connect-url {
  margin: 4px 0 12px;
  /* Иначе шрифт превращает «9x2» в токене в «9×2», и ссылку переписывают с ошибкой. */
  font-feature-settings: "calt" 0;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- списки --- */

.list {
  overflow: hidden;
}

.list li + li {
  box-shadow: inset 0 1px 0 #333334;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  text-decoration: none;
}

a.row {
  transition: background-color 0.15s;
}

a.row:hover {
  background: #2f2f30;
}

a.row:active {
  background: var(--raised);
}

.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.row-title {
  font-size: 16px;
  font-weight: 500;
}

.row-sub {
  color: var(--faint);
  font-size: 13px;
}

.row-end {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.row-figure {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.pill-positive {
  background: var(--pill-positive-bg);
  color: var(--positive);
}

.pill-negative {
  background: var(--pill-negative-bg);
  color: var(--negative);
}

.empty {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 15px;
}

/* --- формы --- */

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

.form .screen-title {
  margin-bottom: 4px;
}

.form .screen-lead {
  margin: -12px 0 4px;
}

.form .btn {
  margin-top: 8px;
}

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

.field-label {
  color: var(--muted);
  font-size: 14px;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 17px;
  outline: none;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  background: var(--raised);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.has-error .input {
  box-shadow: inset 0 0 0 1.5px var(--negative);
}

.field-error {
  color: var(--negative);
  font-size: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 16px;
  cursor: pointer;
}

.check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--raised);
  color: transparent;
  transition: background-color 0.15s, color 0.15s;
}

.check-mark .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.check-input:checked + .check-mark {
  background: var(--primary);
  color: var(--primary-ink);
}

.check-input:focus-visible + .check-mark {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 24px;
  font-size: 15px;
}

.links a,
.link-btn {
  padding: 10px 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: #5a5a5b;
  text-underline-offset: 4px;
  cursor: pointer;
}

.links a:hover,
.link-btn:hover {
  text-decoration-color: currentColor;
}

/* --- экраны результата --- */

.result {
  padding-top: 15vh;
}

.result-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border-radius: 50%;
}

.result-mark .icon {
  width: 30px;
  height: 30px;
  stroke-width: 2.2;
}

.result-positive {
  background: var(--accent);
  color: var(--accent-ink);
}

.result-negative {
  background: var(--pill-negative-bg);
  color: var(--negative);
}

.result-code {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* --- уведомления --- */

.flashes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 15px;
}

.flash-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}

.flash-success .flash-dot {
  background: var(--positive);
}

.flash-danger .flash-dot {
  background: var(--negative);
}

.flash-warning .flash-dot {
  background: #ffb547;
}

.flash-text {
  flex: 1;
  padding: 8px 0;
}

.flash-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}

.flash-close:hover {
  background: var(--raised);
  color: var(--text);
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(120px + var(--safe-bottom));
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* На широком экране (браузер вне Telegram) колонка остаётся телефонной,
   просто получает воздух сверху. */
@media (min-width: 600px) {
  .app {
    padding-top: 24px;
  }
}

/* --- вход через Telegram --- */

/* Внутри мини-аппа прячем то, что нужно только в браузере, и наоборот. */
[data-show-in-tg],
.tg-app [data-hide-in-tg] {
  display: none !important;
}

.tg-app [data-show-in-tg] {
  display: block !important;
}

/* Почта и пароль внутри Telegram нужны, только если автоматический вход не прошёл. */
.tg-app .alt-login {
  display: none;
}

.tg-app.tg-auth-failed .alt-login {
  display: block;
}

.login .screen-title {
  margin-bottom: 8px;
}

.tg-browser .screen-lead {
  margin: 0 0 20px;
}

.tg-auto {
  margin-top: 16px;
}

.tg-auto-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
}

.tg-auto-retry {
  display: none;
  margin-top: 12px;
}

.tg-auth-failed .tg-auto-retry {
  display: flex;
}

.tg-auth-failed .spinner {
  display: none;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--raised);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.links-center {
  justify-content: center;
  margin-top: 12px;
}

.alt-login {
  margin-top: 28px;
}

.alt-login summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  list-style: none;
  cursor: pointer;
  transition: color 0.15s;
}

.alt-login summary::-webkit-details-marker {
  display: none;
}

.alt-login summary:hover,
.alt-login[open] summary {
  color: var(--text);
}

.alt-login[open] summary {
  margin-bottom: 12px;
}

/* --- главная: срок, статус, настройка, трафик, уведомления, помощь --- */

/* Полоса оставшегося срока на лаймовой карточке: тёмный тон той же гаммы. */
.plan-term {
  height: 6px;
  margin-top: 24px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.12);
  overflow: hidden;
}

.plan-term span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-ink);
}

.plan-term + .plan-facts {
  margin-top: 20px;
}

.status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: var(--gap);
  padding: 16px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
}

.status-dot.is-on {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--pill-positive-bg);
}

.status-dot.is-wait {
  background: #ffb547;
}

.status-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.status-title {
  font-size: 16px;
  font-weight: 500;
}

.status-sub {
  color: var(--muted);
  font-size: 14px;
}

/* Вкладки платформ на радиокнопках: работают и без скрипта. Подложка-дорожка —
   псевдоэлемент в первой строке сетки, вкладки лежат поверх неё. */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.tabs::before {
  content: "";
  grid-row: 1;
  grid-column: 1 / -1;
  border-radius: 16px;
  background: var(--surface);
}

.tab:nth-of-type(1) { grid-column: 1; }
.tab:nth-of-type(2) { grid-column: 2; }
.tab:nth-of-type(3) { grid-column: 3; }

.tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab {
  grid-row: 1;
  display: grid;
  place-items: center;
  min-height: 40px;
  margin: 4px 2px;
  padding: 0 6px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab:nth-of-type(1) { margin-left: 4px; }
.tab:nth-of-type(3) { margin-right: 4px; }

.tab:hover {
  color: var(--text);
}

.tab-input:checked + .tab {
  background: var(--raised);
  color: var(--text);
}

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

.tab-panel {
  display: none;
  grid-row: 2;
  grid-column: 1 / -1;
  padding-top: 16px;
}

#platform-ios:checked ~ [data-panel="ios"],
#platform-android:checked ~ [data-panel="android"],
#platform-desktop:checked ~ [data-panel="desktop"] {
  display: block;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 4px 16px;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.row-link {
  align-self: flex-start;
  text-decoration: underline;
  text-decoration-color: #5a5a5b;
  text-underline-offset: 3px;
}

.row-link:hover {
  color: var(--text);
}

.row-title .pill {
  margin-left: 6px;
  vertical-align: 2px;
}

.more {
  margin-top: var(--gap);
}

.more summary,
.faq summary {
  list-style: none;
  cursor: pointer;
}

.more summary::-webkit-details-marker,
.faq summary::-webkit-details-marker {
  display: none;
}

.more summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.more summary:hover,
.more[open] summary {
  color: var(--text);
}

.more[open] summary {
  margin-bottom: 4px;
}

.reset {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 4px 4px 0;
  font-size: 15px;
}

.reset-note {
  color: var(--faint);
  font-size: 14px;
}

.traffic {
  padding: 20px 16px 16px;
}

.traffic-total {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.traffic-total-empty {
  color: var(--faint);
}

.traffic-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* Столбики по дням: один цвет данных, пропуск — пустая колонка, а не ноль. */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 96px;
  margin-top: 20px;
  box-shadow: inset 0 -1px 0 #3a3a3b;
}

.chart-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.chart-col.is-empty .chart-bar {
  min-height: 0;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.switch {
  position: relative;
  width: 52px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--raised);
  cursor: pointer;
  transition: background-color 0.2s;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background-color 0.2s;
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on .switch-knob {
  background: var(--accent-ink);
  transform: translateX(20px);
}

.faq details + details {
  box-shadow: inset 0 1px 0 #333334;
}

.faq summary {
  position: relative;
  padding: 16px 44px 16px 16px;
  font-size: 16px;
  font-weight: 500;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 22px;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq details p {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 15px;
}

.support {
  margin-top: var(--gap);
}

.support .icon {
  width: 20px;
  height: 20px;
}

/* --- вкладки главной: нижний таббар --- */

.tabbar {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, calc((100% - 480px) / 2 + 8px)) calc(6px + var(--safe-bottom));
  background: var(--ground);
  /* Граница со скроллящимся под таббаром контентом — тон, а не линия. */
  box-shadow: 0 -1px 0 #2a2a2b;
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border-radius: 12px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

.tabbar-item .icon {
  width: 24px;
  height: 24px;
}

.tabbar-item:hover {
  color: var(--muted);
}

/* Активная вкладка — яркостью, как в стиле true-black: белый против серого. */
.tabbar-item[aria-selected="true"] {
  color: var(--text);
}

.tabbar-item:active {
  background: var(--surface);
}

.tabbar-item:focus-visible {
  outline-offset: -2px;
}

.screen.has-tabbar {
  padding-top: 16px;
  padding-bottom: calc(96px + var(--safe-bottom));
}

/* Без скрипта таббар — оглавление, а разделы идут подряд. */
.views-ready .tab-view:not(.is-active) {
  display: none;
}

.tab-view > .block:first-child,
.tab-view > form.block:first-child {
  margin-top: 0;
}

/* Тёмная кнопка на лаймовой карточке: белая там потерялась бы. */
.btn-ink {
  background: var(--accent-ink);
  color: #ffffff;
}

.btn-ink:hover {
  background: #23262f;
}

.btn-ink:active {
  background: #000000;
}

.plan-action {
  margin-top: 24px;
}

#pay-form .btn-primary {
  margin-top: 16px;
}

.account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.account .link-btn {
  font-size: 15px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 16px;
}

.empty-title {
  font-size: 17px;
  font-weight: 500;
}

.empty-sub {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
}

/* Компактная кнопка внутри строки списка: на месте пилюли статуса. Высота меньше
   44px, но строка вокруг неё сама 60px, промахнуться некуда. */
.btn-xs {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
}

/* Пока сессия переключается на владельца initData, чужой кабинет не показываем. */
.tg-switching .app,
.tg-switching .tabbar {
  visibility: hidden;
}

.tg-switching body::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid var(--raised);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- выбор тарифа: карточки-радиокнопки, как варианты на референсе --- */

.option-plan {
  cursor: pointer;
}

.option-plan:hover {
  background: #2f2f30;
}

.option-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Невыбранный тариф — пустой серый кружок, выбранный — белый с галочкой. */
.option-plan .option-mark {
  background: var(--raised);
  color: transparent;
  transition: background-color 0.15s, color 0.15s;
}

.option-plan:has(.option-radio:checked) {
  background: var(--raised);
}

.option-plan:has(.option-radio:checked) .option-mark,
.option-radio:checked + .option-top .option-mark {
  background: var(--primary);
  color: var(--primary-ink);
}

.option-radio:focus-visible + .option-top .option-mark {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-plan .option-sub + .option-sub {
  margin-top: 0;
}
