@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/static/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/static/fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #07090f;
  --bg-glow: rgba(26, 107, 255, 0.16);
  --surface: #0f1422;
  --surface-2: #151c2f;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2ff;
  --muted: #8b95b3;
  --accent: #1a6bff;
  --accent-2: #19c8ff;
  --grad: linear-gradient(135deg, #1a5cff 0%, #19b4ff 100%);
  --ok: #2ee59d;
  --bad: #ff5d6c;
  --warn: #ffb84d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r: 20px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f5fb;
  --bg-glow: rgba(26, 107, 255, 0.1);
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --line: rgba(14, 24, 52, 0.08);
  --line-strong: rgba(14, 24, 52, 0.16);
  --text: #0b1220;
  --muted: #66708a;
  --ok: #0fb878;
  --bad: #e5384a;
  --warn: #d98a10;
  --shadow: 0 18px 40px rgba(20, 40, 90, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(120% 60% at 50% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  overflow-x: hidden;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.rub {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- каркас ---------- */
.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 28px);
}

/* ---------- шапка ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 52px;
  margin-bottom: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  max-width: 100%;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.pill svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent-2);
}
.pill:active {
  transform: scale(0.95);
}
.pill-lang {
  justify-self: start;
}
.pill-bal {
  justify-self: end;
  min-width: 0;
}
.pill-bal span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(26, 107, 255, 0.45));
  animation: logoIn 0.9s var(--ease) both;
}
.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-name b {
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- карточки ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.label {
  margin: 22px 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.reveal {
  opacity: 0;
  animation: rise 0.7s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 60ms);
}

/* ---------- статус ---------- */
.hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(closest-side, var(--bg-glow), transparent);
  pointer-events: none;
}
.ring {
  position: relative;
  width: 112px;
  height: 112px;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}
.ring-bg {
  stroke: var(--line-strong);
}
.ring-fg {
  stroke: url(#ringGrad);
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 1.3s var(--ease);
}
.hero.off .ring-fg {
  stroke: var(--muted);
}
.ring-c {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ring-c b {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ring-c small {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.state {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.on {
  background: var(--ok);
  animation: pulse 2s ease-out infinite;
}
.dot.bad {
  background: var(--bad);
}
.until {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.kv span {
  color: var(--muted);
  font-weight: 600;
}
.kv b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- кнопки ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.005em;
  transition: transform 0.2s var(--ease), opacity 0.2s, background 0.2s, border-color 0.2s;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}
.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}
.btn:active {
  transform: scale(0.975);
}
.btn.primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 30px rgba(26, 107, 255, 0.35);
}
.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  animation: sheen 5.5s ease-in-out infinite;
}
.btn.ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.btn.ghost:active {
  border-color: var(--line-strong);
}
.btn.danger {
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid rgba(255, 93, 108, 0.3);
  color: var(--bad);
}
.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.42;
}
.btn.loading {
  pointer-events: none;
}
.btn.loading > * {
  opacity: 0;
}
.btn.loading::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn.ghost.loading::before {
  border-color: var(--line-strong);
  border-top-color: var(--text);
}
.btn.danger.loading::before {
  border-color: rgba(255, 93, 108, 0.3);
  border-top-color: var(--bad);
}
.dev .x.loading {
  opacity: 0.5;
  pointer-events: none;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.row2 .btn {
  min-height: 48px;
  font-size: 14px;
}
.connect {
  padding: 14px;
}

/* ---------- список действий ---------- */
.list {
  padding: 6px;
}
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border-radius: 15px;
  text-align: left;
  transition: background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}
.item:active {
  background: var(--surface-2);
  transform: scale(0.985);
}
.item + .item {
  position: relative;
}
.item + .item::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 66px;
  right: 12px;
  height: 1px;
  background: var(--line);
}
.item[aria-disabled="true"] {
  opacity: 0.45;
}
.ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent-2);
}
.ico svg {
  width: 20px;
  height: 20px;
}
.ico.accent {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.item .t {
  flex: 1;
  min-width: 0;
}
.item .t b {
  display: block;
  font-weight: 700;
  font-size: 15px;
}
.item .t span {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.item .chev {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}

/* ---------- состояния ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-2);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
.loading-state .hero > * {
  visibility: hidden;
}
.loading-state .hero {
  min-height: 146px;
}
.loading-state .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.05) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
.notice {
  text-align: center;
  padding: 34px 20px;
}
.notice p {
  margin: 8px 0 18px;
  color: var(--muted);
}
.notice h3 {
  margin: 0;
  font-size: 18px;
}
.trial {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(26, 92, 255, 0.18), rgba(25, 180, 255, 0.1));
  border-color: rgba(26, 107, 255, 0.35);
}
.trial .t {
  flex: 1;
}
.trial b {
  display: block;
  font-weight: 800;
}
.trial span {
  font-size: 13px;
  color: var(--muted);
}
.trial .btn {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

/* ---------- шторки ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.sheet-wrap.open {
  pointer-events: auto;
}
.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s;
}
.open .backdrop {
  opacity: 1;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform 0.42s var(--ease);
}
.open .sheet {
  transform: translateY(0);
}
.grab {
  width: 40px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: var(--line-strong);
}
.sheet h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.sheet .sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.sheet .stack {
  display: grid;
  gap: 10px;
}
.sheet .stack > * {
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms + 80ms);
}
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.opt:active {
  transform: scale(0.98);
}
.opt.sel {
  border-color: var(--accent);
  background: rgba(26, 107, 255, 0.12);
}
.opt .t {
  flex: 1;
  min-width: 0;
}
.opt .t b {
  display: block;
  font-weight: 800;
}
.opt .t span {
  font-size: 12.5px;
  color: var(--muted);
}
.opt .price {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ok);
  background: rgba(46, 229, 157, 0.12);
  vertical-align: 1px;
}
.mono {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  background: var(--grad);
}
.mono.alt {
  background: linear-gradient(135deg, #7a5cff, #19b4ff);
}
.qr {
  display: grid;
  place-items: center;
  width: min(264px, 100%);
  aspect-ratio: 1;
  margin: 4px auto 14px;
  padding: 14px;
  background: #fff;
  border-radius: 20px;
}
.qr svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: fadeIn 0.5s both;
}
.qr .skeleton {
  width: 100%;
  height: 100%;
  background: #e8ecf5;
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.stepper button {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.stepper button:active {
  transform: scale(0.9);
}
.stepper button:disabled {
  opacity: 0.35;
}
.stepper .n {
  text-align: center;
}
.stepper .n b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stepper .n span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 4px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.sum b {
  color: var(--text);
  font-weight: 800;
}
.warn {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  color: var(--warn);
  background: rgba(255, 184, 77, 0.1);
  border: 1px solid rgba(255, 184, 77, 0.25);
}
.warn svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
}
.empty {
  text-align: center;
  padding: 10px 6px 4px;
  color: var(--muted);
}
.empty .ico {
  margin: 0 auto 12px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
}
.empty .ico svg {
  width: 26px;
  height: 26px;
}
.dev {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.dev .t {
  flex: 1;
  min-width: 0;
}
.dev .t b {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dev .t span {
  font-size: 12.5px;
  color: var(--muted);
}
.dev .x {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--bad);
  background: rgba(255, 93, 108, 0.1);
  transition: transform 0.15s var(--ease);
}
.dev .x:active {
  transform: scale(0.94);
}

/* ---------- тост ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, -140%);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s;
  pointer-events: none;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast.err {
  border-color: rgba(255, 93, 108, 0.4);
}
.toast.ok {
  border-color: rgba(46, 229, 157, 0.4);
}

/* ---------- страница перехода /go ---------- */
.go {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.go-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.go-card .logo {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
}
.go-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}
.go-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}
.go-card .btn + .btn {
  margin-top: 10px;
}
.go-card .hint {
  margin: 22px 0 0;
  font-size: 12.5px;
}
.go-card .hint a {
  color: var(--accent-2);
}

/* ---------- анимации ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes logoIn {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.55);
  }
  100% {
    box-shadow: 0 0 0 11px rgba(46, 229, 157, 0);
  }
}
@keyframes sheen {
  0%,
  62% {
    left: -60%;
  }
  100% {
    left: 130%;
  }
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 350px) {
  .hero {
    grid-template-columns: 92px 1fr;
    gap: 12px;
  }
  .ring {
    width: 92px;
    height: 92px;
  }
  .ring-c b {
    font-size: 28px;
  }
  .brand-name {
    font-size: 17px;
  }
  .pill {
    padding: 0 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
  }
}
