:root {
  --bg: #0b0d09;
  --surface: #171a14;
  --surface-2: #20241b;
  --surface-3: #2a3023;
  --line: #30362a;
  --text: #ffffff;
  --muted: #a5ad9a;
  --accent: #c8ff31;
  --accent-text: #000000;
  /* Текст акции: салатовый на тёмном фоне, тёмно-зелёный на светлом — иначе не читается. */
  --promo-text: #c8ff31;
  --ok: #30d158;
  --warn: #ffd60a;
  --danger: #ff453a;
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 12px;
  --pad: 16px;
}

:root[data-theme="light"] {
  --bg: #f4f6ef;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f2f2f7;
  --line: #e2e2e7;
  --text: #0b0b0c;
  --muted: #6e6e73;
  --accent: #c8ff31;
  --accent-text: #101407;
  --promo-text: #3a7d0a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------------------------------------------------------------- шапка */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  /* --tg-top — место под кнопки Telegram: на телефоне они рисуются поверх шапки.
     Правое поле отодвигает круглые кнопки от края окна, нижнее — отделяет
     шапку от первого блока, иначе она на него налезает. */
  padding: calc(12px + var(--tg-top, 0px)) 10px 10px 0;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.brand-icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--text);
}

.brand-text { min-width: 0; }
/* Блоками, а не строками: иначе на широком экране подпись липнет к названию. */
.brand-title { display: block; font-weight: 640; font-size: 16px; letter-spacing: -0.2px; }
.brand-sub { display: block; color: var(--muted); font-size: 13px; }

.icon-btn {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn:active { opacity: .7; }

/* ----------------------------------------------------------------- вид */

.view { flex: 1; padding-bottom: 96px; }
.loader { color: var(--muted); padding: 40px 0; text-align: center; }

h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.7px; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.3px; font-weight: 660; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 12px; }

/* --------------------------------------------------------------- герой */

.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
  margin-bottom: 14px;
}

.hero-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.eyebrow {
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
}
.badge {
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}

.hero p { color: var(--muted); font-size: 15px; }

/* Акция: ярлык на главном экране и зачёркнутая обычная цена рядом с ценой по акции. */
.promo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 14px; padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.old-price {
  color: var(--muted); font-weight: 400;
  text-decoration: line-through; text-decoration-thickness: 1.5px;
}
.new-price { color: var(--text); font-weight: 700; }
.promo-value { color: var(--promo-text); }
.req-note { color: var(--promo-text); font-size: 12px; }

.cluster { display: flex; align-items: center; margin: 18px 0 20px; padding-left: 6px; }
.cluster .app-icon { margin-left: -10px; box-shadow: 0 0 0 4px var(--surface); }
.cluster .app-icon:first-child { margin-left: 0; }

/* -------------------------------------------------------------- кнопки */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-m);
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s ease;
}
.btn:active { opacity: .75; }
.btn[disabled] { opacity: .35; cursor: default; }

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-sm { padding: 11px 14px; font-size: 14px; border-radius: var(--radius-s); }

.cta-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; }

/* ---------------------------------------------------------------- шаги */

.flowline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px;
  padding: 14px 0 18px;
}
.flowline span.sep { opacity: .5; }
.flowline span.on { color: var(--text); }

.stepper { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-s);
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.chip.done { color: var(--text); }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px; font-size: 13px;
  margin-bottom: 14px;
}
.pill.ok { color: var(--ok); }

/* -------------------------------------------------------------- карточки */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 18px;
  margin-bottom: 14px;
}
.card.tight { padding: 14px; }

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.row:last-child { border-bottom: 0; }
.row .label { color: var(--muted); }
.row .value { font-weight: 600; text-align: right; }
/* UDID длиннее строки — переносим его, а не обрезаем. */
.row .value.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  min-width: 0;
}
/* Значение-кнопка: нажатие на UDID копирует его. Выглядит как текст, иконка подсказывает. */
.row .value.copyable {
  background: none; border: 0; padding: 0; margin: 0;
  color: inherit; cursor: pointer; text-align: right; line-height: inherit;
  -webkit-tap-highlight-color: transparent;
}
.row .value.copyable svg { vertical-align: -3px; margin-left: 4px; color: var(--muted); }
.row .value.copyable:active { color: var(--accent); }
.row .value.copyable:active svg { color: var(--accent); }

.product { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.product .app-icon { width: 46px; height: 46px; border-radius: 13px; font-size: 20px; }
.product .name { font-weight: 640; }
.product .sub { color: var(--muted); font-size: 13px; }

details.disclosure {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  margin: 14px 0;
}
details.disclosure > summary {
  cursor: pointer; font-weight: 600; font-size: 15px; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; color: var(--muted); transition: transform .15s ease; }
details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure .body { color: var(--muted); font-size: 14px; margin-top: 10px; white-space: pre-wrap; }

.path {
  background: var(--surface-3);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-size: 14px;
  margin: 12px 0;
}
.path b { font-weight: 600; }
.path .sep { color: var(--muted); margin: 0 6px; }

/* ----------------------------------------------------------------- поля */

.field { margin-top: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--text);
  font-size: 22px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  padding: 16px;
  outline: none;
}
.field input:focus { border-color: var(--muted); }
/* UDID из 40 символов не влезает в крупный кегль на узком экране. */
.field input.udid {
  font-size: 14px;
  letter-spacing: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }
.field-foot .count.full { color: var(--ok); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 8px; }

.check {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 18px 0;
  font-size: 14px;
  cursor: pointer;
}
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 22px; margin: 0; }

