:root {
  --bg: #050711;
  --bg-2: #0b0b1b;
  --panel: rgba(17, 13, 34, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(222, 206, 255, 0.14);
  --line-strong: rgba(255, 10, 168, 0.46);
  --text: #fbf8ff;
  --soft: #ddd2f8;
  --muted: #8f86aa;
  --accent: #ff0aa8;
  --accent-2: #16e7ff;
  --accent-3: #9b4dff;
  --accent-4: #12b6c8;
  --good: #74f0b3;
  --bad: #ff7d95;
  --radius: 24px;
  --tg-top: 0px;
  --tg-bottom: 0px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
  background:
    radial-gradient(circle at 16% 7%, rgba(255, 10, 168, 0.18), transparent 24rem),
    radial-gradient(circle at 84% 10%, rgba(22, 231, 255, 0.18), transparent 27rem),
    radial-gradient(circle at 42% 62%, rgba(155, 77, 255, 0.16), transparent 34rem),
    linear-gradient(180deg, #040510 0%, #0b0819 48%, #050711 100%);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(22px + var(--tg-top)) 16px calc(108px + var(--tg-bottom));
  isolation: isolate;
}

.ambient,
.edge {
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

.ambient {
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.85;
}

.ambient-a {
  top: 42px;
  left: max(-34px, calc(50% - 284px));
  width: 170px;
  height: 430px;
  background: rgba(255, 10, 168, 0.24);
  animation: ambientMagenta 9s ease-in-out infinite alternate;
}

.ambient-b {
  right: max(-42px, calc(50% - 294px));
  top: 30px;
  width: 180px;
  height: 440px;
  background: rgba(22, 231, 255, 0.22);
  animation: ambientCyan 10.5s ease-in-out infinite alternate;
}

.edge {
  top: 0;
  bottom: 86px;
  width: 2px;
  opacity: 0.72;
}

.edge-left {
  left: max(42px, calc(50% - 204px));
  background: linear-gradient(transparent, rgba(255, 10, 168, 0.14) 8%, rgba(255, 10, 168, 0.98) 46%, rgba(212, 92, 255, 0.55) 76%, transparent);
  box-shadow: 0 0 22px rgba(255, 10, 168, 0.9), 0 0 62px rgba(255, 10, 168, 0.34);
  transform: skewX(-7deg);
  animation: neonLineLeft 5.8s ease-in-out infinite;
}

.edge-right {
  right: max(46px, calc(50% - 206px));
  background: linear-gradient(transparent, rgba(22, 231, 255, 0.22), rgba(22, 231, 255, 0.98) 54%, rgba(18, 182, 200, 0.44) 78%, transparent);
  box-shadow: 0 0 22px rgba(22, 231, 255, 0.88), 0 0 66px rgba(22, 231, 255, 0.36);
  transform: skewX(6deg);
  animation: neonLineRight 6.4s ease-in-out infinite;
}

@keyframes ambientMagenta {
  0% {
    opacity: 0.58;
    transform: translate3d(-6px, -12px, 0) scaleY(0.96);
    filter: blur(34px);
  }

  100% {
    opacity: 0.88;
    transform: translate3d(10px, 18px, 0) scaleY(1.05);
    filter: blur(28px);
  }
}

@keyframes ambientCyan {
  0% {
    opacity: 0.55;
    transform: translate3d(8px, 14px, 0) scaleY(1.03);
    filter: blur(34px);
  }

  100% {
    opacity: 0.86;
    transform: translate3d(-10px, -18px, 0) scaleY(0.96);
    filter: blur(29px);
  }
}

@keyframes neonLineLeft {
  0%,
  100% {
    opacity: 0.48;
    transform: translate3d(-3px, -12px, 0) skewX(-7deg) scaleY(0.96);
    box-shadow: 0 0 14px rgba(255, 10, 168, 0.62), 0 0 36px rgba(255, 10, 168, 0.2);
  }

  50% {
    opacity: 0.94;
    transform: translate3d(4px, 18px, 0) skewX(-7deg) scaleY(1.05);
    box-shadow: 0 0 26px rgba(255, 10, 168, 0.96), 0 0 76px rgba(155, 77, 255, 0.38);
  }
}

@keyframes neonLineRight {
  0%,
  100% {
    opacity: 0.5;
    transform: translate3d(3px, 16px, 0) skewX(6deg) scaleY(1.02);
    box-shadow: 0 0 14px rgba(22, 231, 255, 0.58), 0 0 38px rgba(22, 231, 255, 0.2);
  }

  50% {
    opacity: 0.96;
    transform: translate3d(-4px, -18px, 0) skewX(6deg) scaleY(0.97);
    box-shadow: 0 0 26px rgba(22, 231, 255, 0.94), 0 0 78px rgba(18, 182, 200, 0.38);
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.topbar > div {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar.is-home h1 {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ff9ee3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(31px, 10vw, 48px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  max-width: 9ch;
  margin-top: 18px;
  font-size: clamp(34px, 11vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.18;
}

.icon-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 26px rgba(155, 77, 255, 0.08);
  backdrop-filter: blur(14px);
}

.refresh-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 10, 168, 0.09), rgba(255, 255, 255, 0.055), rgba(22, 231, 255, 0.08)),
    var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(155, 77, 255, 0.1);
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.refresh-action svg {
  width: 18px;
  height: 18px;
  color: var(--aqua);
  stroke-width: 2.2;
}

.refresh-action:hover {
  border-color: var(--line-strong);
}

.refresh-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.screens {
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.screens.is-rendered {
  opacity: 1;
  transform: none;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 10, 168, 0.055), rgba(22, 231, 255, 0.035) 54%, rgba(155, 77, 255, 0.05)),
    var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 10, 168, 0.025);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  min-height: 330px;
  padding: 24px;
}

.hero::after {
  position: absolute;
  right: -60px;
  bottom: -96px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(22, 231, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(22, 231, 255, 0.16), inset 0 0 38px rgba(155, 77, 255, 0.12);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero p {
  max-width: 31ch;
  margin-top: 18px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.55;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 10, 168, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.13), rgba(22, 231, 255, 0.07));
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.chip span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255, 10, 168, 0.95);
}

.orb {
  align-self: end;
  justify-self: end;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 1px solid rgba(212, 92, 255, 0.36);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 10, 168, 0.16), rgba(155, 77, 255, 0.18) 44%, rgba(22, 231, 255, 0.08) 68%, transparent 72%);
  box-shadow: 0 0 34px rgba(155, 77, 255, 0.18);
}

