/* ==========================================================================
   Jumbo VPN — Telegram Mini App
   Layout: одна колонка до 440px. Сверху — фирменная синяя карточка с мягкими
   кругами из логотипа (единственный «громкий» элемент), ниже — тихие
   сгруппированные списки. Таб-бар снизу, листы (bottom sheets) для деталей.
   Тёмная тема — основная (dark-first), светлая — по Telegram / системе.
   ========================================================================== */

:root {
  /* Бренд: цвета сняты с логотипа */
  --jumbo: #0577FD;          /* фон логотипа */
  --jumbo-deep: #0160FA;     /* глаз и щель уха */
  --jumbo-glow: #2490FD;     /* светлые круги */
  --on-jumbo: #FFFFFF;

  /* Поверхности (тёмная тема) */
  --bg: #0A1020;
  --surface: #131A2B;
  --surface-2: #1B2337;
  --line: rgba(150, 178, 225, 0.12);
  --text: #EEF2F8;
  --text-2: #97A3BA;
  --text-3: #5F6A82;
  --link: #5EA2FF;
  --tint: rgba(5, 119, 253, 0.14);

  /* Акцент «выгоды» — тёплый, как бивень; только для скидок и денег */
  --value: #FFC86E;
  --value-bg: rgba(255, 200, 110, 0.14);

  /* Смысловые */
  --ok: #2FD08A;
  --warn: #FFB23F;
  --bad: #FF6363;

  /* Типографика */
  --font-display: "Geologica", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Радиусы по роли, а не один на всё */
  --r-hero: 28px;
  --r-group: 20px;
  --r-btn: 16px;
  --r-chip: 12px;

  /* Движение */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-io: cubic-bezier(0.6, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-press: 140ms;
  --t-state: 220ms;
  --t-sheet: 380ms;

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EEF2F8;
    --surface: #FFFFFF;
    --surface-2: #E5EBF4;
    --line: rgba(16, 32, 64, 0.09);
    --text: #0B1222;
    --text-2: #566077;
    --text-3: #8B94A7;
    --link: #0160FA;
    --tint: rgba(5, 119, 253, 0.09);
    --value: #8A5800;
    --value-bg: #FFF0D2;
    --ok: #12A86A;
    --warn: #C27400;
    --bad: #DE3A3A;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #EEF2F8;
  --surface: #FFFFFF;
  --surface-2: #E5EBF4;
  --line: rgba(16, 32, 64, 0.09);
  --text: #0B1222;
  --text-2: #566077;
  --text-3: #8B94A7;
  --link: #0160FA;
  --tint: rgba(5, 119, 253, 0.09);
  --value: #8A5800;
  --value-bg: #FFF0D2;
  --ok: #12A86A;
  --warn: #C27400;
  --bad: #DE3A3A;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  transition: background-color var(--t-state) var(--ease-out);
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--link); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: 440px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--tabbar-h) + 28px + var(--safe-b));
}

