* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1412;
  --bg-elev: #171e1b;
  --ink: #e8eee9;
  --mute: #8a9a90;
  --line: rgba(232, 238, 233, 0.1);
  --accent: #3dcfb0;
  --accent-ink: #06261e;
  --ok: #5fd68a;
  --warn: #e0b35a;
  --danger: #ff7a7a;
  --header: rgba(15, 20, 18, 0.88);
  --nav: rgba(15, 20, 18, 0.94);
  --radius: 18px;
  --ease: 0.22s ease;
}

[data-theme="light"] {
  --bg: #f3f6f4;
  --bg-elev: #ffffff;
  --ink: #141816;
  --mute: #5f6f66;
  --line: rgba(20, 24, 22, 0.1);
  --accent: #0f7a64;
  --accent-ink: #f3f6f4;
  --header: rgba(243, 246, 244, 0.9);
  --nav: rgba(243, 246, 244, 0.96);
}

html, body {
  font-family: Figtree, "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-x: none;
}

body {
  display: flex;
  justify-content: center;
  padding-bottom: 88px;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(61, 207, 176, 0.16), transparent 55%),
    var(--bg);
  position: relative;
}

[data-theme="light"] body {
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(15, 122, 100, 0.1), transparent 55%),
    var(--bg);
}

.app {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
  padding-bottom: 72px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  overflow-x: clip;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.brand {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.04em;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.header-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
  max-width: 68%;
  overflow: hidden;
}

.balance {
  font-size: 11px;
  font-weight: 600;
  color: var(--mute);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mute);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-chip.is-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
}
.auth-chip.is-warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}
.auth-chip-icon { width: 12px; height: 12px; flex-shrink: 0; }

.auth-banner {
  margin: 12px 16px 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
  display: grid;
  gap: 12px;
}
.auth-banner[hidden] { display: none !important; }
.auth-banner-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-banner-copy p {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
}
.auth-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.auth-banner-actions--secondary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  opacity: 0.95;
}
.tg-login-mount {
  min-height: 28px;
  max-width: 100%;
  overflow: hidden;
}
.tg-login-mount iframe {
  max-width: 100% !important;
}
.tg-login-fallback {
  color: var(--mute);
  font-size: 13px;
  margin: 0;
  max-width: 280px;
  line-height: 1.4;
}
.auth-card {
  text-align: center;
  padding: 18px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
}
.auth-card[hidden] { display: none !important; }
.auth-card-ico {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--accent);
}
.auth-card-ico svg { width: 40px; height: 40px; }
.auth-card strong { display: block; margin-bottom: 6px; }
.auth-card p {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.verified-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
}
.verified-line svg { width: 14px; height: 14px; }
.verified-line[hidden] { display: none !important; }

.icon-btn, .lang-btn {
  border: none;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  font-family: inherit;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 14px;
}

.lang { display: flex; gap: 2px; }
.lang-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
}
.lang-btn.active { color: var(--accent); }

.page {
  display: none;
  padding: 16px 14px 28px;
  animation: in 0.28s ease;
  min-width: 0;
  overflow-x: clip;
}
.page.active { display: block; }

