/* LVL STORE — оформление «строгий премиум» (26.10.2026). Без inline-стилей (CSP style-src 'self').
   Токены и правила — design-system/lvl-store/MASTER.md. Принципы: один шрифт (Golos Text) и веса 400/500/600,
   линии вместо теней, радиусы 6/8/10, одна акцентная кнопка цвета слоновой кости, монохромные иконки,
   реакция на нажатие вместо подъёма при наведении. */
@font-face {
  font-family: "Golos Text";
  src: url("/static/fonts/golos-text.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --surface-1: #15161b;
  --surface-2: #1b1d23;
  --surface-3: #23252d;
  --line: #292b33;
  --line-strong: #383b46;
  --line-input: #6e7384;
  --text: #ecebe8;
  --text-2: #c3c2bf;
  --muted: #8f919b;
  --btn: #ecebe8; --btn-hover: #ffffff; --btn-text: #0e0f12;
  --link: #c3cce0;
  --focus: #ecebe8;
  --ok: #3fbf7f;   --ok-text: #b6e8cc;   --ok-line: rgba(63, 191, 127, .4);
  --warn: #d9a94a; --warn-text: #f1dcae; --warn-line: rgba(217, 169, 74, .4);
  --bad: #e06470;  --bad-text: #f6c2c7;  --bad-line: rgba(224, 100, 112, .4);
  --stock: #3fbf7f;
  --nostock: #666a78;
  --band-none: #5a5e6a;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.625rem; --fs-3xl: 2rem;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --edge: inset 0 1px 0 rgba(255, 255, 255, .04);
  --ring: 0 0 0 3px rgba(236, 235, 232, .18);
  --t-fast: 120ms; --t-base: 180ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --header-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
/* Ссылки в тексте отличаются не только цветом */
p a:not([class]), li a:not([class]), .notice a, .prose a, .keytext a { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; text-decoration-color: var(--line-input); }
h1 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -.01em; font-weight: 600; margin: 0 0 var(--s-3); overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -.005em; font-weight: 600; margin: 0 0 var(--s-3); overflow-wrap: anywhere; text-wrap: balance; }
p { margin: var(--s-2) 0; }
b, strong { font-weight: 600; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 max(var(--s-4), env(safe-area-inset-right)) 0 max(var(--s-4), env(safe-area-inset-left)); }
.main { flex: 1; padding-top: var(--s-5); padding-bottom: var(--s-6); }
.main:focus { outline: none; }
.muted { color: var(--muted); }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.hidden { display: none !important; }
.small { font-size: var(--fs-sm); }
.num, [data-countdown] { font-variant-numeric: tabular-nums; }
.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; }
.skip { position: absolute; left: var(--s-4); top: calc(-1 * var(--s-7)); z-index: 20; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--btn); color: var(--btn-text); font-weight: 500; transition: top var(--t-fast); }
.skip:focus { top: var(--s-2); outline-offset: 0; }
/* Надзаголовок: мелкая капитель над блоком («Кабинет», «Баланс · 2 250 ₽», «Заявка № …») */
.eyebrow { font-size: var(--fs-xs); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 var(--s-3); font-variant-numeric: tabular-nums; }
.eyebrow b { color: var(--text-2); font-weight: 500; }
h1.eyebrow { line-height: 1.5; }

/* Иконки: один набор линий, интерфейс 1.75, категории 1.5 */
.ic { width: 20px; height: 20px; flex: none; stroke-width: 1.75; }
/* Оптическая посадка иконок у текста (27.10.2026). В Golos Text центр строки — там, куда align-items:center ставит иконку, —
   на .38em над базовой линией, а глаз читает середину строчных и заглавных ~.31em (у цифр и капса — .35em).
   Поэтому иконки у подписей опускаем на .07em, у цифр и в шапке — на .03em. Через top, не transform: шеврон истории
   поворачивается transform'ом. em считается от шрифта кнопки или строки. */
.btn > svg, .back > .ic, .stockbar .ic, .history details summary .ic, .notice > .ic, .rules .ic, .waiting .pulse {
  position: relative; top: .07em; }
/* Цифры и шапка: баланс, шеврон у цены, кружок с буквой в кабинете. Колокольчик и «Выйти» — вместе с кошельком,
   чтобы три иконки шапки стояли на одной линии. Знак у названия не сдвигаем: он и так на центре капса. */
