@font-face {
  font-family: "SF Pro Display";
  src: url("./fonts/San Francisco Pro Display/SF-Pro-Display-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("./fonts/San Francisco Pro Display/SF-Pro-Display-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("./fonts/San Francisco Pro Display/SF-Pro-Display-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SF Pro Display";
  src: url("./fonts/San Francisco Pro Display/SF-Pro-Display-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-0: #070b13;
  --bg-1: #0c111b;
  --bg-2: #13233a;
  --text: #f4f8ff;
  --text-dim: #90a2bf;
  --panel-bg: #0f1724;
  --panel-border: #223149;
  --panel-bg-soft: #121d2d;
  --glass: rgba(18, 30, 50, 0.56);
  --glass-strong: rgba(24, 39, 64, 0.76);
  --glass-border: rgba(169, 198, 255, 0.18);
  --glass-border-strong: rgba(169, 198, 255, 0.3);
  --primary: #2ea6ff;
  --primary-soft: rgba(46, 166, 255, 0.21);
  --success: #37d67a;
  --warning: #ffbe4f;
  --danger: #ff6f91;
  --shadow: 0 20px 50px rgba(1, 6, 18, 0.56);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  position: relative;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 10px 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -28vmax;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}

body::before {
  background:
    radial-gradient(120% 130% at 12% 8%, rgba(18, 38, 92, 0.34) 0%, rgba(18, 38, 92, 0) 58%),
    radial-gradient(120% 130% at 88% 92%, rgba(8, 27, 82, 0.3) 0%, rgba(8, 27, 82, 0) 64%);
  opacity: 0.72;
  animation: bg-green-drift 16s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(125% 145% at 18% 12%, rgba(34, 78, 180, 0.28) 0%, rgba(34, 78, 180, 0) 58%),
    radial-gradient(125% 145% at 82% 88%, rgba(11, 38, 112, 0.34) 0%, rgba(11, 38, 112, 0) 62%),
    linear-gradient(140deg, rgba(2, 5, 14, 0.84) 0%, rgba(6, 17, 45, 0.9) 52%, rgba(3, 8, 24, 0.86) 100%);
  opacity: 0.14;
  animation: bg-turquoise-flow 20s ease-in-out infinite, bg-turquoise-drift 26s ease-in-out infinite alternate;
}

.wire-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  --wire-disperse: 0;
}

.wire-svg {
  width: 100%;
  height: 100%;
  display: block;
  opacity: calc(0.86 - (var(--wire-disperse) * 1.04));
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.22));
  will-change: opacity;
}

.wire-bg.is-wire-hidden .wire-svg {
  opacity: 0;
  filter: none;
}

.wire-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.wire-particle {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  opacity: 0;
  transform: translate3d(-999px, -999px, 0);
  background: radial-gradient(
    circle at 34% 30%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(77, 139, 243, 0.9) 46%,
    rgba(213, 43, 30, 0.34) 78%,
    rgba(213, 43, 30, 0) 100%
  );
  box-shadow: 0 0 9px rgba(77, 139, 243, 0.26);
  will-change: transform, opacity;
}

.wire-particle.is-alt {
  background: radial-gradient(
    circle at 34% 30%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(213, 43, 30, 0.86) 46%,
    rgba(0, 57, 166, 0.32) 78%,
    rgba(0, 57, 166, 0) 100%
  );
  box-shadow: 0 0 9px rgba(213, 43, 30, 0.22);
}

.wire-track {
  --wire-shift-y: 25vh;
  --wire-sag-scale: 1;
  transform-origin: 50% 0%;
  animation: wire-drift 16s ease-in-out infinite alternate;
}

.wire-track-mid {
  animation-delay: -5s;
}

.wire-track-bottom {
  animation-delay: -10s;
}

.wire {
  fill: none;
  stroke-width: 10.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}

.wire-track-top .wire {
  stroke: #ffffff;
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 9px rgba(255, 255, 255, 0.82));
}

.wire-track-mid .wire {
  stroke: #2d7dff;
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 9px rgba(45, 125, 255, 0.9));
}

.wire-track-bottom .wire {
  stroke: #ff3c2d;
  filter:
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 9px rgba(255, 60, 45, 0.88));
}

.wire-a {
  opacity: 1;
}

.wire-b {
  opacity: 0.93;
}

.app-shell {
  position: relative;
  width: min(440px, 100%);
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 4px 0 calc(112px + var(--safe-bottom));
}

.glass-panel {
  background:
    linear-gradient(175deg, rgba(35, 54, 86, 0.7) 0%, rgba(12, 21, 37, 0.64) 100%),
    var(--glass);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(16, 27, 49, 0.44),
    var(--shadow);
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
}

.header-emblem {
  width: 128px;
  height: 128px;
  border-radius: 0;
  border: none;
  background: transparent;
  object-fit: cover;
  object-position: center;
  display: block;
  box-shadow: none;
}

.hero {
  padding: 0 16px 12px;
  text-align: center;
  display: grid;
  gap: 10px;
}

#tab-home {
  min-height: calc(100vh - 96px - var(--safe-bottom));
  min-height: calc(100dvh - 96px - var(--safe-bottom));
}

#tab-home > .home-quick-actions {
  margin-top: auto;
  padding-top: 4px;
  margin-bottom: 8px;
}

#tab-home > .home-tariff-plans {
  margin-top: auto;
  padding-top: 4px;
  margin-bottom: 8px;
}

.home-quick-actions {
  display: grid;
  gap: 12px;
}

.home-quick-actions.is-hidden {
  display: none;
}

.home-tariff-plans {
  display: none;
  gap: 10px;
}

.home-tariff-plans.is-visible {
  display: grid;
  justify-items: center;
}

