/* ==========================================================================
   Clod VPN — личный кабинет. Дизайн-система v7.

   Принципы
   1. Одна мысль на экран, одно главное действие. Синий — только у главной кнопки
      и выбранного варианта. Чёрный — только текст. Иконки, маркеры, ссылки — серые.
      Зелёный (работает/включено), жёлтый (скоро закончится), красный (не работает) —
      только когда есть повод; главная карточка подкрашивается так же.
   2. Квадрат вместо круга: точки статуса, маркеры, шаги, пиксели срока — как в знаке Clod.
   3. Тихая типографика: жирный только у чисел и заголовков; подписи — обычные, приглушённые.
   4. Глубина честная: карточки отделены волосяной линией, тень — только у того, что парит
      (полоса оплаты, меню, шторка, тост).
   5. Один язык выбора: карточки — синяя рамка; переключатели — «бегунок» на сером треке.
   ========================================================================== */

/* ---------- Токены ---------- */
:root,
[data-theme="light"] {
  --bg: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #e8eaf0;
  --line: rgba(12, 16, 28, 0.08);
  --line-strong: rgba(12, 16, 28, 0.16);

  --ink: #0b0e17;
  --ink-2: #3a404f;
  --muted: #5f6577;   /* 5.1:1 на фоне — AA */
  --faint: #a3a8b6;   /* только для декоративных значков, не для текста */
  --on-ink: #ffffff;

  --brand-blue: #1677ff; /* цвет знака Clod */
  --blue: #0d68e6;       /* кнопки: белый текст 5.1:1 — AA */
  --blue-press: #0a5ccc;
  --blue-soft: #e8f0ff;
  --blue-text: #0d5fd9;

  --ok: #087a3c;
  --ok-soft: #e2f5ea;
  --warn: #935700;
  --warn-soft: #fdf1dc;
  --bad: #c22e36;
  --bad-soft: #fde8e9;

  --hero: #ffffff;
  --hero-2: #f4f5f8;
  --hero-text: #0b0e17;
  --hero-muted: #5f6577;
  --hero-line: rgba(12, 16, 28, 0.08);
  --hero-pixel-off: #e4e7ee;
  --pix-on: #93bcff;

  --shadow: 0 0 0 1px rgba(12, 16, 28, 0.05), 0 1px 2px rgba(12, 16, 28, 0.04), 0 6px 16px -10px rgba(12, 16, 28, 0.1);
  --shadow-lift: 0 0 0 1px rgba(12, 16, 28, 0.05), 0 14px 36px -12px rgba(12, 16, 28, 0.26);
  --overlay: rgba(11, 14, 23, 0.4);
  --grid: rgba(12, 16, 28, 0.05);
  color-scheme: light;
}

[data-theme="gray"] {
  --bg: #111216;
  --surface: #1b1c21;
  --surface-2: #24262c;
  --surface-3: #2e3037;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.15);

  --ink: #f2f3f6;
  --ink-2: #c8cbd4;
  --muted: #9ca0ae;
  --faint: #5e6371;
  --on-ink: #0d0e12;

  --brand-blue: #3d8bff;
  --blue: #256be0;
  --blue-press: #1f60cc;
  --blue-soft: rgba(61, 139, 255, 0.15);
  --blue-text: #86b7ff;

  --ok: #4cc88a;
  --ok-soft: rgba(76, 200, 138, 0.14);
  --warn: #f0b04a;
  --warn-soft: rgba(240, 176, 74, 0.13);
  --bad: #ff6b70;
  --bad-soft: rgba(255, 107, 112, 0.14);

  --hero: #1b1c21;
  --hero-2: #24262c;
  --hero-text: #f2f3f6;
  --hero-muted: #9ca0ae;
  --hero-line: rgba(255, 255, 255, 0.07);
  --hero-pixel-off: #2c2e35;
  --pix-on: #4a76b8;

  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 44px -14px rgba(0, 0, 0, 0.75);
  --overlay: rgba(0, 0, 0, 0.6);
  --grid: rgba(255, 255, 255, 0.035);
  color-scheme: dark;
}