/* ---------- Шапка ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding-top: var(--tg-content-safe-area-inset-top, 0px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand__logo { width: 32px; height: 32px; border-radius: 50%; }
.brand__name { font: 600 19px/1 var(--font-display); letter-spacing: -0.02em; display: inline-flex; gap: 5px; }
.brand__name span { color: var(--text-2); font-weight: 500; }
.topbar__actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  transition: transform var(--t-press) var(--spring), color var(--t-state);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn .i { width: 20px; height: 20px; }

/* ---------- Демо-переключатель (виден только вне Telegram) ---------- */
.demobar {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 14px;
  overflow-x: auto; scrollbar-width: none;
}
.demobar::-webkit-scrollbar { display: none; }
.demobar__label { font-size: 13px; color: var(--text-3); flex: none; }
.demobar__opts { display: flex; gap: 6px; }
.chip {
  flex: none;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  transition: background var(--t-state), color var(--t-state), transform var(--t-press) var(--spring);
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
/* В Telegram тема берётся из Telegram — свой переключатель не нужен.
   Демо-переключатель виден и в Telegram, пока сборка тестовая; в бою
   убрать .demobar из index.html вместе с DEMO_STATES в app.js. */
.is-tg .browser-only { display: none !important; }

/* ---------- Экраны ---------- */
.views { display: block; }
.view { display: flex; flex-direction: column; gap: 28px; }
.view.is-entering { animation: view-in 320ms var(--ease-out) both; }
.view.is-entering.from-left { animation-name: view-in-left; }
@keyframes view-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes view-in-left { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.page-head h1 { font: 600 28px/1.15 var(--font-display); letter-spacing: -0.025em; text-wrap: balance; }
.page-head p { color: var(--text-2); font-size: 15px; max-width: 34ch; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.section__head h2 { font: 600 19px/1.2 var(--font-display); letter-spacing: -0.015em; }
.section__head a, .section__head button { font-size: 14px; color: var(--link); font-weight: 500; }
.section__note { font-size: 13px; color: var(--text-3); padding: 0 4px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border-radius: var(--r-btn);
  font-weight: 600; font-size: 16px; line-height: 1.1;
  text-align: center;
  transition: transform var(--t-press) var(--spring), background-color var(--t-state), color var(--t-state), opacity var(--t-state);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .i { width: 20px; height: 20px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--jumbo); color: var(--on-jumbo); }
.btn--primary:hover { background: var(--jumbo-deep); }
.btn--light { background: #FFFFFF; color: var(--jumbo-deep); }
.btn--glass { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.btn--soft { background: var(--surface-2); color: var(--text); }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: var(--r-chip); }
.btn--text { min-height: 40px; padding: 0 4px; color: var(--link); font-weight: 500; font-size: 15px; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Фирменная карточка (единственный громкий элемент) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-hero);
  background: var(--jumbo);
  color: var(--on-jumbo);
  padding: 22px 20px 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.bokeh { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bokeh i {
  position: absolute; border-radius: 50%;
  /* Круги как на логотипе: светлее к центру, с мягким краем */
  background: radial-gradient(circle at 35% 35%, rgba(120,190,255,0.55), rgba(70,160,255,0.28) 55%, rgba(60,150,255,0) 71%);
}
.bokeh i:nth-child(1) { width: 260px; height: 260px; left: -120px; top: -150px; animation: drift-a 22s var(--ease-io) infinite alternate; }
.bokeh i:nth-child(2) { width: 300px; height: 300px; right: -170px; bottom: -190px; animation: drift-b 26s var(--ease-io) infinite alternate; }
.bokeh i:nth-child(3) { width: 180px; height: 180px; left: -90px; bottom: -120px; opacity: .7; animation: drift-a 30s var(--ease-io) infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(26px, 18px) scale(1.06); } }
@keyframes drift-b { to { transform: translate(-22px, -14px) scale(1.04); } }
.hero--warn { background: linear-gradient(160deg, #0A6CF2 0%, #0560E0 100%); }
.hero--off { background: linear-gradient(160deg, #2C3A57 0%, #1F2A42 100%); }

.hero__mark { width: 76px; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 40, 120, 0.25)); }
.hero__title { font: 600 32px/1.08 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; max-width: 12ch; }
.hero__lead { font-size: 16px; line-height: 1.45; color: rgba(255,255,255,0.86); max-width: 32ch; }
.hero__cta { display: flex; flex-direction: column; gap: 10px; }
.hero__note { font-size: 13px; color: rgba(255,255,255,0.78); text-align: center; }

.hero__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero__date { font-size: 14px; color: rgba(255,255,255,0.82); }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 13px; font-weight: 600;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #7CFFC4; box-shadow: 0 0 0 0 rgba(124,255,196,0.6); animation: ping 2.4s var(--ease-out) infinite; }
.pill--warn .dot { background: #FFD27A; box-shadow: 0 0 0 0 rgba(255,210,122,0.6); }
.pill--off .dot { background: #FF9B9B; animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(124,255,196,0.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(124,255,196,0); } }

.status { display: flex; align-items: center; gap: 18px; }
.meter { position: relative; width: 112px; height: 112px; flex: none; }
.meter svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.meter__track { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 7; }
.meter__value {
  fill: none; stroke: #FFFFFF; stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 0 340;
  transition: stroke-dasharray 1100ms var(--ease-out);
}
.meter__face {
  position: absolute; inset: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: grid; place-items: center;
}
.meter__face img { width: 56%; height: auto; transform: translateX(4%); }
.status__days { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status__num { font: 600 64px/0.95 var(--font-display); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.status__unit { font-size: 15px; color: rgba(255,255,255,0.84); }

.hero__actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.hero__actions .btn { white-space: nowrap; padding: 0 18px; }

/* ---------- Сгруппированные списки ---------- */
.group {
  background: var(--surface);
  border-radius: var(--r-group);
  overflow: hidden;
}
.row {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  text-align: left;
  color: var(--text);
  position: relative;
  transition: background-color var(--t-state);
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--line); }
button.row:active, a.row:active { background: var(--surface-2); }
.row__icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--tint);
  color: var(--jumbo);
}
:root:not([data-theme="light"]) .row__icon { color: var(--link); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .row__icon { color: var(--jumbo); } }
.row__icon .i { width: 20px; height: 20px; }
.row__icon--value { background: var(--value-bg); color: var(--value) !important; }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 16px; font-weight: 500; }
.row__sub { font-size: 13px; color: var(--text-2); }
.row__end { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 15px; flex: none; }
.row__end .i { width: 18px; height: 18px; color: var(--text-3); }

/* ---------- Шаги «как это работает» ---------- */
.steps { list-style: none; margin: 0; padding: 4px 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 12px 16px; position: relative; }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: var(--link);
  font: 600 15px/1 var(--font-display);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 31px; top: 48px; bottom: -8px; width: 2px; border-radius: 2px; background: var(--line); }
.steps b { display: block; font-weight: 600; font-size: 16px; }
.steps span { display: block; font-size: 14px; color: var(--text-2); }

/* ---------- Факты 2×2 внутри одной поверхности ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; }
.fact { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.fact:nth-child(odd) { border-right: 1px solid var(--line); }
.fact:nth-child(n+3) { border-top: 1px solid var(--line); }
.fact b { font: 600 22px/1.1 var(--font-display); letter-spacing: -0.02em; }
.fact span { font-size: 13px; color: var(--text-2); }

/* ---------- Страны ---------- */
.flags { display: flex; flex-wrap: wrap; gap: 8px; }
.flag {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
}
.flag img { width: 24px; height: 24px; border-radius: 50%; }

/* ---------- Баннеры ---------- */
.banner {
  display: flex; gap: 14px; align-items: center;
  padding: 16px;
  border-radius: var(--r-group);
  background: var(--surface);
  text-align: left; width: 100%;
}
.banner__body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.banner__title { font-weight: 600; font-size: 16px; }
.banner__sub { font-size: 14px; color: var(--text-2); }
.banner--value .banner__title b { color: var(--value); }
.banner--warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.banner--warn .row__icon { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn) !important; }

/* ---------- Тарифы ---------- */
.plans { display: flex; flex-direction: column; gap: 8px; }
.plan {
  position: relative;
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px transparent;
  cursor: pointer;
  transition: box-shadow var(--t-state) var(--ease-out), background-color var(--t-state), transform var(--t-press) var(--spring);
}
.plan:active { transform: scale(0.985); }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { box-shadow: inset 0 0 0 2px var(--jumbo); background: color-mix(in srgb, var(--jumbo) 9%, var(--surface)); }
.plan:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--text-3); display: grid; place-items: center; transition: box-shadow var(--t-state); }
.radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--jumbo); transform: scale(0); transition: transform var(--t-state) var(--spring); }
.plan:has(input:checked) .radio { box-shadow: inset 0 0 0 2px var(--jumbo); }
.plan:has(input:checked) .radio::after { transform: scale(1); }
.plan__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 17px; }
.plan__total { font-size: 13px; color: var(--text-2); }
.plan__price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.plan__month { font: 600 20px/1.1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan__month small { font: 500 13px var(--font-ui); color: var(--text-2); letter-spacing: 0; }
.plan__old { font-size: 13px; color: var(--text-3); text-decoration: line-through; }
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border-radius: 7px;
  font-size: 12px; font-weight: 700;
  background: var(--value-bg); color: var(--value);
  font-variant-numeric: tabular-nums;
}
.badge--blue { background: var(--tint); color: var(--link); }