.home-tariff-card {
  width: min(100%, 94%);
  border-radius: 24px;
  border: 1px solid rgba(125, 174, 246, 0.42);
  background:
    linear-gradient(162deg, rgba(36, 48, 74, 0.88) 0%, rgba(25, 36, 56, 0.95) 58%, rgba(17, 26, 43, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 12px 24px rgba(6, 11, 20, 0.38);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label price"
    "value price";
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
}

.home-tariff-card .home-tariff-label {
  grid-area: label;
  color: rgba(208, 224, 247, 0.86);
  font-size: clamp(13px, 3.7vw, 15px);
  line-height: 1.15;
}

.home-tariff-card strong {
  grid-area: value;
  font-size: clamp(19px, 5.2vw, 24px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.home-tariff-card .home-tariff-price {
  grid-area: price;
  justify-self: end;
  white-space: nowrap;
  color: rgba(88, 242, 191, 0.98);
  font-size: clamp(17px, 4.8vw, 21px);
  line-height: 1.15;
  font-weight: 800;
}

.home-tariff-card-custom {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.home-tariff-card-custom:hover {
  border-color: rgba(167, 210, 255, 0.74);
  background:
    linear-gradient(162deg, rgba(42, 57, 88, 0.9) 0%, rgba(30, 42, 65, 0.96) 58%, rgba(20, 31, 51, 0.99) 100%);
  transform: translateY(-1px);
}

.home-tariff-card-custom:focus-visible {
  outline: none;
  border-color: rgba(214, 233, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 0 1px rgba(194, 221, 255, 0.32),
    0 12px 24px rgba(6, 11, 20, 0.38);
}

.quick-action {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 28px;
  color: #f7fcff;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.quick-action:hover {
  transform: translateY(-1px);
}

.quick-action:active {
  transform: translateY(0) scale(0.985);
}

.quick-action-left {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.quick-icon {
  width: clamp(20px, 5.2vw, 30px);
  height: clamp(20px, 5.2vw, 30px);
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-icon-img {
  object-fit: contain;
  display: block;
  filter:
    brightness(0) saturate(100%) invert(94%) sepia(11%) saturate(277%) hue-rotate(181deg) brightness(104%) contrast(102%);
}

.quick-action-title {
  display: block;
  font-size: clamp(18px, 5.4vw, 31px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.quick-action-tail {
  display: block;
  font-size: clamp(13px, 3.8vw, 24px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: rgba(230, 241, 245, 0.96);
  white-space: nowrap;
}

.quick-action-install {
  min-height: 68px;
  border-color: rgba(124, 173, 245, 0.52);
  background:
    linear-gradient(160deg, rgba(35, 47, 70, 0.88) 0%, rgba(25, 36, 56, 0.95) 58%, rgba(17, 26, 43, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(6, 11, 20, 0.42);
}

.quick-action-install:hover {
  border-color: rgba(176, 209, 255, 0.82);
  background:
    linear-gradient(160deg, rgba(40, 55, 82, 0.92) 0%, rgba(30, 43, 67, 0.96) 58%, rgba(20, 32, 52, 1) 100%);
}

.quick-action-install.is-blinking,
.hero-renew-btn.is-blinking {
  animation: quick-install-blink 2.35s ease-in-out infinite;
}

.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-action-secondary {
  min-height: 68px;
  justify-content: flex-start;
  border-color: rgba(206, 219, 255, 0.24);
  background:
    linear-gradient(160deg, rgba(79, 69, 84, 0.56) 0%, rgba(47, 48, 63, 0.9) 58%, rgba(27, 30, 44, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.quick-action-secondary .quick-action-title {
  max-width: 9ch;
  font-size: clamp(16px, 4.5vw, 30px);
  line-height: 1.1;
}

.quick-action-secondary:hover {
  border-color: rgba(224, 233, 255, 0.42);
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -8px;
}

.status-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-chip.is-ok {
  background: rgba(55, 214, 122, 0.2);
  color: #86ffbe;
  border-color: rgba(55, 214, 122, 0.5);
}

.status-chip.is-warn {
  background: rgba(255, 190, 79, 0.18);
  color: #ffd68d;
  border-color: rgba(255, 190, 79, 0.44);
}

.status-chip.is-expired {
  background: rgba(255, 111, 145, 0.17);
  color: #ffadc2;
  border-color: rgba(255, 111, 145, 0.44);
}

.status-chip.is-expired-actions {
  padding: 5px 12px;
  gap: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 16px rgba(8, 11, 18, 0.22);
  backdrop-filter: blur(8px) saturate(1.35);
  -webkit-backdrop-filter: blur(8px) saturate(1.35);
}

.status-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  opacity: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  padding: 0;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.status-action-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-action-btn .status-icon-chat {
  stroke-width: 1.75;
}

.status-action-btn .status-icon-exit {
  stroke-width: 2.1;
}

.status-action-btn .status-icon-dot {
  fill: currentColor;
  stroke: none;
}

.status-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

.status-action-btn:active {
  transform: scale(0.94);
}

.pill {
  border-radius: 999px;
  border: 1px solid #2a3d5a;
  color: #c4d6f4;
  background: #162338;
  padding: 6px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.is-warning {
  color: #ffd896;
  border-color: rgba(255, 190, 79, 0.38);
}

.hero-caption {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.hero-value {
  margin: 0;
  font-size: clamp(36px, 11vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  column-gap: 10px;
}

.hero-part {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.hero-part-left {
  justify-self: end;
}

.hero-part-right {
  justify-self: start;
}

.hero-unit {
  font-size: 0.46em;
  font-weight: 600;
  color: #c8d8f3;
}

.hero-divider {
  display: inline-block;
  width: 1px;
  height: 0.94em;
  margin: 0;
  background: #8da7cc;
  opacity: 0.9;
  align-self: center;
}

.hero-metrics {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-renew-btn {
  min-height: 48px;
  min-width: 154px;
  border-radius: 22px;
  border-color: rgba(206, 219, 255, 0.24);
  background:
    linear-gradient(160deg, rgba(79, 69, 84, 0.56) 0%, rgba(47, 48, 63, 0.9) 58%, rgba(27, 30, 44, 0.95) 100%);
  color: #f7fcff;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 20px rgba(8, 16, 28, 0.34);
}

.hero-renew-btn:hover {
  border-color: rgba(224, 233, 255, 0.42);
  background:
    linear-gradient(160deg, rgba(86, 77, 92, 0.56) 0%, rgba(52, 52, 70, 0.9) 58%, rgba(31, 34, 49, 0.95) 100%);
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: #151f31;
  color: #9eb4d7;
  font-size: 13px;
  line-height: 1;
  padding: 6px 11px;
}

.metric-badge strong {
  color: #dbe8fb;
  font-weight: 600;
}

.progress-wrap {
  margin-top: 4px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #1b2a40;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ac5ff 0%, #2ea6ff 52%, #4f8dff 100%);
  transition: width 0.25s ease;
}

.tab-pane {
  display: none;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
}

.tab-pane.is-active {
  display: grid;
  animation: rise 0.25s ease;
}

#tab-connect.tab-pane-products {
  min-height: calc(100vh - 96px - var(--safe-bottom));
  min-height: calc(100dvh - 96px - var(--safe-bottom));
  align-content: center;
}

.products-placeholder {
  width: min(100%, 94%);
  margin: 0 auto;
  min-height: clamp(240px, 48vh, 380px);
  border-radius: 28px;
  border: 1px solid rgba(124, 173, 245, 0.42);
  background:
    radial-gradient(130% 120% at 88% 92%, rgba(53, 112, 208, 0.16) 0%, rgba(53, 112, 208, 0) 58%),
    linear-gradient(162deg, rgba(26, 39, 62, 0.9) 0%, rgba(19, 30, 48, 0.96) 58%, rgba(14, 23, 39, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 16px 30px rgba(6, 11, 20, 0.38);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.products-placeholder h2 {
  margin: 0;
  font-size: clamp(30px, 8.2vw, 44px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.products-placeholder p {
  margin: 0;
  color: rgba(186, 207, 238, 0.88);
  font-size: clamp(14px, 4vw, 18px);
}

.products-placeholder-icon {
  width: clamp(72px, 20vw, 104px);
  height: clamp(72px, 20vw, 104px);
  border-radius: 50%;
  border: 1px solid rgba(171, 207, 255, 0.44);
  background: linear-gradient(160deg, rgba(51, 90, 146, 0.34) 0%, rgba(25, 47, 84, 0.62) 100%);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(127, 183, 255, 0.24),
    0 12px 22px rgba(8, 16, 30, 0.34);
}

.products-placeholder-icon svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: rgba(244, 250, 255, 0.96);
  stroke-width: 2.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(92, 163, 255, 0.3));
}

.products-placeholder-icon-img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  display: block;
  filter:
    brightness(0) saturate(100%) invert(97%) sepia(12%) saturate(278%) hue-rotate(180deg) brightness(104%) contrast(102%)
    drop-shadow(0 0 10px rgba(92, 163, 255, 0.3));
}

.products-legacy-content {
  display: none !important;
}

#tab-home.tab-pane.is-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  padding: 14px;
  display: grid;
  gap: 12px;
  border-radius: 20px;
  background: var(--panel-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-no-bg {
  background: transparent;
  border: none;
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
}

.wallet {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.wallet-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-balance-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%) invert(83%) sepia(27%) saturate(2294%) hue-rotate(334deg) brightness(101%) contrast(97%);
}

.wallet-balance strong {
  display: block;
  margin-top: 0;
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

select,
.btn,
.platform-btn {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #304462;
  background: #182439;
  color: #deecff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

select {
  appearance: none;
  cursor: pointer;
  padding: 0 34px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, #8ca8d4 50%),
    linear-gradient(135deg, #8ca8d4 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 14px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.platform-btn:hover,
select:hover {
  border-color: #3a5377;
  background-color: #1b2b44;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #40b4ff 0%, #2f97ef 100%);
  border-color: transparent;
  color: #ffffff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #50bfff 0%, #2f97ef 100%);
}

.btn-muted {
  background: #111a2a;
}

.promo-banner {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(255, 220, 145, 0.48);
  background: linear-gradient(110deg, #ff5d05 0%, #f9ac00 55%, #ffcc00 100%);
  color: #fff;
  padding: 14px;
  display: block;
  box-shadow: 0 14px 30px rgba(255, 161, 38, 0.28);
}

.promo-banner strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
}

.promo-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
}

.promo-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.promo-dismiss:hover {
  background: rgba(255, 255, 255, 0.38);
}

.promo-invite {
  margin-top: 10px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.promo-invite:hover {
  background: rgba(255, 255, 255, 0.3);
}

.promo-banner.is-hidden {
  display: none;
}

.renew-mode {
  position: relative;
  display: inline-flex;
  align-self: center;
  width: max-content;
  margin: 0 auto;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #121b2b;
  overflow: hidden;
}

.renew-mode-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: #5b6373;
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.renew-mode-btn {
  position: relative;
  border: none;
  background: transparent;
  color: #9db2cf;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 1;
}

.renew-mode-btn.is-active {
  color: #f1f7ff;
}

.renew-mode-btn:hover {
  color: #d6e7ff;
}

.renew-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.renew-card {
  border-radius: 16px;
  background: var(--panel-bg-soft);
  padding: 11px;
  display: grid;
  grid-template-rows: minmax(2.35em, auto) auto;
  gap: 8px;
}

.renew-card strong {
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.16;
}

.renew-value-line {
  display: block;
}

.cost-star-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%) invert(83%) sepia(27%) saturate(2294%) hue-rotate(334deg) brightness(101%) contrast(97%);
}

.renew-buy-btn {
  gap: 8px;
  font-weight: 700;
  padding: 0 12px;
}

.renew-buy-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffd48b;
}

.renew-card .btn {
  margin-top: 2px;
}

.platform-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-btn {
  cursor: pointer;
  padding: 0 12px;
  text-transform: capitalize;
}

.platform-btn.is-active {
  border-color: rgba(70, 172, 255, 0.45);
  background: rgba(46, 166, 255, 0.18);
  color: #def0ff;
}

.instruction-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.instruction-col {
  border-radius: 16px;
  border: 1px solid #2a3c58;
  background: var(--panel-bg-soft);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.instruction-col a {
  color: #7ec8ff;
  text-decoration: none;
}

.instruction-col a:hover {
  color: #a1dbff;
}

code {
  display: block;
  border-radius: 11px;
  border: 1px solid #2b3d58;
  background: #0d1523;
  color: #a6ccff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 9px;
  word-break: break-all;
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: #9fb4d4;
  font-size: 14px;
}

.steps li + li {
  margin-top: 6px;
}

.server-list {
  display: grid;
  gap: 10px;
}

.server-card {
  border-radius: 16px;
  border: 1px solid #2a3c58;
  background: var(--panel-bg-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.server-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.server-row strong {
  letter-spacing: -0.01em;
}

.server-meta {
  display: flex;
  gap: 10px;
  color: #97abc8;
  font-size: 13px;
  flex-wrap: wrap;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.state-ok {
  background: var(--success);
}

.state-bad {
  background: var(--danger);
}

#tab-profile {
  min-height: calc(100vh - 96px - var(--safe-bottom));
  min-height: calc(100dvh - 96px - var(--safe-bottom));
}

#tab-profile.tab-pane.is-active {
  display: flex;
  flex-direction: column;
}

.profile-screen {
  width: min(100%, 94%);
  margin: clamp(16px, 4.2vh, 38px) auto 0;
  display: grid;
  gap: 12px;
}

.profile-screen-head {
  display: grid;
  gap: 2px;
  padding: 4px 10px 2px;
}

.profile-screen-head h2 {
  margin: 0;
  font-size: clamp(31px, 8.1vw, 42px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.profile-screen-head p {
  margin: 0;
  color: rgba(183, 204, 236, 0.84);
  font-size: clamp(14px, 3.8vw, 18px);
}

.profile-panel {
  border-radius: 24px;
  border: 1px solid rgba(108, 171, 255, 0.34);
  background:
    radial-gradient(130% 120% at 90% 96%, rgba(31, 127, 117, 0.19) 0%, rgba(31, 127, 117, 0) 58%),
    linear-gradient(160deg, rgba(17, 45, 56, 0.92) 0%, rgba(11, 33, 45, 0.95) 58%, rgba(9, 25, 38, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 16px 30px rgba(2, 11, 18, 0.36);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.profile-panel h3 {
  margin: 0 0 2px;
  color: rgba(196, 217, 244, 0.9);
  font-size: clamp(18px, 4.8vw, 23px);
  letter-spacing: -0.01em;
  font-weight: 650;
}

.profile-info-row,
.profile-auth-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.profile-info-row span,
.profile-auth-row span {
  color: rgba(186, 208, 234, 0.84);
  font-size: clamp(13px, 3.5vw, 16px);
}

.profile-info-row strong,
.profile-auth-row strong {
  color: #f2f8ff;
  font-size: clamp(16px, 4.3vw, 21px);
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-support-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-copy-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(168, 206, 247, 0.44);
  background: rgba(255, 255, 255, 0.07);
  color: #e9f3ff;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.profile-copy-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(208, 231, 255, 0.72);
}

.profile-copy-btn:active {
  transform: scale(0.96);
}

.profile-auth-status.is-connected {
  color: #82ffd0;
}

.profile-auth-status.is-unbound {
  color: rgba(176, 194, 217, 0.86);
}

.profile-bind-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 20px;
  border-color: rgba(138, 190, 234, 0.48);
  background:
    linear-gradient(160deg, rgba(64, 82, 90, 0.74) 0%, rgba(52, 72, 81, 0.82) 58%, rgba(43, 61, 70, 0.9) 100%);
  color: #f3f8ff;
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-bind-btn:hover {
  border-color: rgba(181, 220, 255, 0.78);
  background:
    linear-gradient(160deg, rgba(75, 95, 106, 0.82) 0%, rgba(60, 82, 93, 0.9) 58%, rgba(49, 69, 80, 0.96) 100%);
}

.profile-bind-btn:disabled {
  opacity: 0.66;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

body.is-install-modal-open {
  overflow: hidden;
}

body.is-invite-modal-open {
  overflow: hidden;
}

body.is-topup-modal-open {
  overflow: hidden;
}

.invite-modal {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  padding: 8px 8px calc(10px + var(--safe-bottom));
  background: rgba(1, 6, 17, 0.66);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.invite-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.invite-modal-panel {
  position: relative;
  width: min(440px, 100%);
  height: min(calc(100vh - 16px - var(--safe-bottom)), 760px);
  height: min(calc(100dvh - 16px - var(--safe-bottom)), 760px);
  margin: auto;
  border-radius: 30px;
  border: 1px solid rgba(142, 188, 255, 0.28);
  background:
    radial-gradient(140% 130% at 96% 94%, rgba(170, 109, 90, 0.32) 0%, rgba(170, 109, 90, 0) 56%),
    radial-gradient(120% 120% at 8% 6%, rgba(26, 121, 208, 0.2) 0%, rgba(26, 121, 208, 0) 58%),
    linear-gradient(162deg, rgba(17, 34, 64, 0.96) 0%, rgba(14, 25, 47, 0.98) 56%, rgba(16, 20, 34, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 56px rgba(2, 7, 18, 0.64);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  gap: 8px;
}

.invite-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(207, 224, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf3ff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 1;
}

.invite-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(233, 244, 255, 0.56);
}

.invite-modal-head {
  display: grid;
  gap: 2px;
  padding: 0 8px 0;
}

.invite-modal-head h2 {
  margin: 0;
  font-size: clamp(24px, 5.8vw, 32px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.invite-modal-head p {
  margin: 0;
  color: rgba(183, 204, 236, 0.84);
  font-size: clamp(13px, 3.2vw, 15px);
}

.invite-stats-card,
.invite-links-card {
  border-radius: 20px;
  border: 1px solid rgba(108, 171, 255, 0.28);
  background:
    linear-gradient(160deg, rgba(20, 34, 49, 0.92) 0%, rgba(14, 24, 38, 0.95) 58%, rgba(10, 17, 29, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.invite-stats-card {
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.invite-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

.invite-stats-row span {
  color: rgba(203, 221, 245, 0.84);
  font-size: clamp(12px, 3.2vw, 14px);
}

.invite-stats-row strong {
  color: #f2f8ff;
  font-size: clamp(14px, 3.7vw, 17px);
  font-weight: 700;
}

.invite-stats-note {
  margin: 0;
  color: rgba(164, 186, 216, 0.84);
  font-size: clamp(11px, 2.9vw, 13px);
  line-height: 1.25;
}

.invite-links-card {
  padding: 10px 12px;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 8px;
}

.invite-links-card h3 {
  margin: 0;
  color: rgba(203, 221, 245, 0.9);
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 600;
}

.invite-qr-placeholder {
  width: min(clamp(132px, 23vh, 210px), 62%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px dashed rgba(159, 198, 249, 0.56);
  background: rgba(8, 16, 28, 0.42);
}

.invite-link-group {
  display: grid;
  gap: 5px;
}

.invite-link-label {
  color: rgba(178, 199, 228, 0.84);
  font-size: clamp(12px, 3.3vw, 14px);
}

.invite-link-placeholder {
  height: 34px;
  border-radius: 12px;
  border: 1px dashed rgba(159, 198, 249, 0.48);
  background: rgba(8, 16, 28, 0.46);
}

.invite-modal-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.invite-modal-action-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 22px;
  padding: 8px 12px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  font-size: clamp(14px, 3.6vw, 17px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.invite-modal-action-btn-primary {
  border-color: rgba(157, 184, 225, 0.48);
  background:
    linear-gradient(160deg, rgba(86, 102, 105, 0.74) 0%, rgba(76, 89, 95, 0.82) 58%, rgba(66, 76, 82, 0.9) 100%);
  color: #f3f8ff;
}

.invite-modal-action-btn-secondary {
  border-color: rgba(212, 193, 222, 0.46);
  background:
    linear-gradient(160deg, rgba(98, 79, 95, 0.72) 0%, rgba(83, 67, 84, 0.84) 58%, rgba(67, 54, 72, 0.9) 100%);
  color: #f6f8ff;
}

.topup-modal {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  padding: 10px 10px calc(14px + var(--safe-bottom));
  background: rgba(1, 6, 17, 0.66);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.topup-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.topup-modal-panel {
  position: relative;
  width: min(420px, 100%);
  margin: auto;
  border-radius: 30px;
  border: 1px solid rgba(142, 188, 255, 0.28);
  background:
    radial-gradient(130% 120% at 84% 92%, rgba(33, 129, 235, 0.16) 0%, rgba(33, 129, 235, 0) 56%),
    linear-gradient(165deg, rgba(14, 31, 60, 0.97) 0%, rgba(9, 21, 42, 0.98) 58%, rgba(6, 14, 30, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 56px rgba(2, 7, 18, 0.62);
  padding: 24px 14px 16px;
  display: grid;
  gap: 12px;
}

.topup-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(207, 224, 255, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf3ff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.topup-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(233, 244, 255, 0.56);
}

.topup-modal-head {
  display: grid;
  gap: 4px;
  padding: 2px 8px 0;
}

.topup-modal-head h2 {
  margin: 0;
  font-size: clamp(26px, 6.4vw, 33px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.topup-modal-head p {
  margin: 0;
  color: rgba(183, 204, 236, 0.86);
  font-size: clamp(14px, 3.6vw, 17px);
}

.topup-form {
  display: grid;
  gap: 8px;
}

.topup-label {
  color: rgba(203, 221, 245, 0.88);
  font-size: 14px;
  font-weight: 600;
  padding-left: 2px;
}

.topup-input-wrap {
  position: relative;
}

.topup-input {
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(123, 171, 245, 0.52);
  background:
    linear-gradient(160deg, rgba(29, 45, 74, 0.9) 0%, rgba(20, 33, 55, 0.95) 58%, rgba(15, 25, 43, 0.98) 100%);
  color: #f7fcff;
  font: inherit;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 48px 0 16px;
}

.topup-input:hover {
  border-color: rgba(175, 210, 255, 0.72);
}

.topup-input:focus {
  outline: none;
  border-color: rgba(214, 233, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(194, 221, 255, 0.34),
    0 10px 18px rgba(8, 16, 28, 0.28);
}

.topup-input[aria-invalid="true"] {
  border-color: rgba(255, 119, 119, 0.84);
}

.topup-input-currency {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(228, 241, 255, 0.92);
  font-size: 21px;
  font-weight: 700;
  pointer-events: none;
}

.topup-hint {
  margin: 0;
  color: rgba(167, 194, 229, 0.84);
  font-size: 13px;
  line-height: 1.28;
}

.topup-error {
  margin: 0;
  min-height: 18px;
  color: #ffb0c0;
  font-size: 13px;
  line-height: 1.25;
  opacity: 0;
}

.topup-error.is-visible {
  opacity: 1;
}

.topup-submit-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 22px;
  border-color: rgba(124, 173, 245, 0.52);
  background:
    linear-gradient(160deg, rgba(35, 47, 70, 0.88) 0%, rgba(25, 36, 56, 0.95) 58%, rgba(17, 26, 43, 0.98) 100%);
  color: #f7fcff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(6, 11, 20, 0.42);
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 700;
  letter-spacing: -0.01em;
  justify-content: center;
}

.topup-submit-btn:hover {
  border-color: rgba(176, 209, 255, 0.82);
  background:
    linear-gradient(160deg, rgba(40, 55, 82, 0.92) 0%, rgba(30, 43, 67, 0.96) 58%, rgba(20, 32, 52, 1) 100%);
}

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  padding: 10px 10px calc(14px + var(--safe-bottom));
  background: rgba(1, 6, 17, 0.64);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.install-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.install-modal-panel {
  position: relative;
  width: min(440px, 100%);
  min-height: min(92vh, 760px);
  min-height: min(92dvh, 760px);
  margin: auto;
  border-radius: 30px;
  border: 1px solid rgba(142, 188, 255, 0.28);
  background:
    radial-gradient(130% 120% at 80% 86%, rgba(61, 114, 207, 0.17) 0%, rgba(61, 114, 207, 0) 56%),
    linear-gradient(165deg, rgba(14, 31, 60, 0.97) 0%, rgba(9, 21, 42, 0.98) 58%, rgba(6, 14, 30, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 24px 56px rgba(2, 7, 18, 0.62);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 18px;
}

.install-modal-panel::before {
  content: "";
  position: absolute;
  inset: auto -18% -24%;
  height: 48%;
  background: radial-gradient(circle, rgba(60, 134, 255, 0.2) 0%, rgba(60, 134, 255, 0) 68%);
  pointer-events: none;
}

.install-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(207, 224, 255, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf3ff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 1;
}

.install-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(233, 244, 255, 0.56);
}

.install-modal-head {
  text-align: center;
  display: grid;
  gap: 8px;
  padding: 4px 20px 0;
}

.install-modal-head h2 {
  margin: 0;
  font-size: clamp(26px, 6.2vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.install-modal-head p {
  margin: 0;
  color: rgba(183, 204, 236, 0.86);
  font-size: clamp(14px, 3.3vw, 17px);
  line-height: 1.35;
}

.install-modal-visual {
  margin: auto;
  width: clamp(240px, 64vw, 320px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
}

.install-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.6px solid rgba(102, 169, 255, 0.23);
  transition: border-color 0.32s ease, box-shadow 0.32s ease;
}

.install-ring-outer {
  inset: 6%;
}

.install-ring-mid {
  inset: 16%;
}

.install-icon-wrap {
  width: 44%;
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(179, 216, 255, 0.36);
  background: linear-gradient(170deg, rgba(37, 67, 113, 0.45) 0%, rgba(16, 32, 63, 0.72) 100%);
  display: grid;
  place-items: center;
  overflow: visible;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 20px rgba(64, 132, 245, 0.26);
}

.install-emblem {
  width: 110%;
  height: 110%;
  object-fit: contain;
  display: block;
  filter:
    brightness(0) saturate(100%) invert(91%) sepia(17%) saturate(129%) hue-rotate(178deg) brightness(102%) contrast(102%)
    drop-shadow(0 0 10px rgba(89, 149, 247, 0.28));
}

.install-download-icon {
  width: 74%;
  height: 74%;
  display: none;
  fill: none;
  stroke: #f4fbff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(100, 161, 255, 0.34));
}

.install-next-icon {
  width: 74%;
  height: 74%;
  display: none;
  fill: none;
  stroke: #f5fcff;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(97, 163, 255, 0.36));
}

.install-check-icon {
  width: 74%;
  height: 74%;
  display: none;
  position: relative;
  z-index: 2;
  fill: none;
  stroke: #f5fcff;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(255, 98, 98, 0.4));
}

.install-burst {
  position: absolute;
  inset: -18%;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.install-burst-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(22px, 6.2vw, 36px);
  height: clamp(22px, 6.2vw, 36px);
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--burst-scale-from, 0.24)) rotate(0deg);
  filter: drop-shadow(0 6px 12px rgba(3, 8, 18, 0.42));
  will-change: transform, opacity;
  animation: install-burst-pop var(--burst-duration, 1.45s) cubic-bezier(0.22, 0.76, 0.2, 1) var(--burst-delay, 0s)
    forwards;
}

.install-burst-icon.is-openai,
.install-burst-icon.is-telegram {
  mix-blend-mode: screen;
}

.install-modal.is-started .install-ring-outer {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 26px rgba(180, 214, 255, 0.42);
}

.install-modal.is-next-step .install-ring-mid {
  border-color: rgba(78, 156, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(78, 156, 255, 0.36),
    0 0 24px rgba(78, 156, 255, 0.48);
}

.install-modal.is-final-step .install-ring-mid {
  border-color: rgba(78, 156, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(78, 156, 255, 0.36),
    0 0 24px rgba(78, 156, 255, 0.48);
}

.install-modal.is-started .install-emblem {
  display: none;
}

.install-modal.is-started .install-download-icon {
  display: block;
}

.install-modal.is-next-step .install-download-icon {
  display: none;
}

.install-modal.is-next-step .install-next-icon {
  display: block;
}

.install-modal.is-final-step .install-ring-outer {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 26px rgba(180, 214, 255, 0.42);
}

.install-modal.is-final-step .install-icon-wrap {
  border-color: rgba(255, 86, 86, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(255, 86, 86, 0.34),
    0 0 24px rgba(255, 86, 86, 0.48);
}

.install-modal.is-final-step .install-next-icon {
  display: none;
}

.install-modal.is-final-step .install-check-icon {
  display: block;
}

.install-modal.is-final-step #install-modal-other {
  display: none;
}

@keyframes install-burst-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--burst-scale-from, 0.24)) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--burst-x, 0px)), calc(-50% + var(--burst-y, 0px)))
      scale(var(--burst-scale-to, 0.9)) rotate(var(--burst-rotate, 0deg));
  }
}

.install-modal-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.install-modal-btn {
  min-height: 52px;
  border-radius: 22px;
  border-color: rgba(124, 173, 245, 0.52);
  background:
    linear-gradient(160deg, rgba(35, 47, 70, 0.88) 0%, rgba(25, 36, 56, 0.95) 58%, rgba(17, 26, 43, 0.98) 100%);
  color: #f7fcff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 24px rgba(6, 11, 20, 0.42);
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 700;
  letter-spacing: -0.01em;
  justify-content: center;
}

.install-modal-btn-primary {
  border-color: rgba(124, 173, 245, 0.52);
  animation: quick-install-blink 2.35s ease-in-out infinite;
}

.install-modal-btn-secondary {
  border-color: rgba(124, 173, 245, 0.52);
}

.install-modal-btn:hover {
  border-color: rgba(176, 209, 255, 0.82);
  background:
    linear-gradient(160deg, rgba(40, 55, 82, 0.92) 0%, rgba(30, 43, 67, 0.96) 58%, rgba(20, 32, 52, 1) 100%);
}

.tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(0.75rem + var(--safe-bottom));
  width: min(25rem, calc(100% - 1rem));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0.5rem;
  border-radius: 3.125rem;
  overflow: hidden;
  z-index: 5;
}

.tab-slider {
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: rgba(46, 166, 255, 0.28);
  box-shadow: 0 0.3125rem 0.75rem rgba(28, 133, 233, 0.35);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.tab-btn {
  position: relative;
  border: none;
  background: transparent;
  color: #9db2cf;
  border-radius: 14px;
  min-height: 56px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  z-index: 1;
}

.tab-btn.is-active {
  color: #37a9ff;
}

.tab-btn:hover {
  color: #d2e4ff;
}

.tab-icon {
  position: relative;
  width: 22px;
  height: 22px;
  color: currentColor;
  z-index: 1;
}

.tab-icon::before,
.tab-icon::after {
  content: "";
  position: absolute;
}

.tab-icon-home::before {
  inset: 3px;
  border: 1.6px solid currentColor;
  border-radius: 6px;
}

.tab-icon-home::after {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  left: 7px;
  top: 7px;
}

.tab-icon-connect::before {
  inset: 3px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.tab-icon-connect::after {
  width: 9px;
  height: 1.6px;
  background: currentColor;
  border-radius: 999px;
  left: 6px;
  top: 10px;
  box-shadow: 0 -4px 0 0 currentColor, 0 4px 0 0 currentColor;
}

.tab-icon-servers::before {
  left: 3px;
  right: 3px;
  top: 4px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 0 currentColor, 0 10px 0 0 currentColor;
}

.tab-icon-servers::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bg-0);
  left: 5px;
  top: 3px;
  box-shadow: 0 5px 0 0 var(--bg-0), 0 10px 0 0 var(--bg-0);
}

.tab-icon-profile::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  left: 6px;
  top: 2px;
}

.tab-icon-profile::after {
  width: 13px;
  height: 7px;
  border-radius: 7px 7px 5px 5px;
  border: 1.6px solid currentColor;
  left: 4px;
  bottom: 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  min-width: 220px;
  max-width: min(420px, calc(100% - 28px));
  border-radius: 14px;
  border: 1px solid rgba(176, 204, 248, 0.28);
  background: #111b2c;
  color: #dcedff;
  text-align: center;
  padding: 10px 14px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 6;
}

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

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

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

@keyframes quick-install-blink {
  0%,
  100% {
    border-color: rgba(122, 171, 245, 0.45);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 10px 22px rgba(6, 11, 20, 0.34);
  }
  50% {
    border-color: rgba(232, 243, 255, 0.95);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 0 0 1px rgba(152, 194, 255, 0.38),
      0 14px 30px rgba(34, 90, 162, 0.5);
  }
}

@keyframes bg-turquoise-flow {
  0%,
  100% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.92;
  }
}

@keyframes bg-turquoise-drift {
  0% {
    transform: translate3d(-4%, -3%, 0) scale(1.04);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.11);
  }
  100% {
    transform: translate3d(-2%, 3%, 0) scale(1.06);
  }
}

@keyframes bg-green-drift {
  0% {
    transform: translate3d(2%, -2%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(-2%, 2%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(1%, -1%, 0) scale(1.03);
  }
}

@keyframes wire-drift {
  0% {
    transform: translateY(var(--wire-shift-y)) scaleY(var(--wire-sag-scale)) translate3d(-2%, -1%, 0);
  }
  50% {
    transform: translateY(var(--wire-shift-y)) scaleY(var(--wire-sag-scale)) translate3d(2%, 1%, 0);
  }
  100% {
    transform: translateY(var(--wire-shift-y)) scaleY(var(--wire-sag-scale)) translate3d(-1%, 2%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
  body::after {
    opacity: 0.22;
  }
  .wire-bg {
    --wire-disperse: 0;
  }
  .wire-svg {
    filter: none;
  }
  .wire-particles {
    display: none;
  }
  .wire-track,
  .wire-a,
  .wire-b,
  .quick-action-install.is-blinking,
  .hero-renew-btn.is-blinking,
  .install-modal-btn-primary {
    animation: none;
  }
}

@media (max-width: 520px) {
  body {
    padding: 0 8px 0;
  }

  .install-modal {
    padding: 8px 8px calc(12px + var(--safe-bottom));
  }

  .install-modal-panel {
    min-height: min(94vh, 720px);
    min-height: min(94dvh, 720px);
    border-radius: 24px;
    padding: 22px 12px 14px;
  }

  .install-modal-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .install-modal-head h2 {
    font-size: clamp(24px, 7.2vw, 30px);
  }

  .install-modal-head p {
    font-size: clamp(13px, 4vw, 16px);
  }

  .install-modal-btn {
    min-height: 48px;
    border-radius: 20px;
    font-size: clamp(14px, 4.4vw, 17px);
  }

  .invite-modal {
    padding: 8px 8px calc(8px + var(--safe-bottom));
  }

  .topup-modal {
    padding: 8px 8px calc(12px + var(--safe-bottom));
  }

  .topup-modal-panel {
    border-radius: 24px;
    padding: 20px 12px 14px;
    gap: 10px;
  }

  .topup-modal-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .topup-modal-head h2 {
    font-size: clamp(24px, 6.8vw, 30px);
  }

  .topup-modal-head p {
    font-size: clamp(13px, 4vw, 16px);
  }

  .topup-input {
    min-height: 48px;
    border-radius: 16px;
    font-size: 20px;
  }

  .topup-input-currency {
    font-size: 20px;
  }

  .topup-submit-btn {
    min-height: 48px;
    border-radius: 20px;
    font-size: clamp(14px, 4.4vw, 17px);
  }

  .invite-modal-panel {
    height: calc(100vh - 16px - var(--safe-bottom));
    height: calc(100dvh - 16px - var(--safe-bottom));
    border-radius: 24px;
    padding: 14px 10px 10px;
    gap: 7px;
  }

  .invite-modal-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .invite-modal-head h2 {
    font-size: clamp(20px, 6vw, 26px);
  }

  .invite-modal-head p {
    font-size: clamp(12px, 3.4vw, 14px);
  }

  .invite-qr-placeholder {
    width: min(clamp(118px, 20vh, 168px), 56%);
    border-radius: 12px;
  }

  .invite-link-placeholder {
    height: 32px;
  }

  .invite-modal-action-btn {
    min-height: 42px;
    border-radius: 18px;
    padding: 7px 10px;
    font-size: clamp(13px, 3.8vw, 15px);
  }

  .profile-screen {
    width: min(100%, 96%);
    margin-top: clamp(10px, 2.8vh, 22px);
    gap: 10px;
  }

  .profile-screen-head {
    padding: 2px 8px 0;
  }

  .profile-screen-head h2 {
    font-size: clamp(28px, 8vw, 34px);
  }

  .profile-screen-head p {
    font-size: clamp(13px, 3.8vw, 15px);
  }

  .profile-panel {
    border-radius: 20px;
    padding: 10px 11px;
    gap: 7px;
  }

  .profile-panel h3 {
    font-size: clamp(16px, 4.6vw, 20px);
  }

  .profile-info-row span,
  .profile-auth-row span {
    font-size: clamp(12px, 3.4vw, 14px);
  }

  .profile-info-row strong,
  .profile-auth-row strong {
    font-size: clamp(14px, 3.9vw, 17px);
  }

  .profile-support-value {
    gap: 6px;
  }

  .profile-copy-btn {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .profile-copy-btn svg {
    width: 12px;
    height: 12px;
  }

  .profile-bind-btn {
    min-height: 42px;
    border-radius: 18px;
    font-size: clamp(14px, 4vw, 16px);
  }

  .home-quick-actions {
    gap: 10px;
  }

  .quick-action {
    border-radius: 24px;
    padding: 13px 14px;
    gap: 9px;
  }

  .quick-action-title {
    font-size: clamp(16px, 5.2vw, 22px);
  }

  .quick-action-tail {
    font-size: clamp(12px, 3.8vw, 16px);
  }

  .hero-renew-btn {
    min-height: 42px;
    min-width: 132px;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 15px;
  }

  .quick-action-secondary .quick-action-title {
    font-size: clamp(15px, 4.5vw, 19px);
  }

  .quick-actions-row {
    gap: 8px;
  }

  .home-tariff-card {
    width: min(100%, 96%);
    border-radius: 20px;
    padding: 11px 12px;
    column-gap: 10px;
  }

  .home-tariff-card strong {
    font-size: clamp(17px, 5vw, 22px);
  }

  .home-tariff-card .home-tariff-price {
    font-size: clamp(16px, 4.6vw, 20px);
  }

  .header-emblem {
    transform: translateX(-28px);
  }

  .wire-track {
    --wire-shift-y: 32vh;
    --wire-sag-scale: 0.75;
  }

  .hero-value {
    font-size: clamp(34px, 12vw, 48px);
  }

  .wallet-balance strong {
    font-size: clamp(31px, 11vw, 40px);
  }

  .promo-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  h2 {
    font-size: 24px;
  }
}

@media (min-width: 521px) {
  .home-quick-actions {
    gap: 10px;
  }

  .quick-action-install {
    min-height: 56px;
    border-radius: 22px;
    padding: 10px 14px;
    gap: 8px;
  }

  .quick-action-install .quick-icon {
    width: 20px;
    height: 20px;
  }

  .quick-action-install .quick-action-title {
    font-size: clamp(16px, 2.5vw, 22px);
    line-height: 1.08;
  }

  .quick-action-install .quick-action-tail {
    font-size: clamp(12px, 2vw, 18px);
    line-height: 1.06;
  }

  .quick-actions-row {
    gap: 8px;
  }

  .quick-action-secondary {
    min-height: 56px;
    border-radius: 22px;
    padding: 10px 14px;
    gap: 8px;
  }

  .quick-action-secondary .quick-icon {
    width: 20px;
    height: 20px;
  }

  .quick-action-secondary .quick-action-title {
    max-width: 8ch;
    font-size: clamp(15px, 2.2vw, 19px);
    line-height: 1.08;
  }
}

@media (min-width: 860px) {
  body {
    padding-top: 0;
  }

  .app-shell {
    padding-bottom: calc(120px + var(--safe-bottom));
  }
}
