/* СтоРуб VPN Mini App v4 — one scrolling home (hitvpn-like), brand «100₽»: black / white / red, flat.
   Theme follows Telegram (html[data-theme=light|dark]). */
@font-face {
  font-family: 'Slab';
  src: url('/mini/slab.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0e0e10;
  --card: #1a1a1d;
  --card-2: #232327;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #ffffff;
  --soft: #c9c9d0;
  --muted: #8b8b95;
  --red: #e5262b;
  --red-ink: #ff5a5f;
  --red-soft: rgba(229, 38, 43, 0.14);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.14);
  --solid: #ffffff;
  --solid-ink: #0e0e10;
  --banner: #000000;
  --radius: 22px;
  --safe-top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  --slab: 900 1em/1 'Slab', 'Roboto Slab', Georgia, serif;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f1f1f4;
  --card: #ffffff;
  --card-2: #f1f1f4;
  --line: rgba(0, 0, 0, 0.08);
  --ink: #0e0e10;
  --soft: #3c3c43;
  --muted: #7c7c86;
  --red: #e5262b;
  --red-ink: #d81f24;
  --red-soft: rgba(229, 38, 43, 0.1);
  --ok: #1f9d45;
  --ok-soft: rgba(31, 157, 69, 0.11);
  --warn: #c76a00;
  --warn-soft: rgba(255, 159, 10, 0.14);
  --solid: #0e0e10;
  --solid-ink: #ffffff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  overflow-x: hidden;
}
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { display: block; }
.slab { font: var(--slab); letter-spacing: -0.02em; }
.red { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-in {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; margin-right: auto; }
.logo { font: var(--slab); font-size: 22px; letter-spacing: -0.03em; color: var(--ink); }
.logo b { color: var(--red); font-weight: inherit; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.peek {
  display: grid;
  text-align: right;
  line-height: 1.15;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.top.scrolled .peek { opacity: 1; transform: none; }
.peek small { font-size: 12px; color: var(--muted); }
.peek b { font: var(--slab); font-size: 18px; }
.peek b.red { color: var(--red); }
.round {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  color: var(--ink);
}
.round .i { width: 20px; height: 20px; }

/* ---------- layout ---------- */
#view {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--safe-bottom) + 28px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.screen-in { animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .screen-in { animation: none; } }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 0; color: inherit; }
.card.tight { padding: 14px 16px; }
.card.link { width: 100%; text-align: left; display: block; }
.card.link:active, .quick button:active, .row:active, .bn:active { transform: scale(0.985); }
.section-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 10px 4px -6px; }

/* ---------- hero (status) ---------- */
.hero { text-align: center; padding: 18px 4px 6px; }
.hero .label { font-weight: 700; font-size: 17px; }
.hero .num { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 10px 0 8px; }
.hero .num strong { font: var(--slab); font-size: 84px; letter-spacing: -0.04em; }
.hero .num span { width: 24px; font: 800 30px/1 -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif; color: var(--muted); text-align: left; }
/* Same-width spacer on the left keeps the number itself centred under «Баланс» (₽ hangs to the right). */
.hero .num:has(span)::before { content: ''; width: 24px; }
.hero .num.red strong { color: var(--red); }
.hero .sub { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot.ok { color: var(--ok); }
.dot.warn { color: var(--warn); }
.dot.red { color: var(--red); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.hero .stack { margin-top: 18px; }

/* quick actions (two white tiles) */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 8px 14px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.12s;
}
.quick .ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; }
.quick .ic .i { width: 18px; height: 18px; }
.quick .ic .i svg { stroke-width: 2.6; }
.quick small { font-weight: 600; font-size: 13px; color: var(--muted); margin-top: -4px; }

/* ---------- banners (scroll-snap) ---------- */
.banners { margin: 0 -16px; }
.bn-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 16px;
  scroll-padding: 0 16px;
}
.bn-track::-webkit-scrollbar { display: none; }
.bn {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 128px;
  padding: 18px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--banner);
  color: #fff;
  text-align: left;
  transition: transform 0.12s;
}
:root[data-theme='dark'] .bn { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); }
.bn .t1 { display: block; font: var(--slab); font-size: 30px; letter-spacing: -0.03em; color: var(--red); }
.bn .t2 { display: block; font: var(--slab); font-size: 26px; letter-spacing: -0.03em; margin-top: 2px; }
.bn .cap { display: block; font-size: 13px; color: #a3a3ac; margin-top: 8px; }
.bn .cap b { color: #fff; }
.bn .art { color: var(--red); width: 58px; height: 58px; margin-right: 4px; }
.bn .art svg { stroke-width: 1.7; }
.bn-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.bn-dots i { position: relative; width: 6px; height: 6px; border-radius: 3px; background: var(--muted); opacity: 0.35; transition: width 0.2s, opacity 0.2s; cursor: pointer; }
.bn-dots i::after { content: ''; position: absolute; inset: -10px -6px; } /* bigger tap area */
.bn-dots i.on { width: 18px; opacity: 1; background: var(--ink); }

/* ---------- device / list card ---------- */
.list { padding: 0; overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; }
.list-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.list-head p { color: var(--muted); font-size: 15px; margin-top: 2px; }
.pill {
  flex: none;
  border: 0;
  border-radius: 99px;
  padding: 10px 18px;
  background: var(--red-soft);
  color: var(--red-ink);
  font-weight: 700;
  font-size: 16px;
}
.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  transition: transform 0.12s;
}
.row .tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--solid); color: var(--solid-ink); }
.row .tile.red { background: var(--red); color: #fff; }
.row .tile.off { background: var(--card-2); color: var(--muted); }
.row .tile .i { width: 24px; height: 24px; }
.row b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.row small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 2px; }
.row .chev { color: var(--muted); width: 18px; height: 18px; }
.row.plain { grid-template-columns: 30px 1fr auto; padding: 14px 18px; }
.row.plain .i:first-child { width: 24px; height: 24px; }
.row.plain b { font-weight: 500; }
.list .row:first-child { border-top: 0; }
.empty { text-align: center; padding: 6px 18px 18px; }
.empty .big { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; margin: 4px auto 12px; background: var(--red-soft); color: var(--red); }
.empty .big .i { width: 32px; height: 32px; }
.empty h3 { font-size: 20px; letter-spacing: -0.01em; }
.empty p { color: var(--muted); font-size: 15px; margin: 6px 0 16px; }
.tariff-note { text-align: center; color: var(--muted); font-size: 14px; margin: -2px 0 4px; }