.orb strong {
  font-size: 46px;
  line-height: 0.9;
}

.orb span {
  margin-top: -28px;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.metric,
.balance,
.empty,
.key-card,
.panel:not(.hero, .metric, .balance, .empty, .key-card) {
  padding: 18px;
}

.metric span,
.balance span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong,
.balance strong {
  display: block;
  margin-top: 9px;
  font-size: 21px;
  line-height: 1.1;
}

.metric small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.subscription-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 118px;
}

.subscription-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.subscription-card-title svg {
  width: 18px;
  height: 18px;
}

.subscription-card strong {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1;
}

.subscription-card small {
  color: var(--soft);
  font-size: 12px;
}

.subscription-card.is-muted strong,
.subscription-card.is-muted small {
  color: var(--muted);
}

.subscription-card.is-expired {
  border-color: rgba(255, 125, 149, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 125, 149, 0.14), rgba(255, 10, 168, 0.06)),
    var(--panel);
}

.subscription-card.is-expired .subscription-card-title,
.subscription-card.is-expired strong,
.subscription-card.is-expired small {
  color: var(--bad);
}

.tariff-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.tariff-summary span {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
}

.tariff-summary strong {
  grid-column: 1;
  font-size: 24px;
  line-height: 1.1;
}

.tariff-summary p {
  grid-column: 1;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
}

.tariff-arrow {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  color: var(--soft);
}

.tariff-sheet {
  gap: 14px;
}

.tariff-buy {
  margin-top: 0;
}

.tariff-remove {
  background: rgba(255, 255, 255, 0.045);
}

.tariff-remove .sheet-device-icon {
  color: var(--bad);
}