.balance .ic, .iconbtn .ic, .prow-chev, .profile .avatar { position: relative; top: .03em; }
.ic.sm { width: 16px; height: 16px; }

/* Шапка: без блюра и тени, одна линия снизу; при загрузке окна каталога по ней идёт полоса */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top); }
.top::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; opacity: 0; background: var(--text); }
.top.loading::after { animation: loadbar 1.1s var(--ease) forwards; }
.top.loaded::after { animation: loaddone .4s ease-out forwards; }
@keyframes loadbar { 0% { width: 0; opacity: 1; } 55% { width: 65%; } 100% { width: 86%; opacity: 1; } }
@keyframes loaddone { 0% { width: 86%; opacity: 1; } 60% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 600; letter-spacing: .14em; font-size: .9375rem;
  min-height: 44px; }
.brand img { width: 26px; height: 26px; }
.brand > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.nav { display: flex; align-items: center; gap: var(--s-1); }
.balance { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text);
  font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background var(--t-fast); }
.balance .ic { color: var(--muted); width: 18px; height: 18px; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px;
  padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast); }
.iconbtn:active { background: var(--surface-2); color: var(--text); }
.iconbtn-label { font-size: var(--fs-sm); font-weight: 500; }
.bell.has { color: var(--text); }
.bell .count { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px;
  background: var(--bad); color: var(--bg); font-size: var(--fs-xs); font-weight: 600; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums; }
.bell .count:empty { display: none; }

/* Кнопки: одна главная — слоновая кость; остальное — контур */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--btn); border-radius: var(--r-sm); background: var(--btn); color: var(--btn-text); font-weight: 500;
  line-height: 1.2; white-space: nowrap; cursor: pointer; position: relative;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.btn:active { transform: scale(.985); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn.ghost:active { background: var(--surface-2); }
.btn.wide { width: 100%; min-height: 48px; }
.btn:disabled { background: var(--surface-3); border-color: var(--surface-3); color: var(--muted); cursor: not-allowed; transform: none; }
.btn.ghost:disabled { background: transparent; border-color: var(--line); }
.btn .ic { width: 18px; height: 18px; }
/* Отправка формы: подпись меняется на глагол («Списываем…»), ширина кнопки держится JS, спиннера нет */
.btn.is-pending:disabled { background: var(--btn); border-color: var(--btn); color: var(--btn-text); opacity: .7; cursor: progress; }
.btn.ghost.is-pending:disabled { background: transparent; border-color: var(--line-strong); color: var(--text); }

/* Блоки: линия и световая кромка сверху вместо тени */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5);
  box-shadow: var(--edge); margin-bottom: var(--s-4); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.notice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-left: 2px solid var(--line-input);
  border-radius: var(--r-sm); padding: 12px 14px; margin: var(--s-3) 0; background: transparent; color: var(--text-2); }
.notice .ic { margin-top: 2px; color: var(--muted); }
.notice > div { min-width: 0; }
.notice a { font-weight: 500; }
.notice.warn { border-left-color: var(--warn); color: var(--warn-text); }
.notice.warn .ic { color: var(--warn); }
.notice.ok { border-left-color: var(--ok); color: var(--ok-text); }
.notice.ok .ic { color: var(--ok); }
.notice.bad { border-left-color: var(--bad); color: var(--bad-text); }
.notice.bad .ic { color: var(--bad); }
.status { margin-bottom: var(--s-4); }
.status .notice { margin: 0 0 var(--s-2); }
.empty { display: grid; justify-items: center; gap: var(--s-2); color: var(--muted); text-align: center; padding: var(--s-6) 0; }
.empty .ic { width: 36px; height: 36px; color: var(--line-strong); }
.tag { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 500; letter-spacing: .04em; padding: 1px 6px;
  border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); white-space: nowrap; vertical-align: middle; }
.tag.ok { border-color: var(--ok-line); color: var(--ok-text); }

/* Полоса наличия сразу под шапкой, во всю ширину экрана: сплошная зелёная с галочкой — товар есть (и сколько категорий),
   серая — пусто. Текст тёмный на зелёном (≥ 4.5:1), светлый на сером. */