@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.page-lead {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.hero {
  padding: 20px 0 8px;
  min-height: 36vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.brand-kicker {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: clamp(22px, 6.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero > p:not(.brand-kicker) {
  color: var(--mute);
  font-size: 15px;
  line-height: 1.45;
  max-width: 34ch;
  margin-bottom: 22px;
}

.trust-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.trust-row li {
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
}
.trust-row li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 1px;
  background: var(--accent);
  vertical-align: 1px;
}

.hero-actions, .row-actions, .promo-actions, .key-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), opacity var(--ease), background var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-sm { padding: 10px 16px; font-size: 13px; }
.hero-actions .btn { flex: 1 1 auto; min-width: 0; }

.flow {
  list-style: none;
  margin-top: 36px;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.flow li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}
.flow span {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
}
.flow strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.flow em {
  display: block;
  font-style: normal;
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}

.howto--home { margin-top: 28px; }
.howto--home h2,
.howto h3 {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 18px;
  margin-bottom: 14px;
}
.howto-cards {
  list-style: none;
  display: grid;
  gap: 12px;
}
.howto-cards > li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.howto-cards > li:last-child { border-bottom: none; }
.howto-ico, .howto-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.howto-ico svg { width: 20px; height: 20px; }
.howto-num {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.howto-cards strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.howto-cards em {
  display: block;
  font-style: normal;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 3px;
}

.trial-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.trial-strip strong {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 16px;
}
.trial-strip p {
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}

#tariffGrid { display: grid; gap: 14px; }

.tariff-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.tariff-card.featured .tariff-name::after {
  content: " · hit";
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}
.tariff-name {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tariff-desc {
  color: var(--mute);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tariff-bullets {
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 4px;
}
.tariff-bullets li {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.35;
}
.tariff-bullets li::before {
  content: "· ";
  color: var(--accent);
  font-weight: 700;
}
.balance-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--warn);
}
.tariff-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 10px;
}
.tariff-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tariff-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tariff-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tariff-price-big {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.price-old {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--mute);
  text-decoration: line-through;
  margin-right: 6px;
}
.badge-sale {
  color: #c4473a !important;
}
.tariff-price-note { font-size: 12px; color: var(--mute); }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-left: 6px;
}
.support-line {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--mute);
}
.support-line a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: 6px;
}

.key-box { padding: 4px 0 8px; }
.key-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.key-url {
  font-size: 13px;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.5;
  color: var(--ink);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  max-width: 100%;
}
.key-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 14px;
}
.key-servers {
  list-style: none;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.6;
  margin: 0 0 16px;
}
.key-actions .btn { flex: 1 1 auto; min-width: 0; }