.stepper-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.stepper-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
  transition: transform var(--t-press) var(--spring), opacity var(--t-state);
}
.stepper button:active { transform: scale(0.9); }
.stepper button[disabled] { opacity: 0.35; pointer-events: none; }
.stepper output { min-width: 40px; text-align: center; font: 600 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.pips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pips i { height: 6px; border-radius: 3px; background: var(--surface-2); transition: background-color var(--t-state) var(--ease-out); }
.pips i.on { background: var(--jumbo); }
.pips i.base { background: color-mix(in srgb, var(--jumbo) 55%, var(--surface-2)); }

.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px transparent;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--t-state), transform var(--t-press) var(--spring);
}
.method:active { transform: scale(0.96); }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method:has(input:checked) { box-shadow: inset 0 0 0 2px var(--jumbo); }
.method:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.method img { width: 32px; height: 32px; object-fit: contain; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); transition: background-color var(--t-state); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t-state) var(--spring); }
.switch input:checked + span { background: var(--jumbo); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

.checklist { list-style: none; margin: 0; padding: 6px 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 16px; font-size: 15px; }
.checklist .i { width: 20px; height: 20px; color: var(--ok); margin-top: 1px; }

.checkout {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 12px + var(--safe-b));
  z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 18px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 10, 30, 0.28);
}
.checkout__sum { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.checkout__total { font: 600 24px/1.1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout__meta { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkout__meta s { color: var(--text-3); }
.is-tg .checkout .btn { display: none; }
.trust { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-3); text-align: center; }
.trust .i { width: 16px; height: 16px; }

/* ---------- Подключение ---------- */
.seg {
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 12px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  transition: background-color var(--t-state), color var(--t-state);
}
.seg button .i { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

.progress { display: flex; flex-direction: column; gap: 8px; }
.progress__label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 0 4px; }
.progress__bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--jumbo); transition: width 600ms var(--ease-out); }