.stockbar { background: var(--stock); color: var(--bg); font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.stockbar.none { background: var(--band-none); color: var(--text); }
.stockbar-inner { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.stockbar .ic { width: 18px; height: 18px; }
/* Ссылки магазина под полоской: кнопки по центру, до трёх в ряд */
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); max-width: 640px; margin: 0 auto var(--s-5); }
.linkbtn { flex: 1 1 calc(33.333% - var(--s-3)); min-width: 110px; max-width: 220px; }
.linkbtn svg { width: 18px; height: 18px; flex: none; color: var(--muted); }

/* Каталог: плитки категорий и ведомость позиций. Наличие — полоска слева у плитки: зелёная / серая.
   В списке категории только позиции в наличии (раскупленные скрыты), поэтому полоски у строк нет. */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s-3); }
.tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; height: 100%; min-height: 136px;
  padding: 22px 22px 22px 25px; color: var(--text); background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--edge);
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease), transform var(--t-fast) var(--ease); }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stock); }
.tile.no-stock::before { background: var(--nostock); }
.tile:focus-visible { border-color: var(--line-strong); }
.tile:active { transform: scale(.985); background: var(--surface-2); }
.tile-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-name { font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-price { color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Иконка категории: монохром на одной графитовой плашке; своя картинка — как есть */
.caticon { width: 88px; height: 88px; border-radius: var(--r-md); display: grid; place-items: center; flex: none;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.caticon svg { width: 46px; height: 46px; stroke-width: 1.5; }
.caticon .emoji { font-size: 2.75rem; line-height: 1; filter: grayscale(1) brightness(1.15); }
.caticon img { width: 100%; height: 100%; object-fit: cover; }

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); margin-bottom: var(--s-2); font-weight: 500; font-size: var(--fs-sm); }
.back:active { color: var(--text); }
.cat-head { display: flex; align-items: center; gap: var(--s-4); margin: var(--s-1) 0 var(--s-4); }
.cat-head h1 { margin: 0; overflow-wrap: anywhere; }
.cat-head h1:focus, .cat-panel > h1:focus { outline: none; }
.plist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--edge); }
.plist li + li { border-top: 1px solid var(--line); }
.prow { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: 14px 14px 14px 18px; color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast); }
.plist li:first-child .prow { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.plist li:last-child .prow { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.plist li:only-child .prow { border-radius: var(--r-lg); }
.prow:active { background: var(--surface-2); }
.prow-name { flex: 1; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.prow-price { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 6.5ch; text-align: right; }
.prow-price s { color: var(--muted); font-weight: 400; margin-right: 6px; }
.prow-chev { color: var(--muted); width: 18px; height: 18px; }
.catalog { scroll-margin-top: 8px; }
.catalog[aria-busy="true"] { cursor: progress; }

/* FAQ («Информация») */
.prose { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-2); margin-top: 6px; font-size: 1rem; }
.prose pre, code { white-space: pre-wrap; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: .92em; }
.tg-spoiler, tg-spoiler { background: var(--surface-3); color: inherit; border-radius: 4px; padding: 0 3px; }

/* Формы */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: 6px; }
.field > label, .methods legend { font-weight: 500; }
.hint { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); margin: 0; }
input[type=text], input[type=number], select {
  width: 100%; min-height: 48px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-input);
  border-radius: var(--r-sm); padding: 11px 14px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input::placeholder { color: var(--muted); opacity: 1; }
input[type=text]:focus, input[type=number]:focus, select:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--text); box-shadow: var(--ring); }
/* Многострочные поля (раздел разработчика) — тот же вид, что у однострочных */
textarea { width: 100%; min-height: 120px; display: block; background: var(--surface-2); color: var(--text); font: inherit; line-height: 1.45;
  border: 1px solid var(--line-input); border-radius: var(--r-sm); padding: 11px 14px; resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
textarea::placeholder { color: var(--muted); opacity: 1; }
textarea:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--text); box-shadow: var(--ring); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.code-input { letter-spacing: .3em; text-transform: uppercase; font-family: var(--mono); font-size: 1.5rem; text-align: center; min-height: 56px; }
.amount-wrap { position: relative; }
.amount-wrap input { padding-right: 44px; font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.amount-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip { min-height: 36px; padding: 6px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent;
  color: var(--text-2); font-weight: 500; font-size: var(--fs-sm); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast); }
.chip:active { background: var(--surface-2); }
.chip.active, .chip[aria-pressed="true"] { border-color: var(--text); background: var(--surface-2); color: var(--text); }
/* Способы оплаты — ведомость: строки через линию, выбранная — на вложенном фоне */
.methods { border: 0; padding: 0; margin: 0; display: grid; gap: 0; }
.methods legend { padding: 0; margin-bottom: 6px; }
.method { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px; border-top: 1px solid var(--line);
  cursor: pointer; font-weight: 400; transition: background var(--t-fast); }