.device-meter {
  display: grid;
  gap: 12px;
  min-height: 118px;
  padding: 18px;
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.device-meter:active {
  transform: scale(0.98);
}

.device-meter-head,
.device-meter-title {
  display: flex;
  align-items: center;
}

.device-meter-head {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.device-meter-title {
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 750;
}

.device-meter-title svg {
  width: 18px;
  height: 18px;
}

.device-meter-arrow {
  width: 18px;
  height: 18px;
  color: rgba(221, 210, 248, 0.62);
}

.device-meter strong {
  font-size: 22px;
  line-height: 1;
}

.device-meter-bar {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.device-meter-bar span {
  display: block;
  min-width: 6px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3) 52%, var(--accent-2));
  box-shadow: 0 0 18px rgba(255, 10, 168, 0.44), 0 0 22px rgba(22, 231, 255, 0.24);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(2, 3, 10, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 160ms ease;
}

.modal-backdrop.is-static {
  animation: none;
}

.devices-sheet {
  position: fixed;
  right: max(0px, calc(50% - 260px));
  bottom: 0;
  left: max(0px, calc(50% - 260px));
  z-index: 21;
  display: grid;
  gap: 18px;
  max-height: min(74vh, 560px);
  padding: 20px 20px calc(20px + var(--tg-bottom));
  border: 1px solid rgba(222, 206, 255, 0.16);
  border-radius: 24px 24px 0 0;
  background:
    linear-gradient(145deg, rgba(255, 10, 168, 0.06), rgba(22, 231, 255, 0.045)),
    rgba(10, 13, 26, 0.96);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.54), 0 0 42px rgba(155, 77, 255, 0.12);
  animation: sheetUp 180ms ease;
  overflow: auto;
}

.devices-sheet.is-static {
  animation: none;
}

.devices-sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.devices-sheet-head h3 {
  margin-top: 8px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devices-sheet-head p {
  margin-top: 10px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.sheet-close {
  min-height: 40px;
  border-radius: 999px;
}

.sheet-close {
  display: grid;
  width: 40px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
}

.sheet-close svg {
  width: 20px;
  height: 20px;
}

.devices-sheet-list {
  display: grid;
  gap: 12px;
}

.sheet-device,
.sheet-buy {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(222, 206, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.sheet-device-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(155, 77, 255, 0.34), rgba(22, 231, 255, 0.12));
  color: var(--accent-2);
}

.sheet-device-icon svg {
  width: 19px;
  height: 19px;
}

.sheet-device strong,
.sheet-device small {
  display: block;
}

.sheet-device strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-device small,
.sheet-buy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-device button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
}

.sheet-device button svg {
  width: 18px;
  height: 18px;
}

.sheet-buy {
  grid-template-columns: 42px 1fr auto 18px;
  width: 100%;
  text-align: left;
}

.sheet-buy strong {
  line-height: 1.25;
}

.sheet-buy > svg {
  width: 18px;
  height: 18px;
  color: var(--soft);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

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

.section-head p,
.balance p,
.empty p {
  max-width: 24ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tariffs,
.quick-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.amount-field {
  display: grid;
  gap: 8px;
}

.amount-field span {
  color: var(--soft);
  font-size: 14px;
}

.amount-field input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  outline: none;
}

.amount-field input:focus {
  border-color: var(--line-strong);
}

.tariff,
.quick-pay button {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 10, 168, 0.045), rgba(255, 255, 255, 0.045), rgba(22, 231, 255, 0.035));
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.tariff:active,
.quick-pay button:active,
.primary:active,
.secondary:active,
.tab:active,
.icon-button:active,
.refresh-action:active {
  transform: scale(0.98);
}

.tariff.is-selected,
.quick-pay .is-selected {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(255, 10, 168, 0.22), rgba(155, 77, 255, 0.16) 48%, rgba(22, 231, 255, 0.11));
  box-shadow: 0 0 24px rgba(255, 10, 168, 0.12), inset 0 1px rgba(255, 255, 255, 0.08);
}

.tariff span,
.quick-pay span {
  color: var(--soft);
  font-size: 14px;
}

.tariff strong,
.quick-pay strong {
  display: block;
  margin-top: 13px;
  font-size: 28px;
  line-height: 1;
}

.tariff small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease;
}

.primary {
  background: linear-gradient(135deg, #ff0aa8 0%, #9b4dff 48%, #16e7ff 100%);
  color: #060711;
  font-weight: 800;
  box-shadow: 0 0 28px rgba(255, 10, 168, 0.18), 0 0 36px rgba(22, 231, 255, 0.1);
}

.secondary {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.08), rgba(22, 231, 255, 0.045));
  color: var(--soft);
  font-weight: 700;
}

.notice {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.07), rgba(22, 231, 255, 0.045));
  color: var(--soft);
  font-size: 14px;
}

.notice-success {
  border-color: rgba(116, 240, 179, 0.35);
  color: var(--good);
}