.linkish { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 8px 0; cursor: pointer; font-family: inherit; }
.linkish:active { opacity: .6; }

/* ------------------------------------------------------------- каталог */

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 12px;
}
.section-head h2 { margin: 0; }
.section-head button { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  position: relative;
  min-height: 108px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.app-card .app-icon { margin-bottom: 10px; }
.app-card .name { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.app-card .cat { font-size: 12px; color: var(--muted); }
/* Описание услуги обязано быть видно покупателю, но карточку раздувать нельзя. */
.app-card .desc {
  font-size: 11px; line-height: 1.35; color: var(--muted);
  margin-top: 4px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
}
.app-card .price { font-size: 12px; font-weight: 700; margin-top: 8px; }
.app-card .arrow { position: absolute; top: 12px; right: 12px; color: var(--muted); font-size: 13px; }
/* Версия и минимальная iOS — из сборки, которая лежит на сервере. */
.app-card .app-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Оформление заказа — весь верх карточки, скачивание — отдельной кнопкой:
   вложить ссылку в кнопку нельзя, поэтому карточка стала обычным блоком. */
.app-open {
  flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.app-get {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px; font-weight: 600; text-align: center;
  text-decoration: none;
}
.app-get:active { transform: scale(.97); border-color: var(--accent); }

.app-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
  color: #fff;
  overflow: hidden;
  flex: 0 0 auto;
  position: relative;
}
.app-icon.dark { color: #000; }
/* Если в webapp/icons/<slug>.png нет файла, картинка удаляется и остаётся буква. */
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Длинные слова без пробелов (ссылка, UDID, вставленный текст) не должны
   растягивать карточку вбок. */
.body, .notice, .row .value, .doc p, .doc li { overflow-wrap: anywhere; }

.body { color: var(--muted); font-size: 14px; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { cursor: pointer; }

/* ------------------------------------------------------------ таймлайн */

.timeline { margin: 6px 0 4px; }
.tl {
  display: flex; gap: 14px; padding: 12px 0;
  align-items: flex-start;
}
.tl .dot {
  width: 26px; height: 26px; border-radius: 50%;
  flex: 0 0 26px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--muted);
}
.tl.done .dot { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.tl.active .dot { background: var(--accent); color: var(--accent-text); }
.tl .t { font-size: 15px; font-weight: 600; }
.tl .s { font-size: 13px; color: var(--muted); }
.tl.pending .t { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------- о нас */

.doc-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 2px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-family: inherit; font-size: 15px; text-align: left;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row:not(.pending) { cursor: pointer; }
.doc-row:not(.pending):active { opacity: .7; }
.doc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-title { font-weight: 600; }
.doc-hint { color: var(--muted); font-size: 13px; }
.doc-flag {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.doc-flag.open { border-color: transparent; font-size: 15px; }

.legal { color: var(--muted); font-size: 14px; line-height: 1.5; }

.product-desc { color: var(--muted); font-size: 14px; line-height: 1.5; padding-bottom: 12px; }

/* ----------------------------------------------------------- реквизиты */

.requisites { display: flex; flex-direction: column; }

.req-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.req-row:last-child { border-bottom: 0; }
.req-row.comment { border-top: 1px solid var(--line); border-bottom: 0; }

.req-icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface-3);
  display: grid; place-items: center;
}
.req-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.req-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.req-label { color: var(--muted); font-size: 12px; }
.req-value {
  font-size: 16px; font-weight: 640; letter-spacing: .2px;
  overflow-wrap: anywhere;
}

.req-copy {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.req-copy:active { transform: scale(.92); color: var(--accent); border-color: #c8ff3166; }

/* Ход загрузки чека: процент — на кнопке, под ней тонкая полоса. */
.upload-bar { height: 3px; margin-top: 8px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.upload-bar[hidden] { display: none; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* Подтверждение оплаты: без чека заказ на проверку не уходит. */
.proof { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.proof-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.proof-note { color: var(--muted); font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
.proof-link { display: flex; gap: 8px; margin-top: 10px; }
.proof-link .search { margin-bottom: 0; flex: 1; min-width: 0; }
.proof-link .btn { width: auto; flex: 0 0 auto; }

/* ---------------------------------------------------------- инструкция */

/* Режим разработчика — первый блок карточки инструкции. */
.instr-dev {
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-2);
}
.instr-dev-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.instr-dev-steps { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.instr-dev-steps li + li { margin-top: 4px; }
.instr-dev-img {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: var(--radius-s);
  background: #fff;
}
.instr-dev-note { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 10px; }

/* Цвета взяты с присланных слайдов, поэтому заданы явно, а не переменными
   темы: карточка должна выглядеть одинаково в светлой и тёмной теме. */
.instr {
  --slide-bg: #090e0b;
  --slide-green: #c6ff55;
  --slide-text: #f6f8f5;
  --slide-muted: #b1bab0;
  --slide-line: #303b2b;
  --slide-frame: #5f7c3a;
  --slide-off: #2d3928;
}

.instr-bots { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.instr-bot {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.instr-bot-name { font-weight: 660; font-size: 15px; color: var(--accent); }
:root[data-theme="light"] .instr-bot-name { color: #486500; }
.instr-bot-hint { color: var(--muted); font-size: 13px; flex: 1; }
.instr-bot-go { color: var(--muted); font-size: 15px; }
.instr-bot:active { transform: scale(.98); }

.instr-mention { color: var(--slide-green); text-decoration: none; border-bottom: 1px solid #c6ff5555; }

/* Где взять .ipa — блок между ботами и UDID. Стоит на светлой подложке,
   поэтому упоминание канала берёт цвет темы, а не салатовый со слайда. */
.instr-sources {
  margin: 10px 0 2px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.instr-sources-title { font-weight: 660; font-size: 14px; margin-bottom: 4px; }
.instr-sources-text {
  color: var(--muted);
  font-size: 13px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.instr-sources .instr-mention { color: var(--accent); border-bottom-color: #c8ff3155; }
:root[data-theme="light"] .instr-sources .instr-mention { color: #486500; border-bottom-color: #48650055; }

.instr-swipe {
  color: var(--muted); font-size: 12px;
  margin: 16px 0 10px;
}

/* Лента шагов ведёт себя как страницы в мобильном приложении: на экране
   ровно один шаг, соседний приходит свайпом или перетаскиванием мышью.
   На ПК лента держит ширину телефона — карточка повторяет слайд, и
   растягивать её через весь экран незачем. */
.instr-steps {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 8px;
  max-width: 420px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.instr-steps::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) { .instr-steps { cursor: grab; } }
/* Пока тащим мышью, снап выключен: иначе браузер прыгает к ближайшему
   шагу прямо посреди движения. */
.instr-steps.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.instr-steps.dragging .instr-card { pointer-events: none; }

/* Карточка повторяет слайд: те же блоки, порядок и цвета. */
.instr-card {
  flex: 0 0 100%;
  max-width: 100%;
  scroll-snap-align: center;
  display: flex; flex-direction: column;
  padding: 16px 16px 12px;
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 50% 100%, #c6ff5514, transparent 70%),
    var(--slide-bg);
  border: 1px solid #1c2619;
  color: var(--slide-text);
}

.instr-card-top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--slide-line);
}
.instr-logo { position: relative; font-size: 17px; font-weight: 800; letter-spacing: -0.6px; }
/* Салатовая точка над «i» — как в логотипе на слайде. */
.instr-logo::before {
  content: "";
  position: absolute; left: 1px; top: -1px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--slide-green);
}
.instr-count { font-size: 12px; font-weight: 800; color: var(--slide-green); letter-spacing: .4px; }

.instr-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.instr-num {
  flex: 0 0 30px;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--slide-green);
  color: #0a0f08;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.instr-title { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; }
.instr-sub {
  color: var(--slide-muted);
  font-size: 13px; line-height: 1.35;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

/* Кадр переписки — вырезка из слайда в салатовой рамке со свечением. */
.instr-shot {
  /* Размер ведём от высоты: ширина считается из пропорции кадра, поэтому
     переписка видна целиком, без обрезки, и кадр стоит по центру карточки.
     В колонке карточки высота от flex получалась непредсказуемой. */
  flex: 0 0 auto;
  align-self: center;
  /* Карточки в ленте одной высоты — по самой длинной подписи. Свободное
     место забирает кадр, иначе оно копилось бы пустотой под полосой шагов. */
  margin-block: auto;
  height: min(62vh, 560px);
  aspect-ratio: 560 / 1106;
  max-width: 100%;
  display: flex;
  border-radius: 16px;
  border: 1px solid var(--slide-frame);
  box-shadow: 0 0 22px #c6ff5522;
  overflow: hidden;
  background: #000;
}
/* Кадр высокий: показываем его верх — там сама переписка, внизу клавиатура. */
.instr-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.instr-hint {
  margin-top: 10px;
  color: var(--slide-muted);
  font-size: 12px; line-height: 1.35;
  text-align: center;
}
.instr-sign {
  margin-top: 6px;
  text-align: center;
  font-size: 13px; font-weight: 800;
  color: var(--slide-green);
}

.instr-ticks { display: flex; gap: 4px; margin-top: 8px; }
.instr-tick { flex: 1; height: 3px; border-radius: 2px; background: var(--slide-off); }
.instr-tick.on { background: var(--slide-green); }

/* --------------------------------------------------------------- подвал */

/* Реквизиты и документы — на каждом экране витрины и на каждой странице. */
.footer {
  margin-top: 28px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-bottom: 10px;
}
.footer-links a, .footer-links .linkish {
  color: var(--text); font-size: 12px; padding: 2px 0;
  text-decoration: none; border-bottom: 1px solid var(--line);
}
.footer-links a:active, .footer-links .linkish:active { opacity: .6; }
.footer-line { margin-top: 2px; }
.footer-line.legal { font-size: 12px; }

/* ------------------------------------------------------- документ целиком */

.doc h1 { font-size: 24px; margin-bottom: 16px; }
.doc h2 { font-size: 17px; margin: 22px 0 8px; }
.doc p { font-size: 15px; line-height: 1.6; color: var(--text); }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { font-size: 15px; line-height: 1.6; margin-bottom: 6px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
  margin: 14px 0;
}
.notice.warn { color: var(--warn); }
.notice-top { margin-top: 0; }

/* Вкладка продавца: переключатель «Заказы | Аналитика». */
.seg {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.seg-btn {
  flex: 1; border: 0; border-radius: 999px; padding: 9px 10px;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.seg-btn.active { background: var(--accent); color: var(--accent-text); }

/* Аналитика: карточки показателей, график выручки, статусы с долями. */
.an-dates { margin: -4px 0 12px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 14px;
}
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-size: 22px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.chart .bar { flex: 1; min-width: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.chart .bar.empty { background: var(--surface-3); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }
.stat-row + .stat-row { margin-top: 12px; }
.stat-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.stat-num { color: var(--muted); white-space: nowrap; }
.stat-bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* Пометка тестового заказа (TEST_IDS) в списках и карточке. */
.test-tag {
  display: inline-block; vertical-align: middle;
  margin-left: 6px; padding: 1px 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
h2 .test-tag { font-size: 12px; }

/* «Закрыть заказ?» — вопрос на месте кнопки вместо системного окна Telegram. */
.confirm-box { margin-top: 10px; }
.danger-text { color: var(--danger); }
.confirm-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.confirm-text { color: var(--muted); font-size: 13px; line-height: 1.45; margin-bottom: 14px; }

/* Промокоды: строка списка, история изменений и форма создания и правки. */
.order-line .promo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; letter-spacing: .3px; overflow-wrap: anywhere;
}
.status-dot.promo-active { background: var(--ok); }
.status-dot.promo-scheduled { background: #0a84ff; }
.status-dot.promo-exhausted { background: var(--warn); }
.status-dot.promo-expired, .status-dot.promo-disabled { background: var(--muted); }
.hist-row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hist-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.hist-detail { margin-top: 3px; overflow-wrap: anywhere; }
.hist-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pform .field { margin-top: 16px; }
.pform > .field:first-child { margin-top: 0; }
/* В форме поля обычного размера: крупный кегль .field input — для UDID. 16px — чтобы iPhone не увеличивал страницу. */
.pform .field input {
  font-size: 16px; letter-spacing: 0; padding: 13px 14px;
  display: block; min-width: 0; min-height: 50px;
}
.pform .seg { margin-bottom: 10px; }
.pform textarea { min-height: 84px; font-size: 16px; }
.pform .switch-row { border-bottom: 0; padding-bottom: 0; margin-top: 8px; }
.pform .field input.pf-code, .pf-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .4px; text-transform: uppercase;
}
.pf-fixed {
  background: var(--surface-3); border-radius: var(--radius-m);
  padding: 13px 14px; font-size: 15px; overflow-wrap: anywhere;
}
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row input { flex: 1; }
.input-row .btn { width: auto; flex: 0 0 auto; }
.input-row .pf-dice { width: 50px; padding: 0; font-size: 20px; }
.input-suffix { position: relative; }
.pform .input-suffix input { padding-right: 40px; }
.input-suffix span {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; pointer-events: none;
}
.pf-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pf-pair .field input { width: 100%; }
.pform .pf-pair .field input[type="date"] { font-size: 15px; padding: 12px 10px; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 6px; }
.pf-error { margin: 12px 0 0; }

/* Промокод покупателя: поле с кнопкой на оформлении и оплате, строка применённого кода. */
.promo-box { margin: 14px 0 4px; }
.promo-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.promo-box .search.promo-input {
  margin: 0; font-size: 16px; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .3px; text-transform: uppercase;
}
.promo-box .search.promo-input::placeholder {
  font-family: inherit; text-transform: none; letter-spacing: 0;
}
.promo-applied {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 14px 0 4px; padding: 12px 14px;
  border: 1px dashed var(--promo-text); border-radius: var(--radius-m);
  font-size: 14px; color: var(--promo-text);
}
.promo-applied span { min-width: 0; overflow-wrap: anywhere; }
.promo-applied .linkish { flex: 0 0 auto; padding: 0; }
.linkish.promo-open { display: block; margin: 0 0 6px; color: var(--promo-text); }

pre.instruction {
  white-space: pre-wrap;
  /* Инструкция может прийти одним длинным словом — без переноса она
     растягивала карточку и всю страницу вбок. */
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 15px;
  margin: 0;
}

/* ------------------------------------------------------------- продавец */

/* Продавец: сортировка и фильтры подгруппы. */
.seller-tools { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; }
.tool-btn {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-s); padding: 9px 12px;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.tool-btn.on, .tool-btn.active { border-color: var(--accent); }
.tool-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-caret { color: var(--muted); }
.tool-reset {
  background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 13px; padding: 9px 2px; cursor: pointer; text-decoration: underline;
}
.seller-note { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.seller-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 12px; margin-bottom: 14px;
}
.panel-label { color: var(--muted); font-size: 12px; margin: 12px 0 6px; }
.panel-label:first-child { margin-top: 0; }
.panel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-chips .chip { cursor: pointer; font: inherit; font-size: 13px; }
.panel-dates { display: flex; gap: 8px; margin-top: 8px; }
.panel-dates label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.panel-dates input {
  flex: 1; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-s); padding: 8px; font: inherit; font-size: 13px;
}

.order-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.order-line .code { font-weight: 650; font-size: 15px; }
.order-line .meta { color: var(--muted); font-size: 13px; }
.order-line .grow { flex: 1; min-width: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 8px; }
.status-dot.new, .status-dot.payment_check { background: var(--warn); }
.status-dot.paid, .status-dot.imei, .status-dot.installed { background: #0a84ff; }
.status-dot.done { background: var(--ok); }
.status-dot.cancelled { background: var(--danger); }

textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 14px;
  min-height: 120px;
  outline: none;
  resize: vertical;
}

.search {
  /* input по умолчанию строчный: без display: block его не выровнять автополями. */
  display: block;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 14px;
  outline: none;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------- табы */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tabbar button {
  background: none; border: 0; cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 10px;
  flex: 1;
}
.tabbar button.on { color: var(--text); }
.tabbar .dot-badge {
  position: absolute; margin: -2px 0 0 14px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--warn);
}

.backlink {
  background: none; border: 0; color: var(--muted);
  font-family: inherit; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0 14px; cursor: pointer;
}

/* --------------------------------------------------------------- тост */

.toast {
  position: fixed;
  left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius-m);
  font-size: 14px;
  max-width: 88%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------------------- переписка */

.chat-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }

.chat-empty {
  color: var(--muted); font-size: 14px; text-align: center;
  padding: 32px 16px;
}

.msg {
  max-width: 82%;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
}
.msg.mine {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  border-radius: 16px 16px 4px 16px;
}
.msg-text { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-time { font-size: 11px; opacity: .55; margin-top: 4px; text-align: right; }

.composer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  max-width: 560px;
  margin: 0 auto;
  z-index: 40;
}
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 14px;
  border-radius: 22px;
  resize: none;
}
.send-btn {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  font-size: 20px; font-weight: 700;
  cursor: pointer;
}
.send-btn:active { opacity: .75; }

body.chat-mode .tabbar { display: none; }
body.chat-mode .view { padding-bottom: 110px; }

.count-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}

/* ------------------------------------------------------ переключатели */

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.switch-row:last-child { border-bottom: 0; }
.switch-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.switch-title { font-size: 15px; font-weight: 600; }
.switch-hint { font-size: 13px; color: var(--muted); }

.switch {
  appearance: none; -webkit-appearance: none;
  width: 50px; height: 30px;
  flex: 0 0 50px;
  border-radius: 15px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
  margin: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}
.switch:checked { background: var(--ok); border-color: transparent; }
.switch:checked::after { transform: translateX(20px); background: #fff; }

/* Картинка «Как узнать UDID»: на четверть меньше ширины блока — во всю ширину
   она занимала почти весь экран. */
.guide {
  display: block;
  width: 75%;
  border-radius: var(--radius-m);
  margin: 12px auto 0;
  border: 1px solid var(--line);
}

/* iApki — фирменная палитра и мобильная витрина */
:root { --brand: #c8ff31; --radius-l: 26px; --radius-m: 18px; }
:root[data-theme="light"] { --line: #dce2d2; --surface-2: #edf1e6; --surface-3: #e5ebdb; --muted: #606955; }
body { background-image: radial-gradient(ellipse at 85% 0%, #c8ff310c, transparent 460px); }
.topbar { padding: calc(14px + var(--tg-top, 0px)) 12px 12px 0; margin-bottom: 12px; gap: 10px; }
a.brand { text-decoration: none; color: inherit; }
.brand-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 14px; overflow: hidden; background: var(--brand); }
.brand-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-title { font-size: 23px; font-weight: 800; letter-spacing: -1px; }
.brand-sub { font-size: 12px; margin-top: 1px; }
.hero { position: relative; overflow: hidden; padding: 24px; background: radial-gradient(ellipse at 100% 0%, #c8ff3126, transparent 70%), var(--surface); border-color: #c8ff3140; }
.hero h1 { font-size: clamp(30px, 8.5vw, 40px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.06; margin-bottom: 14px; }
.hero h1 em { color: var(--brand); font-style: normal; }
:root[data-theme="light"] .hero h1 em { color: #486500; }
.hero p { max-width: 340px; line-height: 1.55; font-size: 14px; }
.hero .badge { background: var(--brand); color: #101407; border: 0; font-weight: 800; padding: 5px 10px; }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; font-weight: 600; }
.cluster { padding: 0; margin: 22px 0; gap: 8px; flex-wrap: wrap; }
.cluster .app-icon { width: 43px; height: 43px; margin: 0; box-shadow: 0 4px 10px #0003; border-radius: 13px; }
.btn { transition: transform .15s, opacity .15s, background .15s; }
.btn-primary { font-weight: 750; box-shadow: 0 5px 22px #c8ff3114; }
.btn:active { transform: scale(.98); }
.flowline { font-size: 11px; gap: 5px; padding: 5px 0 21px; flex-wrap: wrap; }
.flowline .sep { color: var(--brand); }
.section-head { margin-top: 8px; margin-bottom: 14px; gap: 8px; }
.section-head h2 { font-size: 19px; }
.section-head button { color: var(--text); font-size: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface-3); }
.grid { gap: 12px; }
.app-card { min-height: 146px; padding: 16px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); border-radius: 22px; }
.app-card .app-icon { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 12px; box-shadow: 0 4px 10px #0002; }
.app-card .name { font-size: 14px; line-height: 1.3; }
.app-card .cat { font-size: 11px; margin-top: 3px; }
.app-card .arrow { display: none; }
.filters .chip { font-family: inherit; min-height: 42px; border-radius: 14px; }
.tabbar { max-width: 560px; margin: 0 auto; padding-top: 10px; }
.tabbar button { gap: 5px; min-height: 49px; }
.tabbar button.on { color: var(--brand); }
:root[data-theme="light"] .tabbar button.on { color: #486500; }
.nav-icon { width: 22px; height: 22px; }
.tabbar button.on .nav-icon { filter: drop-shadow(0 0 8px #c8ff3133); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.search:focus, textarea:focus, .field input:focus { border-color: var(--accent); }
.switch:checked { background: var(--brand); }
.switch:checked::after { background: #101407; }
.card { box-shadow: 0 5px 22px #0000000a; }
@media (max-width: 350px) { .hero { padding: 18px; } .cluster { gap: 6px; } .cluster .app-icon { width: 36px; height: 36px; } .app-card { padding: 12px; } .brand-sub { font-size: 11px; } }

/* --------------------------------------------------------------- движение */

/* Появление экрана: класс навешивает render() только при смене экрана. */
@keyframes view-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.view.view-in { animation: view-in .34s cubic-bezier(.2, .7, .3, 1); }

/* Карточки каталога выкладываются волной: номер карточки — в --i. */
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
}
.grid .app-card {
  animation: card-in .42s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

/* Нажатие: салатовая волна от точки касания — координаты ставит app.js. */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #c8ff3180, #c8ff3100 55%);
  opacity: 0;
}
@keyframes ripple {
  from { opacity: .95; transform: scale(.25); }
  to { opacity: 0; transform: scale(2.6); }
}
.btn.rippling::after { animation: ripple .55s ease-out; }
.btn-primary:active { box-shadow: 0 0 0 5px #c8ff312e, 0 6px 26px #c8ff3140; }

/* Блик по главной кнопке идёт сам: на телефоне наведения курсора нет. */
.btn-primary::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 36%, #ffffff4d 47%, transparent 58%);
  transform: translateX(-110%);
  animation: sheen-move 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen-move {
  0%, 62% { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}

/* Иконки в шапке витрины качаются, каждая со своей задержкой. */
@keyframes float-soft {
  0%, 100% { transform: rotate(var(--tilt, 0deg)) translateY(var(--shift, 0px)); }
  50% { transform: rotate(var(--tilt, 0deg)) translateY(calc(var(--shift, 0px) - 9px)); }
}

/* Салатовое свечение медленно ходит по баннеру — под содержимым,
   иначе оно приглушает кнопку и текст. */
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -30%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, #c8ff3124, transparent 70%);
  pointer-events: none;
  animation: hero-glow 11s ease-in-out infinite alternate;
}
.hero > * { position: relative; z-index: 1; }
@keyframes hero-glow {
  to { transform: translate3d(-60px, 40px, 0) scale(1.15); }
}

/* Контент уходит под шапку не резко, а растворяясь. */
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 100%;
  /* Чуть ниже отступа под шапкой: растворяет уезжающий контент,
     но в покое не приглушает верх карточки. */
  height: 16px;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
}

.chip, .doc-row, .app-card, .order-line, .icon-btn, .tabbar button {
  transition: background .2s ease, border-color .2s ease, color .2s ease,
              transform .16s ease, box-shadow .25s ease;
}
.chip:active, .doc-row:not(.pending):active, .order-line:active { transform: scale(.97); }
.app-card:active { transform: scale(.985); }
.icon-btn:active, .tabbar button:active { transform: scale(.92); }

/* Активный фильтр — градиентом, а не заливкой. */
.filters .chip.active {
  background: linear-gradient(135deg, var(--accent), #c8ff31b0);
  box-shadow: 0 4px 16px #c8ff3126;
}

/* Курсор мыши: на телефоне эти правила не включаются. */
@media (hover: hover) and (pointer: fine) {
  .app-card:hover {
    transform: translateY(-3px);
    border-color: #c8ff3166;
    box-shadow: 0 12px 30px #c8ff310f;
  }
  .chip:hover:not(.active) { border-color: #c8ff3166; color: var(--text); }
  .req-copy:hover { color: var(--accent); border-color: #c8ff3166; background: var(--surface-3); }
  .doc-row:not(.pending):hover .doc-title, .order-line:hover .code { color: var(--accent); }
  .icon-btn:hover { background: var(--surface-2); box-shadow: 0 0 0 1px #c8ff3140; }
  .btn-secondary:hover, .btn-danger:hover { border-color: #c8ff3166; }
  .btn-primary:hover { box-shadow: 0 10px 32px #c8ff3140; }
  .footer-links a:hover, .footer-links .linkish:hover { color: var(--accent); border-bottom-color: #c8ff3166; }
}

/* Ряды фильтров тянутся мышью — курсор показывает, что их можно двигать. */
@media (hover: hover) and (pointer: fine) {
  .filters, .stepper { cursor: grab; }
}
.filters.dragging, .stepper.dragging { cursor: grabbing; user-select: none; }
.filters.dragging .chip { pointer-events: none; }

/* Волна при входе на экран: строки списков, таймлайн, реквизиты, карточки
   показателей поднимаются по очереди. Класс view-in живёт ~1 с после смены
   экрана, поэтому перерисовка того же экрана волну не повторяет. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.view-in :is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot, .instr-dev) {
  animation: rise .45s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--n, 0) * 55ms);
}
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(2) { --n: 1; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(3) { --n: 2; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(4) { --n: 3; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(5) { --n: 4; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(6) { --n: 5; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(7) { --n: 6; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(8) { --n: 7; }
:is(.tl, .order-line, .doc-row, .req-row, .metric, .stat-row, .instr-bot):nth-child(n + 9) { --n: 8; }

/* Плашка статуса заказа выскакивает пружинкой. */
@keyframes pill-pop { from { opacity: 0; transform: scale(.8); } }
.view-in .pill { animation: pill-pop .5s cubic-bezier(.2, 1.5, .4, 1) both; }

/* Таймлайн заказа: пройденные шаги соединены линией, которая «прорастает»
   вниз, галочки выскакивают, текущий шаг пульсирует кольцом. */
.tl { position: relative; }
.tl:not(:last-child)::before {
  content: "";
  position: absolute; left: 12px; top: 40px; bottom: -10px;
  width: 2px; border-radius: 2px;
  background: var(--line);
}
.tl.done:not(:last-child)::before { background: var(--ok); }
@keyframes line-fill { from { transform: scaleY(0); } }
.view-in .tl.done:not(:last-child)::before {
  transform-origin: top;
  animation: line-fill .5s ease-out both;
  animation-delay: calc(var(--n, 0) * 90ms + 180ms);
}
@keyframes dot-pop { from { opacity: 0; transform: scale(.4); } }
.view-in .tl.done .dot { animation: dot-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--n, 0) * 90ms); }
.tl.active .dot { position: relative; }
.tl.active .dot::after {
  content: "";
  position: absolute; inset: -1px; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ring 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }

/* Текущий этап в ленте шагов мягко светится. */
@keyframes chip-glow { 50% { box-shadow: 0 0 0 5px #c8ff3126, 0 6px 22px #c8ff3133; } }
.stepper .chip.active { animation: chip-glow 2.6s ease-in-out infinite; }

/* Акция: ярлык «дышит», огонёк горит, старая цена зачёркивается на глазах. */
@keyframes promo-glow { 50% { box-shadow: 0 0 0 6px #c8ff3122, 0 8px 26px #c8ff3140; } }
.promo-pill { animation: promo-glow 2.8s ease-in-out infinite; }
.promo-flame { display: inline-block; transform-origin: 50% 85%; animation: flame 1.6s ease-in-out infinite; }
@keyframes flame {
  0%, 100% { transform: rotate(-7deg) scale(1); }
  50% { transform: rotate(7deg) scale(1.14); }
}
.old-price {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 56% / 100% 1.5px;
}
@keyframes strike { from { background-size: 0 1.5px; } }
.view-in .old-price { animation: strike .5s .35s ease-out both; }

/* Аналитика: столбики вырастают слева направо, полоски статусов — тоже. */
@keyframes bar-grow { from { transform: scaleY(0); } }
.chart .bar {
  transform-origin: bottom;
  animation: bar-grow .65s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 14ms);
}
@keyframes bar-grow-x { from { transform: scaleX(0); } }
.stat-bar span { transform-origin: left; animation: bar-grow-x .8s cubic-bezier(.2, .8, .2, 1) .15s both; }

/* Нижние вкладки: выбранная иконка подпрыгивает. */
@keyframes tab-pop {
  0% { transform: scale(.82); }
  60% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.tabbar button.pop .nav-icon { animation: tab-pop .45s cubic-bezier(.2, 1.6, .4, 1); }

/* Тост выезжает с лёгкой пружинкой. */
.toast { transition: opacity .2s ease, transform .38s cubic-bezier(.2, 1.4, .4, 1); transform: translate(-50%, 20px) scale(.96); }
.toast.show { transform: translate(-50%, 0) scale(1); }

/* Раскрытие «Что входит в услугу» и других подсказок — плавно. */
details.disclosure[open] > :not(summary) { animation: rise .3s ease-out both; }

/* Копирование: кнопка вспыхивает зелёным, UDID — салатовым. */
@keyframes copy-pop { 40% { transform: scale(1.22); } }
.req-copy.copied { color: var(--ok); border-color: var(--ok); animation: copy-pop .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes copy-flash { 0%, 30% { color: var(--accent); } }
.copyable.copied { animation: copy-flash .9s ease; }

/* Переписка: новое сообщение въезжает со своей стороны. */
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.msg.msg-new { animation: msg-in .3s cubic-bezier(.2, .8, .3, 1) both; transform-origin: bottom left; }
.msg.mine.msg-new { transform-origin: bottom right; }

/* Лента инструкции: текущий шаг крупно, соседние чуть меньше и тише. */
.instr-steps.paged .instr-card { transition: transform .35s ease, opacity .35s ease; }
.instr-steps.paged .instr-card:not(.is-current) { transform: scale(.94); opacity: .5; }

/* Конфетти на важных шагах заказа — веер вверх, потом вниз. */
.confetti { position: fixed; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; z-index: 80; }
.confetti span {
  position: absolute; width: 8px; height: 12px; border-radius: 2px;
  opacity: 0;
  animation: confetti 1.5s cubic-bezier(.15, .7, .3, 1) var(--delay, 0ms) forwards;
}
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(.6); }
  45% { opacity: 1; transform: translate(calc(var(--dx) * .7), var(--dy)) rotate(calc(var(--rot) * .5)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 320px)) rotate(var(--rot)) scale(1); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Экран загрузки со знаком iApki */
.loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 18vh; }
.loader img { border-radius: 18px; animation: loader-pulse 1.4s ease-in-out infinite; }
@keyframes loader-pulse { 50% { opacity: .55; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .loader img { animation: none; } }

/* Иконки в шапке витрины — мозаикой: разный размер и лёгкий наклон.
   Ряд не переносится: на экранах уже ~390px шестая плитка уезжала вниз. */
.cluster { flex-wrap: nowrap; gap: 8px; align-items: center; }
.cluster .app-icon {
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 54px;
  border-radius: 26%;
  box-shadow: 0 6px 16px #00000040;
  transform: rotate(var(--tilt, 0deg)) translateY(var(--shift, 0px));
  animation: float-soft 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.cluster .app-icon:nth-child(1) { --tilt: -8deg; --shift: 4px; --delay: 0s; max-width: 58px; }
.cluster .app-icon:nth-child(2) { --tilt: 6deg; --shift: -6px; --delay: .8s; max-width: 46px; }
.cluster .app-icon:nth-child(3) { --tilt: -4deg; --shift: 6px; --delay: 1.6s; max-width: 54px; }
.cluster .app-icon:nth-child(4) { --tilt: 9deg; --shift: -3px; --delay: .4s; max-width: 44px; }
.cluster .app-icon:nth-child(5) { --tilt: -6deg; --shift: 7px; --delay: 2.2s; max-width: 56px; }
.cluster .app-icon:nth-child(6) { --tilt: 5deg; --shift: -5px; --delay: 1.2s; max-width: 48px; }

/* Кнопки подряд — с воздухом между ними (раньше слипались, например в «Помощи»). */
.btn + .btn { margin-top: 10px; }
.btn-row > .btn + .btn { margin-top: 0; }

/* Верх карточки — кнопка «оформить»: сбрасываем системный вид. */
.app-open {
  font: inherit; color: inherit; text-align: left; width: 100%;
  background: none; border: 0; padding: 0;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
/* Нажатие отыгрывает сама карточка (.app-card:active), иначе масштаб
   наложился бы дважды. */
.app-card .name, .app-card .cat { display: block; }

/* Логотип в шапке — кнопка «на главную». */
button.brand {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
button.brand .brand-text, button.brand .brand-title, button.brand .brand-sub { display: block; }
button.brand:active { opacity: .75; }

/* ------------------------------------------------------- версия для ПК */

/* Блок идёт последним: он должен перебивать правила выше. */
@media (min-width: 900px) {
  .shell { max-width: 1120px; padding: 0 32px; }
  /* Шапка — только логотип: со строкой разделов она выходила слишком толстой.
     Правое поле отодвигает кнопки помощи и переписки от края. */
  .topbar { order: 1; padding: calc(16px + var(--tg-top, 0px)) 40px 10px 0; margin-bottom: 8px; }
  .brand-title { font-size: 26px; }
  .brand-sub { font-size: 13px; }

  /* Нижняя панель на большом экране неуместна: разделы идут строкой слева
     под шапкой и уезжают вместе со страницей.
     У флекс-элементов z-index работает и без позиционирования — без сброса
     кнопки всплывали поверх шапки. */
  .tabbar {
    order: 2;
    position: static;
    z-index: auto;
    max-width: none;
    margin: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 0 20px;
    border-top: 0;
    background: none;
    backdrop-filter: none;
  }
  .tabbar button {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 9px;
    min-height: 0;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  .tabbar button.on {
    background: linear-gradient(135deg, #c8ff3126, #c8ff3108);
    border-color: #c8ff3166;
  }
  .tabbar .dot-badge { position: static; margin: 0; }
  .view { order: 3; padding-bottom: 56px; }
  /* На страницах документов подвал — прямой потомок .shell: без явного
     порядка он оказался бы выше шапки. */
  .shell > .footer { order: 4; }

  /* Баннер по центру: на широком экране прижатый влево текст выглядит
     смещённым, а не выровненным. */
  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 52px 44px 46px;
  }
  .hero > .hero-head { width: auto; gap: 14px; margin-bottom: 22px; }
  .hero > h1 { font-size: 52px; }
  .hero > p { max-width: 560px; font-size: 16px; }
  .hero > .btn-primary { max-width: 420px; }
  .hero > .cta-note { text-align: center; }
  .hero::before { width: 520px; height: 520px; }

  /* Мозаика крупнее и вразнобой. */
  .hero > .cluster { width: auto; margin: 28px 0 32px; gap: 18px; justify-content: center; }
  .hero > .cluster .app-icon { flex: 0 0 auto; max-width: none; }
  .hero > .cluster .app-icon:nth-child(1) { width: 92px; }
  .hero > .cluster .app-icon:nth-child(2) { width: 68px; }
  .hero > .cluster .app-icon:nth-child(3) { width: 84px; }
  .hero > .cluster .app-icon:nth-child(4) { width: 62px; }
  .hero > .cluster .app-icon:nth-child(5) { width: 96px; }
  .hero > .cluster .app-icon:nth-child(6) { width: 74px; }

  .flowline { justify-content: center; font-size: 13px; gap: 8px; }
  .section-head h2 { font-size: 24px; }

  /* Каталог заполняет ширину: по четыре карточки в ряд. */
  .grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
  .app-card { min-height: 196px; }
  .app-card .name { font-size: 16px; }
  .app-card .desc { font-size: 12px; -webkit-line-clamp: 2; }
  .app-card .price { font-size: 14px; }
  .app-card .arrow { display: block; }

  /* Текст — колонкой по центру: во всю ширину монитора строки не читаются,
     а прижатые влево выглядят забытыми. Класс narrow ставит render()
     всем экранам, кроме витрины, где каталог занимает всю ширину. */
  .view.narrow > *, .doc, .card, .notice, .field, .chat-list, .composer,
  .view > .cta-note, .view > .mt, .view > .btn {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
  }
  /* Строчные элементы (плашка статуса, кнопка-ссылка) автополями не
     выравниваются — сдвигаем их к левой границе той же колонки. */
  .view.narrow > .pill, .view.narrow > .linkish {
    display: flex;
    width: fit-content;
    margin-left: max(0px, calc((100% - 880px) / 2));
    margin-right: auto;
  }

  /* «Назад» — шаг из экрана, ему место у левого края, а не в колонке. */
  .view.narrow > .backlink, .doc > .backlink { margin-left: 0; }

  /* Фильтры помещаются целиком — прокручивать нечего. */
  .filters { flex-wrap: wrap; overflow: visible; padding-bottom: 18px; }
  .footer { max-width: none; }
  .footer-links { gap: 8px 20px; }
}