.isteps { display: flex; flex-direction: column; gap: 8px; }
.istep {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px;
  padding: 16px;
  border-radius: var(--r-group);
  background: var(--surface);
  transition: opacity var(--t-state), background-color var(--t-state);
}
.istep__mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 15px/1 var(--font-display);
  background: var(--surface-2); color: var(--text-2);
  transition: background-color var(--t-state), color var(--t-state);
}
.istep__mark .i { width: 20px; height: 20px; stroke-width: 2.4; stroke-dasharray: 24; stroke-dashoffset: 24; }
.istep__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 6px; }
.istep__title { font-weight: 600; font-size: 17px; }
.istep__text { font-size: 15px; color: var(--text-2); }
.istep__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.istep__actions .btn--text { align-self: flex-start; }
.istep.is-current { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--jumbo) 60%, transparent); }
.istep.is-current .istep__mark { background: var(--jumbo); color: #FFFFFF; }
.istep.is-todo { opacity: 0.55; }
.istep.is-done .istep__mark { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.istep.is-done .istep__mark .i { animation: draw 420ms var(--ease-out) forwards; }
.istep.is-done .istep__text { display: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.linkbox {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 14px;
  background: var(--surface-2);
}
.linkbox code { flex: 1; min-width: 0; font: 500 13px/1.3 var(--font-mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.done-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 20px;
  border-radius: var(--r-group);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
  text-align: center;
}
.done-card .badge-ok {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok); color: #FFFFFF;
  animation: pop 520ms var(--spring) both;
}
.done-card .badge-ok .i { width: 28px; height: 28px; stroke-width: 2.6; }
.done-card h3 { font: 600 20px/1.2 var(--font-display); }
.done-card p { font-size: 15px; color: var(--text-2); max-width: 30ch; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }

details.more { border-radius: var(--r-group); background: var(--surface); }
details.more > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; font-weight: 500;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .i { width: 18px; height: 18px; color: var(--text-3); transition: transform var(--t-state) var(--ease-out); }
details.more[open] > summary .i { transform: rotate(180deg); }
details.more .group { background: transparent; border-top: 1px solid var(--line); border-radius: 0; }
.app-tile {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  font: 700 15px/1 var(--font-display); color: #FFFFFF;
}

/* ---------- Профиль ---------- */
.me { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.me__avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--jumbo); color: #FFFFFF;
  font: 600 22px/1 var(--font-display);
  overflow: hidden;
}
.me__avatar img { width: 100%; height: 100%; object-fit: cover; }
.me__name { font: 600 22px/1.15 var(--font-display); letter-spacing: -0.02em; }
.me__sub { font-size: 14px; color: var(--text-2); }

.wallet { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.wallet__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.wallet__label { font-size: 14px; color: var(--text-2); }
.wallet__sum { font: 600 34px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.wallet__hint { font-size: 14px; color: var(--text-2); }

.ref { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.ref__title { font: 600 20px/1.2 var(--font-display); letter-spacing: -0.02em; }
.ref__text { font-size: 15px; color: var(--text-2); }
.ref__text b { color: var(--text); font-weight: 600; }
.ref__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref__stat { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.ref__stat b { font: 600 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.ref__stat span { font-size: 13px; color: var(--text-2); }
.ref__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref__actions .btn { padding: 0 12px; min-width: 0; }

.foot { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0 8px; }

/* ---------- Таб-бар ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding-bottom: var(--safe-b);
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--line);
}
.tabbar__inner { position: relative; max-width: 440px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar__ind {
  position: absolute; top: 8px; left: 0; width: 25%; height: 30px;
  display: grid; place-items: center;
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 420ms var(--spring);
  pointer-events: none;
}
.tabbar__ind i { width: 56px; height: 30px; border-radius: 999px; background: var(--tint); }
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  padding-top: 11px;
  font-size: 11px; font-weight: 500;
  color: var(--text-3);
  transition: color var(--t-state);
}
.tab .i { width: 23px; height: 23px; transition: transform var(--t-press) var(--spring); }
.tab:active .i { transform: scale(0.88); }
.tab[aria-current="page"] { color: var(--link); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tab[aria-current="page"] { color: var(--jumbo); } }
:root[data-theme="light"] .tab[aria-current="page"] { color: var(--jumbo); }

/* ---------- Лист (bottom sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 16, 0.55); opacity: 0; transition: opacity var(--t-sheet) var(--ease-out); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 440px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px max(16px, env(safe-area-inset-left, 0px)) calc(20px + var(--safe-b)) max(16px, env(safe-area-inset-right, 0px));
  transform: translateY(100%);
  transition: transform var(--t-sheet) var(--ease-out);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__handle { width: 40px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.5; margin: 0 auto 14px; }
.sheet__body { display: flex; flex-direction: column; gap: 20px; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet__head h2 { font: 600 24px/1.15 var(--font-display); letter-spacing: -0.02em; }
.sheet__head p { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.sheet__close { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--text-2); flex: none; }
.sheet__close .i { width: 18px; height: 18px; }

.summary { padding: 6px 0; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 15px; }
.summary dt, .summary span:first-child { color: var(--text-2); }
.summary .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; font-weight: 600; font-size: 17px; }
.summary .total span:first-child { color: var(--text); }
.summary .minus { color: var(--ok); }

.success { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 8px 0 4px; }
.success__mark {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--jumbo);
  position: relative;
  animation: pop 560ms var(--spring) both;
}
.success__mark img { width: 58%; transform: translateX(4%); }
.success__mark::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--jumbo); opacity: 0;
  animation: ring 1200ms 200ms var(--ease-out) both;
}
@keyframes ring { from { transform: scale(0.85); opacity: 0.8; } to { transform: scale(1.35); opacity: 0; } }
.success h2 { font: 600 26px/1.15 var(--font-display); letter-spacing: -0.02em; }
.success p { color: var(--text-2); font-size: 15px; max-width: 30ch; }
.sheet__actions { display: flex; flex-direction: column; gap: 8px; }

.device { display: flex; align-items: center; gap: 14px; padding: 12px 16px; position: relative; }
.device + .device::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--line); }
.device__del { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); transition: color var(--t-state), background-color var(--t-state); }
.device__del.is-armed { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.device.is-removing { animation: collapse 320ms var(--ease-io) forwards; }
@keyframes collapse { to { opacity: 0; transform: translateX(24px); } }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { width: 18px; height: 18px; color: var(--text-3); flex: none; transition: transform var(--t-state) var(--ease-out); }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq details p { padding: 0 16px 16px; color: var(--text-2); font-size: 15px; }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--tabbar-h) + 18px + var(--safe-b));
  transform: translate(-50%, 16px);
  max-width: min(400px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--text); color: var(--bg);
  font-size: 15px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-state) var(--ease-out), transform var(--t-state) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast .i { width: 18px; height: 18px; color: var(--ok); }

/* ---------- Доступность движения и слабые устройства ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.is-low-perf .bokeh i, .is-low-perf .pill .dot { animation: none; }
.is-low-perf .tabbar, .is-low-perf .checkout { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