.notice-error {
  border-color: rgba(255, 125, 149, 0.35);
  color: var(--bad);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--tg-bottom));
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 10, 168, 0.32);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 10, 168, 0.18), rgba(155, 77, 255, 0.18) 52%, rgba(22, 231, 255, 0.14)),
    rgba(9, 10, 23, 0.92);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 0 28px rgba(255, 10, 168, 0.16), 0 0 34px rgba(22, 231, 255, 0.12);
  transform: translateX(-50%);
  animation: toastIn 170ms ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  text-align: center;
}

.empty svg {
  width: 54px;
  height: 54px;
  color: #d45cff;
}

.empty h2 {
  max-width: 12ch;
  margin-top: 18px;
  font-size: 36px;
}

.key-box {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  max-height: 190px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.34), rgba(155, 77, 255, 0.07));
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  transition: filter 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.key-box:hover {
  border-color: rgba(222, 206, 255, 0.3);
}

.key-box::after {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  content: "Нажмите, чтобы показать или скрыть ключ";
}

.key-box:active {
  transform: scale(0.995);
}

.key-box-blurred {
  filter: blur(4px);
  user-select: none;
}

.key-list {
  display: grid;
  gap: 14px;
}

.legacy-replace {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 125, 149, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 125, 149, 0.1), rgba(255, 10, 168, 0.055));
}

.legacy-replace strong {
  color: var(--text);
  font-size: 16px;
}

.legacy-replace p {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.legacy-replace .primary {
  margin-top: 4px;
}

.key-item {
  display: grid;
  gap: 10px;
}

.key-item > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.key-item .primary {
  margin-top: 0;
}

.actions {
  display: grid;
  gap: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 12px;
}

.stepper button {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 26px;
}

.stepper strong {
  display: grid;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(255, 10, 168, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.14), rgba(22, 231, 255, 0.08));
  font-size: 34px;
}

.device,
.empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.device + .device {
  margin-top: 10px;
}

.device span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.34), rgba(22, 231, 255, 0.24));
}

.device div {
  min-width: 0;
  flex: 1;
}

.device strong,
.device small {
  display: block;
}

.device strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device small,
.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.device button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 125, 149, 0.12);
  color: var(--bad);
  font-size: 20px;
}

.balance strong {
  margin: 10px 0;
  font-size: clamp(48px, 16vw, 78px);
}

.tabbar {
  position: fixed;
  right: max(14px, calc(50% - 246px));
  bottom: calc(12px + var(--tg-bottom));
  left: max(14px, calc(50% - 246px));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(222, 206, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(11, 8, 25, 0.88), rgba(19, 10, 35, 0.8), rgba(6, 18, 27, 0.82));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46), 0 0 28px rgba(155, 77, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.referral-card {
  display: grid;
  gap: 16px;
}

.referral-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.referral-stats div,
.referral-link {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.referral-stats span,
.referral-link span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.referral-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.referral-link {
  display: grid;
  gap: 10px;
}

.referral-link button {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid rgba(222, 206, 255, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--soft);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 48px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: background 170ms ease, color 170ms ease, transform 170ms ease;
}

.tab span {
  display: none;
  font-size: 12px;
  font-weight: 800;
}

.tab.is-active {
  background: linear-gradient(135deg, rgba(255, 10, 168, 0.96), rgba(155, 77, 255, 0.94) 54%, rgba(22, 231, 255, 0.94));
  color: #060711;
  box-shadow: 0 0 26px rgba(255, 10, 168, 0.2), 0 0 22px rgba(22, 231, 255, 0.12);
}

@media (min-width: 460px) {
  .app {
    padding-inline: 22px;
  }

  .tab span,
  .tab.is-active span {
    display: inline;
  }
}

@media (max-width: 430px) {
  .refresh-action {
    width: 42px;
    padding: 0;
  }

  .refresh-action span {
    display: none;
  }
}

@media (max-width: 370px) {
  .app {
    padding-inline: 12px;
  }

  .two,
  .tariffs,
  .quick-pay,
  .actions {
    grid-template-columns: 1fr;
  }

  .hero,
  .metric,
  .balance,
  .empty,
  .key-card,
  .panel:not(.hero, .metric, .balance, .empty, .key-card) {
    padding: 16px;
  }

  .tabbar {
    left: 10px;
    right: 10px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .ambient-a,
  .ambient-b,
  .edge-left,
  .edge-right {
    animation: none;
  }
}