:root {
  --r: 22px;       /* карточки */
  --r-md: 14px;    /* поля, кнопки, варианты */
  --r-sm: 10px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); transition: background-color .3s var(--ease); }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "ss01" 0;
}
/* Фирменная сетка Clod — только вверху и тает к середине экрана */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; inset: 0 0 auto 0; height: 380px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: center -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
a { color: var(--blue-text); text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, .card-title, .page-title, .sheet-title, .result-title, .wiz-q { text-wrap: balance; }
p, .card-text, .note, .setting-s, .row-sub, .step-text, .result-text, .wiz-lead { text-wrap: pretty; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.num, .kv-v, .hint { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Каркас ---------- */
#app { max-width: 480px; margin: 0 auto; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.page {
  padding: max(10px, env(safe-area-inset-top)) 16px calc(var(--nav-h) + 28px + var(--safe-b));
  display: flex; flex-direction: column; gap: 12px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 0; min-height: 48px; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 4px 2px; }
.page-lead { color: var(--muted); margin: -2px 4px 4px; font-size: 15px; }
.section-title { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 14px 6px -4px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 6px -4px; }
.section-head .section-title { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* Появление: блоки поднимаются каскадом, без «прыжков» */
.reveal > * { animation: rise .5s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .035s; }
.reveal > *:nth-child(3) { animation-delay: .07s; }
.reveal > *:nth-child(4) { animation-delay: .105s; }
.reveal > *:nth-child(5) { animation-delay: .14s; }
.reveal > *:nth-child(n+6) { animation-delay: .175s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Заголовок страницы не «моргает», когда содержимое догружается после скелета */
.reveal > :is(.page-title, .page-lead, .topbar, .wiz-head, .sr-only) { animation: none; }

/* Переход между вкладками: один короткий кроссфейд страницы.
   Остальной экран (меню, фон) не участвует — иначе подсветка вкладки двоится («призрак»). */
::view-transition-old(root) { display: none; }
::view-transition-new(root) { animation: none; }
::view-transition-group(page) { animation-duration: .24s; }
::view-transition-old(page) { animation: vt-out .12s ease-out both; }
::view-transition-new(page) { animation: vt-in .24s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Бренд ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.brand-mark { width: 28px; height: 22px; flex: none; overflow: visible; }
.brand-mark rect { transform-box: fill-box; transform-origin: center; }
.brand-mark .m-ink { fill: var(--ink); }
.brand-mark .m-blue { fill: var(--brand-blue); }
.brand-mark .m-light { fill: #d4e5ff; }
[data-theme="gray"] .brand-mark .m-light { fill: #34507c; }
.brand-mark.animate rect { animation: pix-in .6s var(--spring) both; }
.brand-mark.animate rect:nth-child(2) { animation-delay: .08s; }
.brand-mark.animate rect:nth-child(3) { animation-delay: .16s; }
.brand-mark.animate rect:nth-child(4) { animation-delay: .26s; }
@keyframes pix-in { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
.brand-word { font-weight: 850; font-size: 18px; letter-spacing: 0.01em; line-height: 1; }
.brand-word small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); margin-left: 6px; vertical-align: 2px; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); position: relative; }
.card-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.25; }
.card-text { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }

/* ---------- Главная карточка ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero); color: var(--hero-text);
  border-radius: 28px; padding: 22px;
  box-shadow: var(--shadow);
}
/* Состояние карточки — только квадратом у статуса; заливки и цветные рамки не используем */
/* Сетка — фактура логотипа, проявляется только в правом верхнем углу */
.hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(90% 80% at 100% 0%, #000, transparent 75%); mask-image: radial-gradient(90% 80% at 100% 0%, #000, transparent 75%);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; }
.hero-status { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--hero-text); }
.hero-status i { width: 8px; height: 8px; border-radius: 2px; background: var(--ok); animation: beat 2.4s var(--ease) infinite; }
.hero-status.is-bad i { background: var(--bad); animation: none; }
.hero-status.is-warn i { background: var(--warn); animation: none; }

.hero-status.is-muted i { background: var(--hero-muted); animation: none; }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 60% { box-shadow: 0 0 0 7px transparent; } }
.hero-top > .hero-status { flex: none; white-space: nowrap; }
.hero-chip { display: inline-block; min-width: 0; flex: 0 1 auto; line-height: 28px; height: 28px; padding: 0 11px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.hero-chip .ico { display: none; }
.hero-big { display: flex; align-items: baseline; gap: 10px; margin-top: 20px; }
.hero-num { font-size: 76px; font-weight: 700; letter-spacing: -0.055em; line-height: .86; font-variant-numeric: tabular-nums; }
.hero-unit { font-size: 21px; font-weight: 600; color: var(--hero-muted); letter-spacing: -0.01em; }
.hero-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin: 18px 0 0; position: relative; z-index: 1; }
.hero-pix ~ .hero-title { padding-right: 84px; }
.hero-sub { color: var(--hero-muted); font-size: 14.5px; margin-top: 10px; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.hero-actions.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.hero-link { background: none; border: 0; color: var(--hero-muted); font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px 4px; display: inline-flex; gap: 6px; align-items: center; transition: color .2s; }
.hero-link:hover { color: var(--hero-text); }
.hero-link .ico { width: 16px; height: 16px; }
.hero-tag { font-size: 13px; color: var(--hero-muted); font-weight: 600; }
/* Пиксельный знак — иллюстрация для экрана «подписки нет» */
.hero-pix { position: absolute; right: 22px; top: 62px; width: 70px; height: 56px; z-index: 0; pointer-events: none; }
.hero-pix i { position: absolute; width: 24px; height: 24px; border-radius: 6px; animation: float 6s ease-in-out infinite; }
.hero-pix i:nth-child(1) { left: 0; top: 0; background: var(--ink); }
.hero-pix i:nth-child(2) { left: 29px; top: 0; background: var(--brand-blue); animation-delay: -1.5s; }
.hero-pix i:nth-child(3) { left: 0; top: 29px; background: var(--brand-blue); animation-delay: -3s; }
.hero-pix i:nth-child(4) { left: 50px; top: 34px; width: 20px; height: 20px; border-radius: 5px; background: #d4e5ff; animation-delay: -4.5s; }
[data-theme="gray"] .hero-pix i:nth-child(4) { background: #34507c; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.hero.is-bad .hero-pix i:nth-child(2), .hero.is-bad .hero-pix i:nth-child(3) { background: #ff6b70; }

/* Срок пикселями: один квадрат — один день; прошедшие гаснут, оставшиеся горят */
.strip { display: grid; gap: 3px; margin-top: 20px; }
.strip i { aspect-ratio: 1; max-height: 10px; border-radius: 2px; background: var(--hero-pixel-off); }
.strip i.on, .strip i.warn, .strip i.bad { animation: strip-in .5s var(--spring) both; }
.strip i.on { background: var(--pix-on); }
.strip i.warn { background: var(--warn); }
.strip i.bad { background: var(--bad); }
@keyframes strip-in { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-dates { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--hero-muted); font-variant-numeric: tabular-nums; }
.hero-dates b { color: var(--hero-text); font-weight: 600; }

/* ---------- Факты (устройства, трафик) ---------- */
.fact {
  background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow);
  text-align: left; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink);
}
button.fact { cursor: pointer; transition: transform .2s var(--spring), background-color .2s; }
button.fact:active { transform: scale(.97); }
.fact-label { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fact-label .ico { width: 16px; height: 16px; color: var(--faint); }
.fact-value { font-size: 23px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.fact-sub { font-size: 13px; color: var(--muted); }
.fact-pix { display: flex; gap: 4px; margin-top: 7px; height: 10px; }
.fact-pix i { width: 10px; height: 10px; border-radius: 2.5px; background: var(--surface-3); }
.fact-pix i.on { background: var(--ok); animation: strip-in .45s var(--spring) both; }
.fact-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 9px; }
.fact-meter i { display: block; height: 100%; border-radius: 3px; background: var(--muted); }

/* ---------- Ссылка подписки ---------- */
.link-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.link-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.link-head .t { font-weight: 650; font-size: 16px; }
.link-head .s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.link-field {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px 0 14px;
  border: 0; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); cursor: pointer; text-align: left;
  transition: transform .18s var(--spring), background-color .2s;
}
.link-field:hover { background: var(--surface-3); }
.link-field:active { transform: scale(.985); }
.link-field > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-field .ico { width: 18px; height: 18px; color: var(--muted); }
.link-field[data-copying] { font-family: var(--font); font-weight: 600; color: var(--ok); justify-content: center; }
.link-field[data-copying] .ico { color: var(--ok); }
/* старый вариант (оставлен для совместимости) */
.link-top { display: flex; align-items: center; gap: 12px; }
.link-value { font-family: var(--mono); font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Строка-действие ---------- */
.action-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 16px;
  background: var(--surface); border: 0; border-radius: var(--r); box-shadow: var(--shadow);
  cursor: pointer; text-align: left; color: var(--ink); transition: transform .2s var(--spring), background-color .2s;
}
.action-row:active { transform: scale(.985); }
.action-row .t { font-weight: 600; font-size: 16px; }
.action-row .s { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.action-row > .ico:first-child, .action-row .ico-bubble { flex: none; }
.action-row > .ico:last-child { width: 16px; height: 16px; color: var(--faint); }
.action-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }

/* ---------- Кнопки ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 15px; border: 0;
  background: var(--blue); color: #fff;
  font-weight: 650; font-size: 16px; letter-spacing: -0.005em; line-height: 1.15; text-align: center;
  cursor: pointer; text-decoration: none;
  transition-property: transform, background-color, opacity, box-shadow; transition-duration: .18s; transition-timing-function: var(--ease);
}
.btn:hover { background: var(--blue-press); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: var(--ink); opacity: .9; }
.btn-soft { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover { background: var(--surface-3); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-white { background: #fff; color: #0b0e17; }
.btn-white:hover { background: #eef0f4; }
.btn-ghost-dark { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost-dark:hover { background: var(--surface-3); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); opacity: .85; }
.btn .ico { width: 18px; height: 18px; }
.btn .spinner { width: 20px; height: 20px; border-width: 2.5px; border-color: currentColor; border-top-color: transparent; }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; border: 0;
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; transition: transform .18s var(--spring);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .ico { width: 20px; height: 20px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px 0 12px; border-radius: 13px; border: 0;
  background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
  font-weight: 650; font-size: 15px; cursor: pointer; font-variant-numeric: tabular-nums; transition: transform .18s var(--spring);
}
.chip-btn:active { transform: scale(.95); }
.chip-btn .ico { width: 18px; height: 18px; color: var(--muted); }
.link-btn { position: relative; background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 8px 0; font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.link-btn .ico { width: 16px; height: 16px; color: var(--muted); }
.note .link-btn, .fine .link-btn { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link-btn:active { opacity: .6; }
.quiet-link { color: var(--muted); font-weight: 500; font-size: 14px; }
.quiet-link .ico { color: var(--faint); }

/* ---------- Иконки (пиксельные, заливка) ---------- */
.ico { width: 24px; height: 24px; flex: none; fill: currentColor; stroke: none; }

/* ---------- Списки (сгруппированные, разделители с отступом) ---------- */
.list { background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.list-item {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 16px;
  background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink);
  font-size: 16px; font-weight: 500; transition: background-color .15s;
}
.list-item + .list-item::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--line); }
.list-item:has(> .ico:first-child) + .list-item::before,
.list-item + .list-item:has(> .ico:first-child)::before { left: 54px; }
.list-item:hover { background: var(--surface-2); }
.list-item:active { background: var(--surface-3); }
.list-item > .ico:first-child { width: 24px; height: 24px; color: var(--muted); }
.list-item > .ico:last-child { width: 16px; height: 16px; color: var(--faint); }
.list-item .hint { color: var(--muted); font-weight: 400; font-size: 15px; white-space: nowrap; }
.list-item.is-danger, .list-item.is-danger > .ico:first-child { color: var(--bad); }
/* Нейтральная «подложка» под иконку (где она нужна) */
.ico-bubble { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ico-bubble .ico { width: 22px; height: 22px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.row-amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amount.plus { color: var(--ok); }
.row-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--ink); }
.row-ico .ico { width: 22px; height: 22px; }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 9px 0; }
.kv-k { color: var(--muted); font-size: 14.5px; flex: 1 1 auto; min-width: 0; }
.kv-v { font-weight: 600; text-align: right; flex: 0 1 auto; max-width: 66%; overflow-wrap: anywhere; }
.kv-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 13px; }
.kv-total .kv-k { color: var(--ink); font-weight: 600; font-size: 15.5px; }
.kv-total .kv-v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.kv-sep { border-top: 1px dashed var(--line-strong); margin-top: 6px; padding-top: 12px; }
.kv-good .kv-v { color: var(--ok); }