/* ---------- invite card ---------- */
.invite { text-align: center; padding: 22px 18px 18px; }
.invite .plus { font: var(--slab); font-size: 56px; letter-spacing: -0.04em; color: var(--red); }
.invite h2 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; margin-top: 6px; }
.invite > p { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.invite .bal { margin: 16px 0 4px; padding: 12px 14px; border-radius: 16px; background: var(--card-2); text-align: left; }
.invite .bal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.invite .bal-top b { font: var(--slab); font-size: 20px; color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.two .btn { flex-direction: column; gap: 4px; min-height: 76px; border-radius: 18px; }
.two .btn .i { width: 24px; height: 24px; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn.primary { background: var(--red); color: #fff; }
.btn.white, .btn.solid { background: var(--solid); color: var(--solid-ink); }
.btn.ghost { background: var(--card-2); color: var(--ink); }
.card .btn.ghost { background: var(--card-2); }
#view > .btn.ghost { background: var(--card); }
.btn.text { min-height: 44px; background: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.btn .i { width: 20px; height: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.i { width: 22px; height: 22px; display: inline-block; flex: none; }
.i svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- inner pages ---------- */
.page-title { font: var(--slab); font-size: 34px; letter-spacing: -0.03em; margin-top: 8px; }
.page-title em { font-style: normal; color: var(--red); }
/* The title takes focus on page change for screen readers (tabindex=-1); no visible ring. */
.page-title:focus, [tabindex="-1"]:focus { outline: none; }
.lead { color: var(--muted); font-size: 15px; margin-top: -6px; }
.status-text h2 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.status-text p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.card .stack { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px; background: var(--card-2); font-size: 13px; font-weight: 600; }
.chip.red { background: var(--red-soft); color: var(--red-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.bonus-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bonus-head .amount { font: var(--slab); font-size: 30px; letter-spacing: -0.03em; }
.bonus-head .amount.red { color: var(--red); }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0 8px; }
.progress i { display: block; height: 100%; width: 3%; border-radius: inherit; background: var(--red); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.big-number { display: flex; align-items: flex-end; gap: 10px; margin: 10px 0 2px; }
.big-number strong { font: var(--slab); font-size: 64px; letter-spacing: -0.04em; }
.big-number strong.red { color: var(--red); }
.big-number span { font-weight: 700; font-size: 22px; padding-bottom: 8px; line-height: 1.1; }
.big-number span small { display: block; font-weight: 600; font-size: 14px; color: var(--muted); margin-top: 4px; }

.segment { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--card); }
.segment button { display: grid; justify-items: center; gap: 3px; padding: 9px 2px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.segment button[aria-pressed='true'] { background: var(--card-2); color: var(--ink); }
.segment button[aria-pressed='true'] .i { color: var(--red); }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.step .num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); color: var(--muted); font: var(--slab); font-size: 18px; }
.step.current .num { background: var(--red); color: #fff; }
.step.done .num { background: var(--ok); color: #fff; }
.step.done .num .i { width: 20px; height: 20px; }
.step.done .num .i svg { stroke-width: 3; }
.step h3 { font-size: 17px; letter-spacing: -0.01em; margin-top: 8px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 4px 0 0; }
.step .stack { margin-top: 12px; gap: 8px; }
.waiter { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--red-soft); font-size: 14.5px; }
.spinner { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--red-soft); border-top-color: var(--red); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tips { padding: 14px; border-radius: 14px; background: var(--card-2); font-size: 14px; }
.tips ol { margin: 8px 0 12px; padding-left: 20px; color: var(--soft); display: grid; gap: 6px; }
.qr-box { display: grid; justify-items: center; }
.qr-box canvas { width: 220px; height: 220px; border-radius: 18px; background: #fff; padding: 12px; }
.linkbox { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 0; color: var(--soft); font: 14px/1.4 ui-monospace, Menlo, monospace; resize: none; }
.linkbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox button { flex: none; border: 0; background: none; color: var(--red-ink); padding: 4px; }
.rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reward { padding: 16px 14px; border-radius: 20px; background: var(--card); }
.reward strong { display: block; font: var(--slab); font-size: 30px; letter-spacing: -0.03em; color: var(--red); }
.reward span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.how { counter-reset: how; display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.how li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; gap: 12px; font-size: 15px; color: var(--soft); }
.how li::before { content: counter(how); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red-soft); color: var(--red-ink); font: var(--slab); font-size: 14px; }
.how b { color: var(--ink); }
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 16px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--card);
  text-align: left;
}
.plan[aria-checked='true'] { border-color: var(--red); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); }
.plan[aria-checked='true'] .radio { border: 7px solid var(--red); }
.plan h3 { font-size: 18px; }
.plan p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.plan .price { text-align: right; }
.plan .price strong { display: block; font: var(--slab); font-size: 22px; }
.plan .price small { color: var(--muted); font-size: 12.5px; }
.plan .badge { position: absolute; top: -10px; left: 52px; padding: 3px 9px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: var(--soft); }
.checks .i { color: var(--red); width: 20px; height: 20px; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--card); border-radius: 18px; padding: 0 16px; }
.faq summary { list-style: none; padding: 16px 0; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq p { color: var(--muted); font-size: 15px; padding-bottom: 16px; }
.celebrate { text-align: center; padding: 28px 20px 20px; }
.big-check { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok); color: #fff; }
.big-check .i { width: 44px; height: 44px; }
.big-check .i svg { stroke-width: 3; }
.celebrate h1 { font: var(--slab); font-size: 34px; letter-spacing: -0.03em; }
.celebrate p { color: var(--muted); margin-top: 8px; }
.outside { text-align: center; padding: 48px 8px; }
.outside .logo { display: block; font-size: 56px; margin-bottom: 18px; }
.foot { display: flex; justify-content: center; gap: 18px; margin-top: 2px; }
.foot button { border: 0; background: none; color: var(--muted); font-size: 13.5px; padding: 6px; }

/* ---------- menu sheet ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.45); animation: fade 0.18s both; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 12px calc(var(--safe-bottom) + 12px);
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  animation: up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
.sheet .card + .card { margin-top: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

/* ---------- misc ---------- */
.skeleton { height: 120px; border-radius: var(--radius); background: var(--card); animation: pulse 1.4s ease-in-out infinite; }
.skeleton.tall { height: 220px; }
.skeleton.short { height: 70px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  z-index: 40;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--solid);
  color: var(--solid-ink);
  font-weight: 600;
  font-size: 15px;
  animation: toast 2.6s both;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; width: 100%; height: 100%; }
.demo-flag { position: fixed; right: 8px; bottom: 8px; z-index: 60; padding: 3px 8px; border-radius: 8px; background: var(--warn); color: #000; font: 700 11px/1.4 ui-monospace, Menlo, monospace; }
.nojs { padding: 40px 20px; text-align: center; color: var(--muted); }
.btn.big { min-height: 58px; font-size: 18px; }