.method:last-child { border-bottom: 1px solid var(--line); }
.method input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); flex: none; }
.method-body { display: grid; gap: 1px; min-width: 0; flex: 1; }
.method-title { font-weight: 500; color: var(--text-2); }
.method-kind { color: var(--muted); font-size: var(--fs-sm); }
.method:has(input:checked) { background: var(--surface-2); }
.method:has(input:checked) .method-title { color: var(--text); }
.rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-sm); }
.rules li { display: flex; gap: 8px; align-items: flex-start; }
.rules .ic { width: 16px; height: 16px; margin-top: 2.5px; color: var(--muted); }   /* (21 − 16) / 2, плюс общий сдвиг */
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
/* Ведомость «подпись — значение»: строки через линию, без вложенной карточки */
.summary-list { display: grid; gap: 0; margin: var(--s-4) 0; border-top: 1px solid var(--line); }
.summary-list .sl { display: flex; justify-content: space-between; gap: var(--s-4); padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.summary-list dd s { color: var(--muted); font-weight: 400; margin-right: 6px; }

/* Выдача товара: простой текст как есть (переносы сохраняются), адреса — ссылки; без рамки и копирования */
.keytext { white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; margin: var(--s-2) 0 var(--s-3); }
/* Строки копирования (реквизиты заявки) */
.copyrow { display: flex; align-items: center; gap: var(--s-3); padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.copyrow + .copyrow { border-top: 0; }
.copyrow-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.copyrow-label { color: var(--muted); font-size: var(--fs-sm); }
.copyrow-value { font-family: var(--mono); font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; user-select: all; }
.copyrow .btn { flex: none; }
/* «Скопировано»: иконка становится галочкой (JS), заливки нет */
.btn.ghost.is-done { border-color: var(--line-input); color: var(--text); }
.btn.is-done:not(.ghost) { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }

/* Чек после покупки: одна тихая строка по центру */
.receipt-line { margin: var(--s-4) 0 0; text-align: center; color: var(--muted); font-size: var(--fs-xs); letter-spacing: .04em;
  font-variant-numeric: tabular-nums; }
.receipt-line + .muted { margin-top: var(--s-1); }

/* Герой успеха / статуса */
.hero { display: grid; justify-items: center; text-align: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.hero h1 { margin: 0; }
.hero .sub { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.hero-amount { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.status-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: transparent;
  color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.status-icon .ic { width: 30px; height: 30px; }
.status-icon.ok { color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }
.status-icon.warn { color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.status-icon.bad { color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.status-page { text-align: center; padding-top: var(--s-6); padding-bottom: var(--s-6); }
.status-page .status-icon { margin: 0 auto var(--s-4); }
.status-page p { color: var(--text-2); }
.status-page .row { margin-top: var(--s-4); }
.waiting { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sm); margin: var(--s-3) 0 0; }
.waiting.center { display: flex; justify-content: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236, 235, 232, .35); } 100% { box-shadow: 0 0 0 10px rgba(236, 235, 232, 0); } }
.steps { margin: var(--s-3) 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.steps li::before { counter-increment: step; content: counter(step); flex: none; width: 24px; height: 24px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); font-size: var(--fs-xs); font-weight: 500; display: grid; place-items: center; margin-top: 1px;
  font-variant-numeric: tabular-nums; }

/* Кабинет — кошелёк: баланс по центру, две ровные кнопки, профиль тонкой строкой под линией */
.wallet { text-align: center; }
.wallet-inner { max-width: 440px; margin: 0 auto; }
.wallet .eyebrow { margin-bottom: 6px; }
.wallet-value { font-size: 2.75rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums;
  margin: 0 0 var(--s-4); overflow-wrap: anywhere; }
.wallet-promo { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
.wallet-actions { display: flex; gap: var(--s-3); }
.wallet-actions .btn { flex: 1 1 0; min-width: 0; }
.profile { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: var(--s-4);
  padding-top: var(--s-4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: .8125rem;
  color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.profile-name { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.profile-id { font-variant-numeric: tabular-nums; }
.profile-id::before { content: "·"; margin-right: 10px; }

/* История — ведомость: записи через линию; только что купленное подсвечивается один раз */
.history { list-style: none; padding: 0; margin: 0; }
.history li { scroll-margin-top: 20px; padding: 14px 8px 12px; border-top: 1px solid var(--line); }
.history li:last-child { border-bottom: 1px solid var(--line); }
.history li.latest { animation: flash 2.6s var(--ease) 1; }
@keyframes flash { 0%, 30% { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--text); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
.history .title { font-weight: 500; margin: 0 0 2px; display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.history .meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); margin: 0; color: var(--muted); font-size: var(--fs-sm); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.history .meta .receipt { margin-left: auto; font-size: var(--fs-xs); letter-spacing: .02em; }
.history .title > span:first-child { flex: 1 1 auto; overflow-wrap: anywhere; }
.history .title .price { font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.history details summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 2px; color: var(--link); cursor: pointer;
  font-weight: 500; font-size: var(--fs-sm); list-style: none; }
.history details summary::-webkit-details-marker { display: none; }
.history details summary .ic { width: 16px; height: 16px; transition: transform var(--t-fast); }
.history details[open] summary .ic { transform: rotate(90deg); }
.history .keytext { margin: var(--s-2) 0 0; }

/* Уведомления */
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { display: flex; align-items: center; gap: var(--s-3); padding: 12px 0; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.note-ic { width: 40px; height: 40px; border-radius: var(--r-md); flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); }
.notes li.unread .note-ic { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.note-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.note-title { overflow-wrap: anywhere; }
.notes li.unread .note-title { font-weight: 500; }
.note-time { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.note-dot { width: 0; height: 0; border: 4px solid var(--text); border-radius: 50%; flex: none; }

/* Подвал */
.foot { display: flex; gap: var(--s-4) var(--s-5); flex-wrap: wrap; justify-content: center; padding: var(--s-4) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.foot a { color: var(--muted); min-height: 32px; display: inline-flex; align-items: center; }
.foot:empty { display: none; }

/* Наведение — только там, где есть мышь; на телефоне работает :active */
/* Раздел разработчика /dev (решение владельца 27.10.2026): виден одному Telegram ID. Те же карточки и строки,
   что на витрине; удаление — тихая красная кнопка с обязательной галочкой. */
.dev-tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.dev-tabs a { text-decoration: none; display: inline-flex; align-items: center; }
.dev-title { margin-top: var(--s-4); }
.dev-gap { margin-top: var(--s-3); }
.caticon.sm { width: 44px; height: 44px; border-radius: var(--r-sm); }
.caticon.sm svg { width: 24px; height: 24px; }
.caticon.sm .emoji { font-size: 1.5rem; }
.devlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.devlist > li { border-bottom: 1px solid var(--line); }
.devrow { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: 8px 6px; color: var(--text); }
a.devrow { text-decoration: none; }
a.devrow:active { background: var(--surface-2); }
.devrow-name { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.devrow-meta { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.devrow-meta.none { color: var(--warn-text); }
.dev-cat { scroll-margin-top: calc(var(--header-h) + 12px); }
.dev-cat + .dev-cat { margin-top: var(--s-4); }
.dev-cat-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.dev-cat-head h2 { margin: 0; flex: 1; min-width: 0; }
.dev-inline { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: flex-end; }
.dev-inline .field { flex: 1 1 200px; }
.dev-inline .field.narrow-field { flex: 0 1 140px; }
.dev-inline > .btn { min-height: 48px; }
.dev-more { margin-top: var(--s-4); border-top: 1px solid var(--line); padding-top: var(--s-3); }
.dev-more > summary { cursor: pointer; color: var(--link); font-weight: 500; list-style: none; min-height: 36px; display: inline-flex; align-items: center; }
.dev-more > summary::-webkit-details-marker { display: none; }
.dev-more[open] > summary { margin-bottom: var(--s-3); }
.devlist + .dev-more { margin-top: 0; border-top: 0; }
.icongrid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--s-2); }
.icongrid legend { padding: 0; margin-bottom: 6px; font-weight: 500; }
.iconopt { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; min-height: 88px; padding: 12px 6px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; text-align: center; font-size: var(--fs-xs); color: var(--text-2); }
.iconopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.iconopt svg { width: 30px; height: 30px; stroke-width: 1.5; }
.iconopt img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.iconopt .emoji-slot { width: 30px; height: 30px; border-radius: 50%; border: 1px dashed var(--line-strong); }
.iconopt .emoji { font-size: 1.75rem; line-height: 30px; filter: grayscale(1) brightness(1.15); }
.iconopt:has(input:checked) { border-color: var(--text); background: var(--surface-2); color: var(--text); }
.iconopt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.iconopt.wide-opt { grid-column: span 2; }
.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad-text); }
.btn.danger:active { background: var(--surface-2); }
.confirm { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.confirm input { width: 18px; height: 18px; accent-color: var(--bad); }
.itemlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.itemlist > li { display: flex; align-items: flex-start; gap: var(--s-3); padding: 10px 2px; border-bottom: 1px solid var(--line); }
.itemlist .item-data { flex: 1; min-width: 0; font-family: var(--mono); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.itemlist .item-date { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.devlog { list-style: none; margin: 0; padding: 0; }
.devlog > li { display: flex; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.devlog time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.devlog .target { color: var(--muted); overflow-wrap: anywhere; }
@media (hover: hover) {
  a:hover { text-decoration: underline; }
  a.devrow:hover { background: var(--surface-2); text-decoration: none; }
  .iconopt:hover { border-color: var(--line-strong); color: var(--text); }
  .btn.danger:hover { background: var(--surface-2); border-color: var(--bad); color: var(--bad-text); }
  .dev-tabs a:hover { text-decoration: none; }
  .brand:hover, .balance:hover, .iconbtn:hover, .btn:hover, .tile:hover, .prow:hover, .back:hover, .chip:hover, .foot a:hover { text-decoration: none; }
  .balance:hover { background: var(--surface-1); }
  .iconbtn:hover { color: var(--text); background: var(--surface-2); }
  .btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
  .btn.ghost:hover { background: var(--surface-2); border-color: var(--line-input); }
  .btn:disabled:hover { background: var(--surface-3); border-color: var(--surface-3); }
  .btn.is-pending:disabled:hover { background: var(--btn); border-color: var(--btn); }
  .btn.ghost.is-pending:disabled:hover { background: transparent; border-color: var(--line-strong); }
  .back:hover, .foot a:hover { color: var(--text); }
  .tile:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .prow:hover { background: var(--surface-2); }
  .chip:hover { border-color: var(--line-input); color: var(--text); }
  .method:hover { background: var(--surface-2); }
}

/* Особые режимы */
@media (forced-colors: active) {
  .tile::before { forced-color-adjust: none; background: Highlight; }
  .tile.no-stock::before { background: GrayText; }
  .stockbar { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .stockbar.none { background: GrayText; color: Canvas; }
  input[type=text]:focus, input[type=number]:focus, select:focus { outline: 2px solid Highlight; }
  .note-dot { border-color: CanvasText; }
  .top::after { background: Highlight; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tile:active, .btn:active { transform: none; }
  .top.loading::after { width: 100%; opacity: 1; }
  .history li.latest { box-shadow: inset 3px 0 0 var(--text); }
}

/* Печать: тёмная тема на бумаге нечитаема */
@media print {
  body { background: #fff; color: #000; }
  .top, .foot, .skip, .btn, .links, .back, .nav { display: none !important; }
  .card, .tile, .plist, .prow, .history li, .copyrow, .summary-list .sl, .notice, .caticon, .stockbar { background: none; color: #000; border-color: #999; box-shadow: none; }
  a { color: #000; }
}

/* Телефон */
@media (max-width: 560px) {
  h1 { font-size: var(--fs-xl); }
  h2 { font-size: 1.1875rem; }
  .wallet-value { font-size: 2.5rem; }
  .main { padding-top: var(--s-4); }
  .card { padding: var(--s-4); border-radius: var(--r-md); }
  .nav-refill, .iconbtn-label { display: none; }
  .balance { padding: 0 8px; }
  .links { gap: var(--s-2); }
  .linkbtn { min-width: 96px; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { min-height: 120px; gap: 16px; padding: 16px 16px 16px 19px; }
  .caticon { width: 76px; height: 76px; }
  .caticon svg { width: 40px; height: 40px; }
  .caticon .emoji { font-size: 2.4rem; }
  .tile-name { font-size: 1.25rem; }
  .prow { padding: 12px 10px 12px 14px; }
  .copyrow { flex-wrap: wrap; }
  .copyrow .btn { width: 100%; }
  .row > .btn { flex: 1 1 auto; }
}