/* ---------- Статусы ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.status-ok { color: var(--ok); } .status-warn { color: var(--warn); } .status-bad { color: var(--bad); }
.status-muted { color: var(--muted); } .status-blue { color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 7px; font-size: 12px; font-weight: 650; background: var(--ok-soft); color: var(--ok); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge-blue { background: var(--blue-soft); color: var(--blue-text); }
.badge-ink { background: var(--surface-3); color: var(--ink-2); }

/* ---------- Выбор: карточки-варианты (один язык для тарифа, срока, оплаты, суммы) ---------- */
.choice-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.choice {
  position: relative; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 0; border-radius: 18px; padding: 15px 16px;
  box-shadow: var(--shadow);
  transition-property: box-shadow, background-color, transform; transition-duration: .2s; transition-timing-function: var(--ease);
  display: flex; flex-direction: column; gap: 2px; min-height: 84px;
}
.choice:active { transform: scale(.97); }
.choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.choice-title { font-weight: 600; font-size: 15px; }
.choice-price { font-weight: 700; font-size: 21px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.choice-sub { font-size: 13px; color: var(--muted); }
.choice-old { font-size: 12.5px; color: var(--muted); text-decoration: line-through; }
.choice .badge { position: absolute; top: 12px; right: 12px; }
.choice-wide { grid-column: 1 / -1; min-height: 0; }
.tariff-card { padding: 16px 16px 15px; gap: 4px; }
.tariff-switch { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tariff-switch .ico { width: 14px; height: 14px; flex: none; }

.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 0; border-radius: 16px; box-shadow: var(--shadow);
  transition-property: box-shadow, background-color, transform; transition-duration: .2s; transition-timing-function: var(--ease);
}
.sheet .pay, .sheet .choice { box-shadow: inset 0 0 0 1px var(--line-strong); }
.sheet .pay[aria-checked="true"], .sheet .choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--blue); }
.pay:active { transform: scale(.985); }
.pay[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.pay-title { font-weight: 600; }
.pay-sub { font-size: 13px; color: var(--muted); }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); flex: none; display: grid; place-items: center; transition: box-shadow .2s; }
[aria-checked="true"] .radio { box-shadow: inset 0 0 0 2px var(--blue); }
[aria-checked="true"] .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); animation: pop .3s var(--spring); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.amount-chip {
  border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink);
  border-radius: 12px; min-height: 42px; padding: 0 15px; cursor: pointer; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums;
  transition-property: box-shadow, background-color, transform; transition-duration: .18s; transition-timing-function: var(--ease);
}
.amount-chip:active { transform: scale(.95); }
.amount-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }

/* ---------- Переключатели: сегменты, тумблер, счётчик ---------- */
.segmented { position: relative; display: flex; background: var(--surface-3); border-radius: 13px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  position: relative; z-index: 1; flex: 1 0 auto; min-height: 36px; border: 0; background: none; color: var(--muted);
  padding: 0 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition-property: color, background-color, box-shadow; transition-duration: .2s;
}
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(12, 16, 28, .1), 0 0 0 1px var(--line); }
[data-theme="gray"] .segmented button[aria-selected="true"], [data-theme="gray"] .segmented button[aria-pressed="true"] { background: var(--surface-2); }

.switch { position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--surface-3); border: 0; cursor: pointer; flex: none; transition: background-color .25s var(--ease); box-shadow: inset 0 0 0 1px var(--line); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .4s var(--spring); }
.switch[aria-checked="true"] { background: var(--ok); box-shadow: none; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch[disabled] { opacity: .5; cursor: default; }
.switch .spinner { display: none; }

.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-3); border-radius: 13px; padding: 3px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: 0 1px 2px rgba(12, 16, 28, .1), 0 0 0 1px var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: transform .18s var(--spring), opacity .2s; }
[data-theme="gray"] .stepper button { background: var(--surface-2); }
.stepper button .ico { width: 16px; height: 16px; }
.stepper button:active { transform: scale(.88); }
.stepper button[disabled] { opacity: .35; cursor: default; transform: none; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- Настройки подписки ---------- */
.settings { padding: 4px 18px; }
.setting { display: flex; align-items: center; gap: 14px; padding: 15px 0; }
.settings > div + div > .setting:first-child, .setting + .setting, .setting-extra + .setting { border-top: 1px solid var(--line); }
.setting-t { font-weight: 600; font-size: 16px; }
.setting-s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.setting-extra { padding: 0 0 16px; display: flex; flex-direction: column; gap: 10px; animation: rise .3s var(--ease) both; }
.setting-extra:empty { display: none; }
.setting > .ico-bubble { display: none; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.input {
  width: 100%; min-height: 52px; padding: 13px 15px; background: var(--surface-2); border: 0; border-radius: var(--r-md);
  outline: none; font-size: 16px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  transition-property: box-shadow, background-color; transition-duration: .2s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue); }
textarea.input { min-height: 110px; resize: vertical; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.input-row .btn { min-height: 52px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input, .check-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); flex: none; }
.check-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.sheet .check-row { box-shadow: inset 0 0 0 1px var(--line-strong); }
.form-error { color: var(--bad); font-size: 14px; animation: shake .35s; }
.form-error:empty { display: none; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Пояснения: квадратный маркер слева вместо цветной заливки на всю ширину */
.note { position: relative; background: var(--surface-2); color: var(--ink-2); border-radius: var(--r-md); padding: 12px 14px 12px 32px; font-size: 14px; line-height: 1.45; }
.note::before { content: ""; position: absolute; left: 14px; top: 18px; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.note-blue::before { background: var(--blue); }
.note-warn::before { background: var(--warn); }
.note-ok::before { background: var(--ok); }
.page > .note, .wiz-body > .note, .wiz-body .stack > .note { background: var(--surface); box-shadow: var(--shadow); }
.fine { font-size: 12.5px; color: var(--muted); text-align: center; text-wrap: pretty; }

.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullets li { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.bullets li::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--faint); flex: none; margin-top: 8px; }

/* ---------- Установка ---------- */
.platforms { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.platforms::-webkit-scrollbar { display: none; }
.platform {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; padding: 12px 4px 10px;
  border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition-property: transform, box-shadow, color, background-color; transition-duration: .2s;
}
.platform .ico { width: 24px; height: 24px; }
.platform:active { transform: scale(.95); }
.platform[aria-selected="true"] { color: var(--ink); background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.step-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; display: grid; grid-template-columns: 30px 1fr; gap: 2px 14px; }
.step-n { grid-row: span 3; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 1px; }
.step-card.is-done .step-n { background: var(--ok-soft); color: var(--ok); }
.step-title { font-weight: 650; font-size: 17px; margin: 3px 0 0; line-height: 1.3; letter-spacing: -0.01em; }
.step-text { color: var(--muted); font-size: 14.5px; margin: 3px 0 0; }
.step-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.qr-box { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.qr-box svg { width: 112px; height: 112px; border-radius: 10px; flex: none; animation: rise .5s var(--ease) both; }
.qr-box .t { font-weight: 600; font-size: 14.5px; }
.qr-box .s { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* Вопросы */
.faq { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-q { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 13px 16px; background: none; border: 0; text-align: left; cursor: pointer; font-weight: 500; font-size: 15.5px; color: var(--ink); }
.faq-q span { flex: 1; text-wrap: pretty; }
.faq-q .ico { width: 16px; height: 16px; color: var(--faint); transition: transform .3s var(--spring); }
.faq-item.open .faq-q .ico { transform: rotate(90deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p { margin: 0; padding: 0 16px 16px; color: var(--ink-2); font-size: 14.5px; }

/* ---------- Поддержка ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; animation: rise .3s var(--ease) both; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.me .msg-time { color: rgba(255, 255, 255, .7); }
.msg.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg-time { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.doc { font-size: 15px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.doc h1, .doc h2, .doc h3 { font-size: 18px; margin: 16px 0 8px; color: var(--ink); line-height: 1.3; }
.doc p { margin: 0 0 10px; }
.doc ul, .doc ol { padding-left: 20px; }

/* ---------- Нижнее меню ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 6px 8px calc(6px + var(--safe-b));
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 -1px 0 var(--line);
  z-index: 20;
}
.nav-pill { position: absolute; top: 6px; left: 8px; height: calc(var(--nav-h) - 12px); border-radius: 14px; background: var(--surface-3); transition: transform .34s cubic-bezier(0.3, 0.7, 0.2, 1), width .34s cubic-bezier(0.3, 0.7, 0.2, 1); will-change: transform; z-index: 0; }
[data-theme="gray"] .nav-pill { background: var(--surface-2); }
.nav button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .01em; border-radius: 14px; transition: color .2s; }
.nav button .ico { width: 24px; height: 24px; transition: transform .35s var(--spring); }
.nav button[aria-current="page"] { color: var(--ink); }

/* ---------- Шторка ---------- */
.sheet-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s var(--ease); }
.sheet-overlay.open { opacity: 1; }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh;
  background: var(--surface); color: var(--ink);
  border-radius: 28px 28px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .45s var(--spring);
  box-shadow: var(--shadow-lift);
  touch-action: pan-y;
}
.sheet-overlay.open .sheet { transform: none; }
.sheet.dragging { transition: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 6px 22px; cursor: grab; }
.sheet-title { font-size: 21px; font-weight: 700; flex: 1; letter-spacing: -0.02em; margin: 0; }
.sheet-body { padding: 6px 22px calc(22px + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.sheet-body > * { flex-shrink: 0; }
.sheet-body.swap > * { animation: rise .35s var(--ease) both; }
.sheet-handle { width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
.sheet .icon-btn { box-shadow: none; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; color: var(--muted); }
.sheet .icon-btn .ico { width: 16px; height: 16px; }
.sheet .card { box-shadow: inset 0 0 0 1px var(--line); }
.sheet-footer { position: sticky; bottom: calc(-22px - var(--safe-b)); z-index: 2; margin: 0 -22px calc(-22px - var(--safe-b)); padding: 12px 22px calc(16px + var(--safe-b)); background: var(--surface); box-shadow: 0 -1px 0 var(--line); display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: 28px; max-height: 86vh; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .4s var(--spring), opacity .25s; }
  .sheet-overlay.open .sheet { opacity: 1; }
  .sheet-handle { display: none; }
}

/* ---------- Результат и ожидание ---------- */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 0 6px; }
.result-mark { position: relative; width: 72px; height: 72px; margin-bottom: 12px; }
.result-mark i { position: absolute; width: 32px; height: 32px; border-radius: 8px; animation: pix-in .55s var(--spring) both; }
.result-mark i:nth-child(1) { left: 0; top: 0; background: var(--ink); }
.result-mark i:nth-child(2) { right: 0; top: 0; background: var(--brand-blue); animation-delay: .07s; }
.result-mark i:nth-child(3) { left: 0; bottom: 0; background: var(--brand-blue); animation-delay: .14s; }
.result-mark i:nth-child(4) { right: 0; bottom: 0; background: var(--ok); animation-delay: .24s; display: grid; place-items: center; }
.result-mark.is-bad i:nth-child(4) { background: var(--bad); }
.result-mark svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.result-mark svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .4s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.result-text { color: var(--muted); font-size: 15px; max-width: 34ch; }
.waiting { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0; }
.waiting-pix { display: grid; grid-template-columns: repeat(2, 16px); gap: 5px; margin-bottom: 8px; }
.waiting-pix i { width: 16px; height: 16px; border-radius: 4px; background: var(--brand-blue); animation: blink 1.2s infinite var(--ease); }
.waiting-pix i:nth-child(1) { background: var(--ink); }
.waiting-pix i:nth-child(2) { animation-delay: .15s; }
.waiting-pix i:nth-child(3) { animation-delay: .45s; }
.waiting-pix i:nth-child(4) { animation-delay: .3s; background: var(--surface-3); }
@keyframes blink { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: .25; transform: scale(.8); } }

/* ---------- Тосты ---------- */
.toasts { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 24px); max-width: 420px; pointer-events: none; }
.toast { background: var(--ink); color: var(--on-ink); border-radius: 15px; padding: 13px 16px; font-size: 15px; font-weight: 550; display: flex; gap: 11px; align-items: center; box-shadow: var(--shadow-lift); animation: toast-in .45s var(--spring); pointer-events: auto; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #4ade80; flex: none; }
.toast-bad::before { background: #ff6b70; }
.toast-info::before { background: var(--blue); }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- Загрузка и пустые состояния ---------- */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r); box-shadow: var(--shadow); }
.skel.dark { background: linear-gradient(90deg, var(--hero) 25%, var(--hero-2) 50%, var(--hero) 75%); background-size: 200% 100%; box-shadow: none; border-radius: 28px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 16px 4px; display: flex; flex-direction: column; gap: 6px; }
.empty-title { font-weight: 650; font-size: 16.5px; }
.empty-text { color: var(--muted); font-size: 14.5px; }

/* ---------- Вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: max(24px, env(safe-area-inset-top)) 16px calc(24px + var(--safe-b)); }
.login-brand { display: flex; flex-direction: column; gap: 14px; padding: 0 6px 6px; }
.login-brand .brand-mark { width: 44px; height: 34px; }
.login-word { font-size: 50px; font-weight: 900; line-height: .95; margin: 0; letter-spacing: 0.005em; }
.login-word small { display: block; font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 10px; }
.login-bars { display: flex; gap: 6px; }
.login-bars::before { content: ""; width: 56px; height: 5px; border-radius: 2px; background: var(--ink); }
.login-bars::after { content: ""; width: 14px; height: 5px; border-radius: 2px; background: var(--brand-blue); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; padding: 0 6px; }
.legal-links button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 0; }
.oauth-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }

/* Демо-режим: маленькая метка сверху, не перекрывает интерфейс */
.demo-badge { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ink-2); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; padding: 3px 7px 4px; border-radius: 0 0 6px 6px; letter-spacing: .08em; pointer-events: none; }

/* ---------- Профиль ---------- */
.avatar-pix { position: relative; width: 56px; height: 56px; border-radius: 17px; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; overflow: hidden; }
.avatar-pix::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.avatar-pix img { width: 100%; height: 100%; object-fit: cover; outline: 1px solid rgba(0, 0, 0, .08); outline-offset: -1px; }

/* ---------- Полоса оплаты (парит над меню) ---------- */
.pay-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
  border-radius: 20px; box-shadow: var(--shadow-lift);
}
.pay-bar .grow { flex: 1; min-width: 0; }
.pay-bar .t { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pay-bar .t.t-name { font-size: 17px; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-bar .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pay-bar .btn { min-width: 138px; }
.pay-bar .btn .ico { width: 16px; height: 16px; margin-right: -4px; }

/* ---------- Покупка по шагам ---------- */
.wiz-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; min-height: 44px; }
.wiz-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 0 4px; }
.wiz-head .icon-btn + .wiz-title { margin-left: 0; }
.wiz-steps { list-style: none; margin: 0; padding: 4px 6px; display: flex; align-items: center; }
.wiz-steps li { flex: 1; display: flex; align-items: center; min-width: 0; }
.wiz-steps li:first-child { flex: 0 0 auto; }
.wiz-steps li + li::before { content: ""; flex: 1; min-width: 10px; height: 2px; margin: 0 10px; border-radius: 1px; background: var(--line-strong); transition: background-color .3s; }
.wiz-step { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wiz-step i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; font-style: normal; font-size: 12.5px; font-weight: 700; background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition-property: background-color, box-shadow, color; transition-duration: .3s; }
.wiz-step i .ico { width: 14px; height: 14px; }
.wiz-step.is-now { color: var(--ink); }
.wiz-step.is-now i { background: var(--blue-soft); color: var(--blue-text); box-shadow: inset 0 0 0 1.5px var(--blue); animation: wizPop .35s var(--spring) both; }
.wiz-step.is-done { color: var(--ink-2); cursor: pointer; }
.wiz-step.is-done i { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
button.wiz-step:active i { transform: scale(.9); }
@media (max-width: 360px) { .wiz-step:not(.is-now) > span { display: none; } }
.wiz-body { display: flex; flex-direction: column; gap: 12px; }
.wiz-in { animation: wizIn .34s var(--ease) both; }
.wiz-in-back { animation: wizBack .34s var(--ease) both; }
@keyframes wizIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes wizBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes wizPop { from { transform: scale(.6); } to { transform: none; } }
.wiz-q { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 4px 0; line-height: 1.2; }
.wiz-lead { color: var(--muted); font-size: 14.5px; margin: -4px 4px 2px; }
.wiz-hint { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 14.5px; color: var(--ink-2); }
.wiz-hint .ico { width: 20px; height: 20px; flex: none; color: var(--muted); }
.wiz-hint b { color: var(--ink); font-weight: 650; }

/* Итог заказа */
.order { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 18px 12px; }
.sheet .order { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.order-title { font-weight: 650; font-size: 16px; padding: 12px 0 4px; }
.promo { padding: 0 4px; }

/* ---------- Доступность движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  ::view-transition-old(page), ::view-transition-new(page) { animation: none; }
}
.wiz-hints { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.wiz-hints .wiz-hint { background: none; box-shadow: none; border-radius: 0; }
.wiz-hints .wiz-hint + .wiz-hint { border-top: 1px solid var(--line); }

/* Текст только для экранного диктора */
.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; }

/* ---------- Узкие экраны и длинные данные (аудит: 320 px, длинные названия, большие суммы) ---------- */
.chip-btn { white-space: nowrap; flex: none; }
.btn { text-wrap: balance; }
.quiet-link { text-wrap: balance; text-align: center; }
.link-head { flex-wrap: wrap; row-gap: 2px; }
.link-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.link-head .link-btn { white-space: nowrap; }
.segmented button { flex: 1 1 auto; min-width: 0; padding: 0 10px; }
.balance-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; }
.balance-card .num { font-size: clamp(22px, 7vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.person-name { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 359px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .brand-word small { display: none; }
  .hero { padding: 18px; }
  .hero-num { font-size: 64px; }
  .hero-actions.two .btn { padding: 0 12px; }
  .hero-actions.two .btn .ico { display: none; }
  .pay-bar .btn { min-width: 0; padding: 0 18px; }
  .pay-bar { padding-left: 14px; }
  .fact { padding: 14px; }
  .fact-value { font-size: 20px; }
  .quiet-link .ico { display: none; }
}

/* Повторный показ главной: всё сразу на месте, без «загорания» пикселей */
.calm .strip i, .calm .fact-pix i { animation: none; }

/* ---------- Совместимость со старыми iPhone (Telegram на iOS работает на системном Safari) ---------- */
/* Safari < 16.2 не знает color-mix: без этого меню и полоса оплаты стали бы прозрачными,
   а подкраска главной карточки («скоро закончится» / «не работает») пропала бы. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .nav, .pay-bar { background: var(--surface); }
}
/* Safari < 15 не знает aspect-ratio — пиксели срока были бы нулевой высоты */
@supports not (aspect-ratio: 1) {
  .strip i { height: 8px; }
}

/* ---------- Докупка трафика ---------- */
.tpix { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.tpix i { aspect-ratio: 1; max-height: 10px; border-radius: 2px; background: var(--hero-pixel-off); }
.tpix i.used { background: var(--faint); }
.tpix i.add { background: var(--pix-on); animation: strip-in .4s var(--spring) both; }
@supports not (aspect-ratio: 1) { .tpix i { height: 8px; } }
.tline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tline .now { font-size: 15px; color: var(--muted); }
.tline .now b { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.tline .next { font-size: 15px; color: var(--muted); white-space: nowrap; }
.tline .next b { color: var(--ink); font-weight: 650; }
.tnote { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Изменение числа устройств: панель одной высоты, открывается плавно ---------- */
.dev-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s var(--ease), opacity .2s var(--ease); }
.dev-panel.open { grid-template-rows: 1fr; opacity: 1; }
.dev-panel-in { min-height: 0; overflow: hidden; }
.dev-panel-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 16px; }
.dev-sum { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.dev-sum-t { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.dev-sum-s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-sum-p { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.dev-sum-p.is-loading { opacity: .35; }

/* ---------- Частые вопросы: значок у вопроса, ответ — суть, шаги, кнопка ---------- */
.faq-q > .ico:last-child { width: 16px; height: 16px; color: var(--faint); }
.faq-q .ico.faq-ico { width: 20px; height: 20px; color: var(--muted); transform: none; transition: color .2s; }
.faq-item.open .faq-q .ico.faq-ico { transform: none; color: var(--ink); }
.faq-item.open .faq-q { font-weight: 600; }
.faq-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 18px 48px; }
.faq-a .faq-body p.faq-lead { margin: 0; padding: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.faq-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.faq-steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); line-height: 1.4; }
.faq-steps li::before { content: counter(s); flex: none; width: 20px; height: 20px; margin-top: 0; border-radius: 6px; background: var(--surface-3); color: var(--ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.faq-body .bullets li { font-size: 14.5px; }
.faq-act { align-self: flex-start; margin-top: 2px; }