.howto {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.howto h3 {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 16px;
  margin-bottom: 10px;
}
.howto-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  counter-reset: howto;
}
.howto-steps > li {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.45;
  padding-left: 28px;
  position: relative;
  counter-increment: howto;
}
.howto-steps > li::before {
  content: counter(howto);
  position: absolute;
  left: 0;
  top: 0;
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.store-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.store-link:hover { border-color: var(--accent); color: var(--accent); }

.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-ico {
  width: 20px;
  height: 20px;
  color: var(--accent);
  display: inline-grid;
  place-items: center;
}
.menu-ico svg { width: 18px; height: 18px; }

.invite-bar {
  margin-top: 24px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.invite-bar > div:first-child {
  min-width: 0;
  flex: 1 1 140px;
}
.invite-bar--top {
  margin-top: 0;
  margin-bottom: 8px;
  padding-top: 0;
  border-top: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.invite-bar strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.invite-bar p {
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}
.invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-preview {
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.guest-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.4;
}
.key-ready {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ok);
}

.lead {
  color: var(--mute);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.perk-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.perk-list li::before {
  content: "— ";
  color: var(--accent);
}
.ref-box {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ref-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ref-link {
  margin: 8px 0 14px;
  font-size: 13px;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.45;
  max-width: 100%;
}
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
.stat-row > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.stat-row b {
  display: block;
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.stat-row span {
  color: var(--mute);
  font-size: 12px;
}
.ref-list { display: grid; gap: 8px; }
.ref-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.empty-hint {
  color: var(--mute);
  font-size: 14px;
  padding: 12px 0;
}

.profile-top { text-align: center; padding: 12px 0 8px; }
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 24px;
  overflow: hidden;
}
.avatar.avatar--photo {
  background: transparent;
  padding: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-name {
  font-family: Syne, Figtree, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.profile-id { color: var(--mute); font-size: 13px; margin-top: 2px; }
.menu {
  display: grid;
  gap: 0;
  margin-top: 8px;
}
.menu button {
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 0;
  cursor: pointer;
}
.version {
  margin-top: 18px;
  text-align: center;
  color: var(--mute);
  font-size: 12px;
}

.legal-back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 0 0 8px;
  cursor: pointer;
}
.legal-meta {
  color: var(--mute);
  font-size: 13px;
  margin: -4px 0 16px;
}
.legal-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 6px;
}
.legal-body p {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 8px;
}
.legal-ext {
  margin-top: 20px;
  padding-bottom: 24px;
}
.legal-ext a {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.backup-login {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.backup-login strong { display: block; font-size: 14px; margin-bottom: 4px; }
.backup-login p { color: var(--mute); font-size: 13px; margin: 0 0 10px; }
.backup-login-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.backup-login-row input,
.backup-card input {
  flex: 1 1 160px;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.backup-card {
  margin: 18px 0 8px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
}
.backup-card > strong { display: block; font-size: 16px; margin-bottom: 6px; }
.backup-card > p { color: var(--mute); font-size: 13px; line-height: 1.45; margin: 0 0 10px; }
.backup-status { font-weight: 600; font-size: 13px; color: var(--accent); margin: 0 0 10px !important; }
.backup-code-box {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
}
.backup-code-box code {
  display: block;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin: 8px 0 10px;
  word-break: break-all;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.field-hint { color: var(--mute); font-size: 12px; margin: 6px 0 10px; }
#webLogoutBtn { margin-top: 8px; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
  box-sizing: border-box;
}
.nav-item {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: none;
  color: var(--mute);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 1px;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-ico {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.nav-item.active { color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s ease;
  z-index: 99;
  max-width: min(90vw, 360px);
  width: max-content;
  box-sizing: border-box;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.paid-status {
  margin-bottom: 14px;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.paid-pending { color: var(--accent); }
.paid-ok { color: var(--ok); }
.paid-timeout { color: var(--warn); }

.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.fs-12 { font-size: 12px; }
.text-muted { color: var(--mute); }
.mb-8 { margin-bottom: 8px; }

@media (max-width: 380px) {
  .auth-chip span { display: none; }
  .auth-chip { padding: 5px; max-width: none; }
  .lang-btn { padding: 4px 4px; }
  .header { padding: 10px 12px 8px; }
  .page { padding: 14px 12px 24px; }
  .auth-banner { margin: 10px 12px 0; }
}

@media (max-width: 420px) {
  .tariff-selects { grid-template-columns: 1fr; }
  .hero-actions, .key-actions, .row-actions, .promo-actions, .invite-actions { flex-direction: column; }
  .hero-actions .btn, .key-actions .btn, .invite-actions .btn, .row-actions .btn { width: 100%; min-width: 0; }
}

@media (min-width: 640px) {
  .app, .bottom-nav { max-width: 560px; }
  .page { padding: 24px 28px 32px; }
  .hero h1 { max-width: 18ch; }
  #tariffGrid { gap: 18px; }
  .header { padding: 16px 20px 12px; }
  .header-meta { gap: 8px; max-width: none; }
}

@media (min-width: 1024px) {
  body {
    background:
      radial-gradient(1200px 640px at 50% -8%, rgba(61, 207, 176, 0.14), transparent 50%),
      radial-gradient(800px 400px at 90% 40%, rgba(61, 207, 176, 0.05), transparent 55%),
      var(--bg);
  }
  .app, .bottom-nav { max-width: 720px; }
  .header { padding: 18px 28px 14px; }
  .nav-item { font-size: 12px; padding: 10px 6px; }
  .tariff-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  }
  #tariffGrid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .tariff-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.devices-box { margin-top: 16px; }
.devices-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.devices-title { margin: 0; font-size: 15px; font-weight: 700; }
.devices-hint { margin: 6px 0 12px; font-size: 12px; color: var(--mute); }
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.device-row:first-child { border-top: 0; }
.device-name { font-size: 13px; font-weight: 600; }
.device-meta { font-size: 11px; color: var(--mute); }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 999px; }
