/*
  Кабинет владельца магазинов (merchant.<домен>). Рабочая панель: спокойная, деньги на первом месте.
  Скилл design-taste-frontend (только применимые к панели правила): один акцент (золото UC), холодные нейтрали,
  иконки Phosphor, карточки только у форм и графика, остальное разделено пустым местом и тонкими линиями.
  Скругления: карточки и модалки 14px, кнопки и поля 10px, бейджи и переключатели — полные.
  Движение: только отклик на наведение и нажатие; мерцание заглушек — при отсутствии reduced-motion.
*/

@font-face {
  font-family: "Onest"; src: url("/fonts/onest-cyrillic.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; src: url("/fonts/onest-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215;
}

:root {
  --accent: #e3a21a; --on-accent: #1d1503;
  --r-card: 14px; --r-ctl: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
  --bg: #f5f6f8; --surface: #fcfcfd; --surface-2: #eef0f3; --line: #e2e5ea; --line-strong: #c8cdd5;
  --text: #15181e; --muted: #535b69; --faint: #6f7684;
  --ok: #0b7a4b; --warn: #8f5500; --err: #b42330;
  --accent-ink: #8a5d00;            /* акцент как текст на светлом фоне: контраст ≥ 4.5 */
  --accent-soft: #fbf1db;
  --bar: #e3a21a; --bar-hi: #b47c06;
  --shadow: 0 1px 2px rgba(21, 24, 30, .05);
  --mark-glow: 0 0 12px rgba(227, 162, 26, .38);  /* свечение знака DivaFlow */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1013; --surface: #15181d; --surface-2: #1c2026; --line: #262a32; --line-strong: #3a404b;
    --text: #eceef2; --muted: #a2a8b4; --faint: #7f8693;
    --ok: #46c98d; --warn: #efb24a; --err: #ff7d87;
    --accent-ink: #f0b232; --accent-soft: #2a2213;
    --bar: #b8861f; --bar-hi: #f0b232;
    --shadow: none;
    --mark-glow: 0 0 16px rgba(240, 178, 50, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1013; --surface: #15181d; --surface-2: #1c2026; --line: #262a32; --line-strong: #3a404b;
  --text: #eceef2; --muted: #a2a8b4; --faint: #7f8693;
  --ok: #46c98d; --warn: #efb24a; --err: #ff7d87;
  --accent-ink: #f0b232; --accent-soft: #2a2213;
  --bar: #b8861f; --bar-hi: #f0b232;
  --shadow: none;
  --mark-glow: 0 0 16px rgba(240, 178, 50, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
.ph, .ph-fill { font-size: 20px; line-height: 1; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Каркас: боковое меню на компьютере, нижняя панель на телефоне ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.app.bare { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 20px 14px;
  border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; padding: 0 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #0e0f12 url(/brand/icon-192.png) center / 150% no-repeat; color: transparent; font-size: 0; flex: none; box-shadow: var(--mark-glow); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r-ctl); text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.nav a[aria-current="page"] .ph { color: var(--accent-ink); }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-foot .btn { justify-content: flex-start; color: var(--muted); }
.side-foot .btn:hover { color: var(--text); }
.me { padding: 4px 12px 10px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { display: block; color: var(--text); font-size: 14px; }
.mobile-top { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 0; border: 0; background: none; display: contents; }
  .side > .brand, .side-foot { display: none; }
  .mobile-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px;
    background: color-mix(in oklab, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mobile-top[hidden] { display: none; }
  .mobile-top .brand { padding: 0; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 0 4px; font-size: 11.5px; position: relative; }
  .nav a .ph { font-size: 22px; }
  .nav a[aria-current="page"] { background: none; color: var(--accent-ink); }
  .nav .count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
  .main { padding-bottom: 104px !important; }
}

.main { width: 100%; max-width: 1120px; padding: 36px 40px 64px; display: grid; gap: 40px; outline: none; align-content: start; }
@media (max-width: 860px) { .main { padding: 20px 16px 40px; gap: 32px; } }
.section { display: grid; gap: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head { display: grid; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--text); }
.crumbs .ph { font-size: 14px; }

/* ---------- Требует внимания: готовые действия ---------- */
.todo { display: grid; gap: 10px; }
.todo-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
.todo-item .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.todo-item.warn .ico { background: color-mix(in oklab, var(--warn) 14%, transparent); color: var(--warn); }
.todo-item.ok .ico { background: var(--accent-soft); color: var(--accent-ink); }
.todo-item.err .ico { background: color-mix(in oklab, var(--err) 12%, transparent); color: var(--err); }
.todo-item .t { flex: 1; min-width: 0; }
.todo-item .t b { display: block; font-size: 15px; }
.todo-item .t span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 560px) { .todo-item { flex-wrap: wrap; } .todo-item .btn { width: 100%; } }
/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: 14.5px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .ph { font-size: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 90%, black); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { width: 42px; padding: 0; }
.btn-lg { min-height: 48px; padding: 0 20px; font-size: 15.5px; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 650; }
.input { width: 100%; min-height: 46px; padding: 10px 13px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 16px; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 24%, transparent); }
.input[aria-invalid="true"] { border-color: var(--err); }
.input[disabled] { opacity: .6; }
.group { display: flex; }
.group > * { border-radius: 0; }
.group > :first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.group > :last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.group > * + * { margin-left: -1px; }
.group .addon { display: grid; place-items: center; padding: 0 13px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font-weight: 600; }
.group .input { flex: 1; min-width: 0; }
.code-input { letter-spacing: .45em; font-size: 24px; text-align: center; }
.error-text { display: flex; gap: 6px; align-items: center; color: var(--err); font-size: 13.5px; }
.error-text .ph { font-size: 16px; }

/* ---------- Поверхности ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 16px; align-content: start; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge .ph, .badge .ph-fill { font-size: 14px; }
.badge.ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, transparent); }
.badge.err { color: var(--err); background: color-mix(in oklab, var(--err) 12%, transparent); }
.badge.plain { background: transparent; border: 1px solid var(--line-strong); }
.segmented { display: inline-grid; grid-auto-flow: column; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); }
.segmented button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.note.warn { background: color-mix(in oklab, var(--warn) 11%, transparent); color: var(--text); }
.note .ph { margin-top: 1px; font-size: 18px; }

/* ---------- Деньги: главная сумма слева, остальное списком справа ---------- */
.money { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.money-main { display: grid; gap: 10px; justify-items: start; padding: 28px; border-radius: var(--r-card); background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line)); }
.money-main .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.money-main .big { font-size: 46px; line-height: 1; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.money-main .sub { color: var(--muted); font-variant-numeric: tabular-nums; }
.money-main .btn { margin-top: 8px; }
.money-side { display: grid; }
.money-side .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; }
.money-side .row + .row { border-top: 1px solid var(--line); }
.money-side .row span { color: var(--muted); }
.money-side .row b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.money-side .row small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 760px) { .money { grid-template-columns: 1fr; gap: 8px; } .money-main { padding: 22px; } .money-main .big { font-size: 40px; } }

/* ---------- Магазины: строки одного списка ---------- */
.shop-list { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.shop-row { display: grid; grid-template-columns: minmax(0, 1.6fr) auto repeat(3, minmax(90px, .55fr)) 20px; gap: 20px; align-items: center;
  padding: 16px 20px; text-decoration: none; transition: background-color .15s; }
.shop-row + .shop-row { border-top: 1px solid var(--line); }
.shop-row:hover { background: var(--surface-2); }
.shop-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.initials { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.shop-name b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-name .hint { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-mini span { display: block; font-size: 12px; color: var(--muted); }
.stat-mini b { font-variant-numeric: tabular-nums; font-size: 15px; }
.shop-row .cta { grid-column: 3 / 6; display: flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 650; font-size: 14px; }
.shop-row > .ph { color: var(--faint); }
@media (max-width: 760px) {
  .shop-row { grid-template-columns: 1fr auto; gap: 12px 14px; padding: 16px; }
  .shop-row > .badge { justify-self: end; }
  .shop-row .stat-mini, .shop-row .cta { grid-column: span 1; }
  .shop-row .stats-wrap { grid-column: 1 / -1; }
  .shop-row > .ph { display: none; }
}
.stats-wrap { display: contents; }
@media (max-width: 760px) { .stats-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .stats-wrap .cta { grid-column: 1 / -1; } }

/* ---------- Продажи: показатели одной строкой ---------- */
.stats-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-line > div { padding: 4px 24px; display: grid; gap: 4px; }
.stats-line > div:first-child { padding-left: 0; }
.stats-line > div + div { border-left: 1px solid var(--line); }
.stats-line span { font-size: 13px; color: var(--muted); font-weight: 600; }
.stats-line b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .stats-line { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .stats-line > div:nth-child(3) { border-left: 0; padding-left: 0; }
}
.sales-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .sales-grid { grid-template-columns: 1fr; } }
.top-list { display: grid; gap: 14px; padding-top: 4px; }
.top-list .item { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: baseline; }
.top-list .rank { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 600; }
.top-list .sub { color: var(--muted); font-size: 13px; }
.top-list b { font-variant-numeric: tabular-nums; }

/* ---------- График: одна серия, тонкие столбики, скруглённый верх 4px, зазор 2px ---------- */
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; align-items: end; height: 170px; }
.bar { height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: none; cursor: pointer; }
.bar span { width: 100%; height: max(2px, var(--h)); border-radius: 4px 4px 0 0; background: var(--bar); transition: background-color .15s; }
.bar.on span, .bar:hover span { background: var(--bar-hi); }
.bar-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 6px; }
.bar-tip { font-size: 14px; min-height: 21px; font-variant-numeric: tabular-nums; }

/* ---------- Магазин: контент слева, управление справа ---------- */
.shop-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.shop-side { display: grid; gap: 16px; }
@media (max-width: 960px) { .shop-grid { grid-template-columns: 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 14.5px; }
.kv b { font-variant-numeric: tabular-nums; }
.prices { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); }
.empty-state { display: grid; gap: 12px; justify-items: start; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.empty-state .ph { font-size: 32px; color: var(--accent-ink); }

/* ---------- Таблица выплат ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; }
.cell-sub { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.steps { display: grid; gap: 14px; }
.steps div { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--muted); font-size: 14.5px; }
.steps .ph { color: var(--accent-ink); }

/* ---------- Товары и цены: в строке товара калькулятор «процент ↔ рубли» ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fees { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); font-size: 14px; }
.fees > span:not(.hint) { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.fees b { color: var(--text); font-variant-numeric: tabular-nums; }
.fees .ph { font-size: 18px; color: var(--accent-ink); }
.price-table { min-width: 860px; }
.price-table th, .price-table td { vertical-align: middle; padding: 10px 16px; }
.price-table tbody th { font-weight: 400; }
.price-table .cell-main { display: block; font-weight: 650; font-size: 14.5px; }
.price-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table .group-row th { padding: 9px 16px; background: var(--surface-2); font-size: 12.5px; font-weight: 650; color: var(--muted); border-top: 1px solid var(--line); }
.price-table tbody:first-of-type .group-row th { border-top: 0; }
.price-table .group-row + tr td, .price-table .group-row + tr th { border-top: 1px solid var(--line); }
.calc { width: 128px; }
.calc .input { min-height: 40px; padding: 6px 10px; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.calc .addon { padding: 0 10px; font-size: 14px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 6px; }
/* На телефоне строка товара — карточка: подписи колонок переезжают к значениям, вбок ничего не прокручивается */
@media (max-width: 760px) {
  .price-table { min-width: 0; }
  .price-table thead { display: none; }
  .price-table tbody, .price-table .group-row, .price-table .group-row th { display: block; }
  .price-table tr[data-offer] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .price-table tr[data-offer] > * { padding: 0; border: 0 !important; text-align: left; white-space: normal; }
  .price-table tr[data-offer] > th, .price-table tr[data-offer] > .row-actions { grid-column: 1 / -1; }
  .price-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .price-table .calc { width: 100%; }
  .price-table .row-actions:not(:has(.btn:not([hidden]))) { display: none; }
}

/* ---------- Вход ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); gap: 18px; padding: 28px; }
.auth-card .brand { margin-bottom: 4px; }
.auth-card h1 { font-size: 24px; }

/* ---------- Вход: космический хаб (просьба владельца 2026-10-16) ----------
   Сцена всегда тёмная — это космос, тема кабинета на неё не влияет. Слои снизу вверх: звёзды (canvas, merchant.js
   starfield), туманность, кольца станции, строка связи, форма. Классы на .auth: intro — идёт сцена (quick — короткая,
   повторный вход в сессии), ready — всё на месте. Без движения (prefers-reduced-motion) сразу ready */
.auth.space {
  --bg: #05060d; --surface: rgba(13, 16, 30, .72); --surface-2: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .22); --text: #eef0ff; --muted: #a7adc6; --faint: #7d84a0; --err: #ff8a93;
  --accent-ink: #f0b232; color-scheme: dark;
  position: relative; isolation: isolate; overflow: hidden; color: var(--text);
  background: radial-gradient(120% 90% at 50% 46%, #0d1230 0%, #05060d 62%);
}
.space-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3; }
.space-nebula { position: absolute; inset: -20%; z-index: -2; pointer-events: none;
  background: radial-gradient(38% 30% at 72% 26%, rgba(240, 178, 50, .16), transparent 70%),
              radial-gradient(42% 34% at 24% 74%, rgba(96, 92, 255, .2), transparent 70%),
              radial-gradient(30% 24% at 82% 80%, rgba(0, 190, 255, .1), transparent 70%); }
.hub-rings { position: absolute; left: 50%; top: 46%; width: min(820px, 170vw); aspect-ratio: 1; translate: -50% -50%; z-index: -1; pointer-events: none; overflow: visible; }
.hub-rings circle { fill: none; }
.hub-rings .ring { stroke: rgba(160, 175, 255, .16); stroke-width: 1; }
.hub-rings .r2 { stroke: rgba(240, 178, 50, .22); }
.hub-rings .arc { stroke-linecap: round; }
.hub-rings .a1 { stroke: rgba(240, 178, 50, .75); stroke-width: 2.5; stroke-dasharray: 180 1517; filter: drop-shadow(0 0 6px rgba(240, 178, 50, .8)); }
.hub-rings .a2 { stroke: rgba(120, 190, 255, .7); stroke-width: 2; stroke-dasharray: 90 255 60 940; filter: drop-shadow(0 0 5px rgba(120, 190, 255, .7)); }
.hub-rings .ticks { stroke: rgba(200, 210, 255, .28); stroke-width: 7; stroke-dasharray: 1.2 14.5; }
.hub-rings .sat { fill: #f0b232; filter: drop-shadow(0 0 6px #f0b232); }
.hub-log { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); translate: -50% 0; margin: 0;
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.hub-log .dot { width: 7px; height: 7px; border-radius: 50%; background: #46c98d; box-shadow: 0 0 10px #46c98d; }
.auth.space .auth-card { position: relative; background: var(--surface); border: 1px solid rgba(240, 178, 50, .28);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 80px rgba(0, 0, 0, .55), 0 0 70px rgba(240, 178, 50, .09); }
/* Уголки-«скобы» панели хаба */
.auth.space .auth-card::after { content: ""; position: absolute; inset: 6px; pointer-events: none;
  background: linear-gradient(#f0b232, #f0b232) top left / 18px 2px no-repeat, linear-gradient(#f0b232, #f0b232) top left / 2px 18px no-repeat,
              linear-gradient(#f0b232, #f0b232) bottom right / 18px 2px no-repeat, linear-gradient(#f0b232, #f0b232) bottom right / 2px 18px no-repeat; opacity: .85; }
.auth.space .input { background: rgba(255, 255, 255, .05); }
.hub-dock { position: relative; width: min(400px, 100%); display: grid; }
.hub-dock .auth-card { width: 100%; }
/* Сканирующая линия, из которой раскрывается форма: рядом с формой, а не в ней — форма в этот момент обрезана */
.hub-scan { position: absolute; left: 50%; top: 50%; height: 2px; width: 0; translate: -50% -50%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, #f0b232, #fff, #f0b232, transparent); box-shadow: 0 0 18px #f0b232; border-radius: 2px; }
.auth.space .brand-mark { box-shadow: 0 0 18px rgba(240, 178, 50, .45); }
/* Название компании на карточке входа: «Flow» — золотом, как на логотипе */
.brand-word { display: inline-block; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.brand-word b { font-weight: inherit; color: #e0b866; }

@media (prefers-reduced-motion: no-preference) {
  .hub-rings .s1 { animation: spin 46s linear infinite; }
  .hub-rings .s2 { animation: spin 32s linear infinite reverse; }
  .hub-log .dot { animation: blink 1.6s ease-in-out infinite; }
  .space-nebula { animation: drift 30s ease-in-out infinite alternate; }

  /* Полная сцена: кольца прорисовываются, форма раскрывается из линии, поля проявляются по очереди */
  .auth.intro .hub-rings { animation: hub-in 1.5s var(--ease) .35s both; }
  .auth.intro .hub-rings .ring, .auth.intro .hub-rings .ticks { animation: draw 1.6s var(--ease) .45s both; }
  .auth.intro .hub-log { animation: fade .5s var(--ease) both; }
  .auth.intro .auth-card { animation: unfold .55s var(--ease) 1.25s both; }
  .auth.intro .hub-scan { animation: scan .7s var(--ease) .9s both; }
  .auth.intro .st { animation: rise .5s var(--ease) both; animation-delay: calc(1.55s + var(--i) * 75ms); }
  /* Финал — логотип как на GIF: значок вспыхивает в центре карточки (--mark-shift считает merchant.js), уезжает
     на место, из-под него раскатывается DivaFlow */
  .auth.intro:not(.quick) .auth-card .brand.st { animation: none; }
  /* Три анимации на разных свойствах (scale/rotate, translate, box-shadow) складываются, не перебивая друг друга */
  .auth.intro:not(.quick) .brand .brand-mark {
    animation: mark-pop .8s cubic-bezier(.22, 1, .36, 1) 1.45s both,
               mark-slide .85s cubic-bezier(.65, 0, .35, 1) 2.1s both,
               mark-glow 1.9s ease-in-out 1.45s both;
  }
  .auth.intro:not(.quick) .brand .brand-word { animation: word-roll 1s cubic-bezier(.22, 1, .36, 1) 2.7s both; }
  /* Надпись выходит из-под значка, а не ложится на него */
  .auth.intro:not(.quick) .brand .brand-mark { position: relative; z-index: 1; }
  /* Короткая сцена (повторный вход): только проявление */
  .auth.intro.quick .hub-rings, .auth.intro.quick .hub-rings .ring, .auth.intro.quick .hub-rings .ticks { animation-duration: .5s; animation-delay: 0s; }
  .auth.intro.quick .auth-card { animation: unfold .4s var(--ease) .05s both; }
  .auth.intro.quick .hub-scan { animation: none; }
  .auth.intro.quick .st { animation-delay: calc(.2s + var(--i) * 45ms); animation-duration: .35s; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes drift { to { transform: translate(3%, -2%) scale(1.06); } }
@keyframes hub-in { from { opacity: 0; transform: scale(.55) rotate(-25deg); } }
@keyframes draw { from { stroke-dashoffset: 2100; stroke-dasharray: 2100; } }
@keyframes scan { 0% { width: 0; opacity: 1; } 60% { width: 110%; opacity: 1; } 100% { width: 110%; opacity: 0; } }
@keyframes unfold { from { clip-path: inset(50% 0 50% 0 round 14px); opacity: .4; } to { clip-path: inset(0 0 0 0 round 14px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }
/* Значок: мягко проявляется в центре карточки → плавно уезжает на место; вспышка нарастает и гаснет отдельно */
@keyframes mark-pop { from { opacity: 0; scale: .7; rotate: -25deg; filter: blur(5px); } to { opacity: 1; scale: 1; rotate: 0deg; filter: blur(0); } }
@keyframes mark-slide { from { translate: var(--mark-shift, 0) 0; } to { translate: 0 0; } }
@keyframes mark-glow {
  0% { box-shadow: 0 0 0 rgba(240, 178, 50, 0); }
  40% { box-shadow: 0 0 34px rgba(240, 178, 50, .75); }
  100% { box-shadow: 0 0 18px rgba(240, 178, 50, .45); }
}
/* Надпись: «шторка» с растушёванным краем (маска-градиент едет слева направо) */
.auth.intro:not(.quick) .brand .brand-word {
  -webkit-mask-image: linear-gradient(90deg, #000 0 40%, transparent 60% 100%); mask-image: linear-gradient(90deg, #000 0 40%, transparent 60% 100%);
  -webkit-mask-size: 250% 100%; mask-size: 250% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
@keyframes word-roll {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: 0; translate: -10px 0; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; translate: 0 0; }
}

/* ---------- Модалка и всплывашки ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(9, 11, 15, .55); display: grid; place-items: center; padding: 16px; }
.modal { width: min(440px, 100%); max-height: 90dvh; overflow: auto; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: var(--r-ctl); background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(9, 11, 15, .25); }
.toast.err { background: var(--err); color: #fff; }
@media (max-width: 760px) { .toast { bottom: 92px; } }
.skeleton { border-radius: var(--r-card); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; min-height: 120px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.2s linear infinite; }
  .scrim { animation: fade .18s var(--ease); }
}
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }

/* Продажи внутри страницы магазина: колонка уже, график и топ друг под другом, суммы не переносятся */
.stats-line b { white-space: nowrap; }
.shop-grid .sales-grid { grid-template-columns: 1fr; }
.shop-grid .stats-line b { font-size: 22px; }
@media (min-width: 761px) and (max-width: 1240px) { .shop-grid .stats-line { grid-template-columns: 1fr 1fr; gap: 16px 0; } .shop-grid .stats-line > div:nth-child(3) { border-left: 0; padding-left: 0; } }
/* Админы магазина в Telegram */
.admin-list { display: grid; gap: 2px; }
.admin-list .kv { min-height: 40px; align-items: center; }

/* Акции: промокоды и приглашения */
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .02em; }
.promo-table { min-width: 900px; }
.promo-table th, .promo-table td { vertical-align: middle; }
.promo-table .cell-main { display: block; font-weight: 700; font-size: 15px; }
.promo-table .cell-sub { word-break: normal; }
.modal.wide { width: min(640px, 100%); }
.label { font-size: 13.5px; font-weight: 650; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check .grow { flex: 1; }
.pick-list { display: grid; gap: 4px; max-height: 280px; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); }
.pick-group { border: 0; margin: 0; padding: 0 0 6px; }
.pick-group legend { padding: 0; font-weight: 650; }
.pick-group > .check { padding-left: 28px; }
.more summary { cursor: pointer; font-weight: 650; font-size: 14px; }
.more[open] { display: grid; gap: 8px; }
.rf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.stats-row { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  /* промокод — карточкой, как строка товара */
  .promo-table { min-width: 0; }
  .promo-table thead { display: none; }
  .promo-table tbody { display: block; }
  .promo-table tr[data-id] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .promo-table tr[data-id]:first-child { border-top: 0; }
  .promo-table tr[data-id] > * { padding: 0; border: 0 !important; text-align: left; }
  .promo-table tr[data-id] > th, .promo-table tr[data-id] > td[data-label="Товары"], .promo-table .row-actions { grid-column: 1 / -1; }
  .promo-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .promo-table .row-actions { text-align: left; }
}

/* ---------- Аналитика, вкладки магазина, заказы (2026-10-14, аудит по ui-ux-pro-max + dataviz) ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-top: -12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; white-space: nowrap; text-decoration: none;
  color: var(--muted); font-weight: 650; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .ph { font-size: 18px; }
#tab-box { display: grid; gap: 24px; }
.an { gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.kpi-l { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-v { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.kpi-d { min-height: 20px; font-size: 13px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta .ph { font-size: 14px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.an-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.an-slices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.an h3 { font-size: 15px; font-weight: 700; }
/* График: шкала слева, сетка и линия среднего, столбики с подсказкой */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 10px; row-gap: 6px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; margin: -7px 0; }
.chart-plot { position: relative; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { border-top: 1px dashed color-mix(in oklab, var(--line) 100%, transparent); }
.chart-grid i:last-child { border-top: 1px solid var(--line-strong, var(--line)); }
.chart-avg { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1.5px dashed var(--muted); opacity: .7; pointer-events: none; z-index: 1; }
.chart-avg span { position: absolute; right: 0; bottom: 3px; font-size: 11.5px; color: var(--muted); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.cbars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart[data-n="90"] .cbars { gap: 1px; }
.cbar { flex: 1; height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: none; cursor: pointer; min-width: 0; }
.cbar span { width: 100%; height: max(3px, var(--h)); border-radius: 4px 4px 0 0; background: color-mix(in oklab, var(--accent) 78%, var(--surface)); transition: background-color .15s; }
.chart[data-n="90"] .cbar span { border-radius: 2px 2px 0 0; }
.cbar.zero span { background: var(--line); }
.cbar.on span, .cbar:hover span, .cbar:focus-visible span { background: var(--accent); }
.chart-tip { position: absolute; top: 4px; transform: translateX(-50%); z-index: 2; display: grid; gap: 2px; min-width: 140px; padding: 8px 10px; border-radius: 10px;
  background: var(--text); color: var(--surface); font-size: 12.5px; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .4); pointer-events: none; }
.chart-tip span { display: flex; justify-content: space-between; gap: 12px; opacity: .85; }
.chart-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.hours + .chart-x { grid-column: auto; }
/* Товары: доля полоской, динамика */
.tprods { display: grid; gap: 14px; }
.tprod { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.tprod .rank { color: var(--faint); font-weight: 650; font-variant-numeric: tabular-nums; padding-top: 1px; }
.tprod-t { display: grid; gap: 4px; min-width: 0; }
.tprod-v { display: grid; justify-items: end; gap: 2px; }
.share, .hbar-track { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.share span, .hbar-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.hbar-track { grid-column: 1 / -1; }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 72px; }
.hours span { flex: 1; height: max(2px, var(--h)); border-radius: 3px 3px 0 0; background: color-mix(in oklab, var(--accent) 78%, var(--surface)); }
a.note { text-decoration: none; }
a.note:hover { filter: brightness(1.04); }
/* Заказы */
.orders-table { min-width: 860px; }
.orders-table td, .orders-table th { vertical-align: middle; }
.orders-table .cell-main { display: block; font-weight: 650; }
.orders-table .cell-sub { display: block; word-break: normal; }
.nowrap { white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.prices-head .card { max-width: 560px; }
/* Цены: на компьютере таблица, метка «своя наценка» — только где она своя */
.price-table .own { height: 20px; padding: 0 7px; font-size: 11.5px; margin-left: 6px; vertical-align: middle; }
.price-table .m-sum { display: none; }
.grp-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.grp-toggle .ph { transition: transform .2s; }
.grp-toggle .hint { font-weight: 600; }
tbody.collapsed .grp-toggle .ph { transform: rotate(-90deg); }
tbody.collapsed tr[data-offer] { display: none !important; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-grid, .an-slices { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-v { font-size: 20px; }
  .chart { grid-template-rows: 170px auto; }
  .tabs { margin-top: -4px; }
  .tabs a { padding: 0 12px; }
  /* Цена: строка свёрнута — название, цена, доход; «Изменить» раскрывает поля */
  .price-table .m-sum { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
  .price-table .m-sum .row-open { margin-left: auto; }
  .price-table tr[data-offer]:not(.open) > td { display: none; }
  .price-table tr[data-offer].open .row-open { color: var(--accent-ink); }
  /* Заказы карточками */
  .orders-table { min-width: 0; }
  .orders-table thead { display: none; }
  .orders-table tbody { display: block; }
  .orders-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .orders-table tr:first-child { border-top: 0; }
  .orders-table tr > * { padding: 0; border: 0 !important; text-align: left !important; }
  .orders-table tr > th { grid-column: 1 / -1; order: -1; }
  .orders-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
}
#an-body { display: grid; gap: 16px; }
.avg-key { display: inline-flex; align-items: center; gap: 6px; }
.avg-key i { width: 18px; border-top: 1.5px dashed var(--muted); }
.toast-act { margin-left: 14px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 2px; }
@media (max-width: 760px) { .tabs { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 28px; } }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
#promos-box { display: grid; gap: 24px; }
/* Вернуть покупателя: текст и предпросмотр сообщения как в Telegram */
.wb-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tg-bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); font-size: 14.5px; line-height: 1.45; max-width: 360px; overflow-wrap: anywhere; }
.tg-bubble code, .hint code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; padding: 1px 5px; border-radius: 5px; background: color-mix(in oklab, var(--accent) 16%, transparent); }
@media (max-width: 760px) { .wb-text { grid-template-columns: 1fr; } }
.wb-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 760px) { .wb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Пауза, лента заказов, счета, аудитория, рассылки, розыгрыши, объявления (2026-10-14) ---------- */
.note-act { align-items: center; }
.note-act > span { flex: 1; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: middle; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 50%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live 2s ease-out infinite; }
  @keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
  .feed-list li.fresh { animation: fresh 2.4s ease-out; }
  @keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
}
.feed { display: grid; gap: 12px; }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 8px; }
.feed-list li:first-child { border-top: 0; }
.feed-t { font-size: 13px; color: var(--muted); }
.feed-main { display: grid; min-width: 0; }
.feed-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.feed-sum { display: grid; text-align: right; font-weight: 650; }
@media (max-width: 760px) {
  .feed-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .feed-t { grid-column: 1 / -1; }
  .feed-list .badge { grid-column: 1 / -1; justify-self: start; }
}
.inv-earn { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); }
.inv-earn { align-items: center; }
.inv-earn b { display: grid; justify-items: end; gap: 2px; font-size: 18px; white-space: nowrap; }
.inv-earn b .hint { font-size: 12.5px; font-weight: 500; }
.aud-table .btn-ghost { color: var(--muted); }
.aud-table .btn-ghost:hover { color: var(--err); }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aud-search { flex: 1 1 260px; max-width: 420px; }
.cell-act { text-align: right; }
.muted-row > * { opacity: .62; }
.muted-row .cell-act { opacity: 1; }
#aud-view, #aud-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.section-head .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.section-head .segmented button { white-space: nowrap; }
#orders-box, #tab-box { min-width: 0; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .aud-search { max-width: none; flex-basis: 100%; } }
.segmented .ph { font-size: 16px; vertical-align: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); }
.chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.45; font: inherit; }
select.input { appearance: auto; }
.bc-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .bc-grid { grid-template-columns: 1fr; } }
.tg-chat { display: grid; gap: 6px; justify-items: start; padding: 16px; border-radius: var(--r-card); background: color-mix(in oklab, var(--accent) 6%, var(--surface-2)); }
.tg-chat .tg-bubble { background: var(--surface); box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.tg-btn { width: min(360px, 100%); padding: 9px 14px; border-radius: 10px; background: color-mix(in oklab, var(--ok) 80%, #000 0%); color: #fff; text-align: center; font-weight: 650; font-size: 14px; }
.bc-list, .gw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bc, .gw { display: grid; gap: 10px; }
.bc-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bc-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bc-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s; }
.gw h3 { font-size: 16px; font-weight: 700; margin: 0; }
.gw-win { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Объявления платформы: колокольчик в меню и плашка важного */
.bell { position: relative; }
.bell .count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.ann-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); background: color-mix(in oklab, var(--warn) 13%, var(--surface)); border: 1px solid color-mix(in oklab, var(--warn) 35%, transparent); }
.ann-banner > .ph { font-size: 20px; color: var(--warn); margin-top: 1px; }
.ann-banner > div { flex: 1; display: grid; gap: 2px; }
.ann-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.ann-list li { display: grid; gap: 4px; padding: 12px; border-radius: var(--r-ctl); }
.ann-list li.unread { background: var(--accent-soft); }
.ann-list p { margin: 0; white-space: pre-line; color: var(--muted); }

/* Промокод на категории: плитки-чекбоксы игр (2026-10-14) */
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.cat-pick > .hint { grid-column: 1 / -1; }
.cat-chip { position: relative; display: block; cursor: pointer; }
.cat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cat-chip span { display: grid; gap: 2px; min-height: 52px; padding: 9px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 650; font-size: 14px; transition: border-color .15s, background-color .15s; }
.cat-chip small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.cat-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.cat-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-chip input:checked + span::after { content: "✓"; position: absolute; top: 8px; right: 12px; color: var(--accent-ink); font-weight: 800; }
/* ---------- Товары и цены: игры карточками → товары плитками (2026-10-14, «B + ползунок из C») ---------- */
/* Обложки игр: официальный арт там, где он есть (Genshin, HoK), иначе цвета игры — как плитки Mini App */
.cover-pubg { --cv: #f2a900; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(242, 169, 0, .25), transparent 55%), linear-gradient(160deg, #2a2618, #121110 75%); }
.cover-genshin { --cv: #e6c27a; --cbg: linear-gradient(180deg, rgba(10, 8, 24, .2), rgba(10, 8, 24, .86)), url("/miniapp/img/genshin-art.jpg") center / cover; }
.cover-hok { --cv: #f3d48a; --cbg: linear-gradient(180deg, rgba(4, 14, 34, .2), rgba(4, 14, 34, .86)), url("/miniapp/img/hok-art.jpg") center / cover; }
.cover-robux { --cv: #101114; --cfg: #101114; --cbg: linear-gradient(160deg, #f4f5f7, #dfe2e6); }
.cover-tg { --cv: #fff; --cbg: linear-gradient(160deg, #2aabee, #1679c4 85%); }
.cover-ff { --cv: #ff9a3c; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(255, 140, 40, .45), transparent 60%), linear-gradient(160deg, #6e1a08, #1d0703 78%); }
.cover-mlbb { --cv: #7db4ff; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(90, 160, 255, .4), transparent 60%), linear-gradient(160deg, #102f6b, #070f2a 80%); }
.cover-zzz { --cv: #d4f238; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(212, 242, 56, .22), transparent 55%), linear-gradient(160deg, #23241d, #0b0b0a 75%); }
.cover-hsr { --cv: #c3afff; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(160, 130, 255, .45), transparent 60%), linear-gradient(160deg, #2c2163, #0c0a24 80%); }
.cover-codm { --cv: #ffb000; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(255, 176, 0, .25), transparent 55%), linear-gradient(160deg, #262626, #0d0d0d 78%); }
.cover-delta { --cv: #ff7a1a; --cbg: radial-gradient(120% 90% at 100% 0%, rgba(255, 122, 26, .25), transparent 55%), linear-gradient(160deg, #2a3330, #0e1312 78%); }
.ico { display: grid; place-items: center; color: var(--cv, var(--accent)); }
.ico .ph-fill, .ico .ph { font-size: 1em; }

/* Уровень 1: карточки игр */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.gcard { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; min-height: 184px; padding: 16px; border-radius: var(--r-card);
  border: 1px solid rgba(255, 255, 255, .12); background: var(--cbg); color: var(--cfg, #fff); text-decoration: none;
  transition: transform .15s, box-shadow .15s; }
.gcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.gcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.g-top { position: relative; z-index: 1; display: grid; gap: 2px; max-width: 62%; }
.g-name { font-size: 19px; font-weight: 800; line-height: 1.15; }
.g-cat { font-size: 13px; opacity: .82; }
.g-art { position: absolute; right: -6px; top: 26px; width: 44%; aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; }
.g-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
.g-art .ico { font-size: 80px; }
.g-foot { position: relative; z-index: 1; align-self: end; display: grid; gap: 6px; font-size: 13px; }
.g-mk { justify-self: start; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); font-size: 15px; font-weight: 800; }
.cover-robux .g-mk { background: rgba(16, 17, 20, .1); }

/* Уровень 2: шапка игры с ползунком */
.prices-game { gap: 16px; }
.back-link { justify-self: start; }
.ghero { display: grid; gap: 12px; padding: 18px 20px; border-radius: var(--r-card); background: var(--cbg); color: var(--cfg, #fff); }
.gh-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ghero h2 { margin: 2px 0 0; color: inherit; font-size: 24px; }
.gh-val { display: grid; justify-items: end; font-size: 13px; opacity: .95; }
.gh-val b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.rng { width: 100%; height: 30px; accent-color: var(--accent); cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.ghero .chip { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: inherit; }
.ghero .chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: #111; }
.ghero .chip.ghost { background: transparent; }
.cover-robux .ghero .chip, .ghero.cover-robux .chip { background: rgba(16, 17, 20, .06); border-color: rgba(16, 17, 20, .2); }
.ghero.cover-robux .chip[aria-pressed="true"] { background: #101114; color: #fff; }
.gh-hint { font-size: 13px; opacity: .8; }

/* Плитки товаров со степпером */
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.ptile { position: relative; display: grid; gap: 4px; align-content: start; padding: 10px 10px 12px; border-radius: var(--r-card); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s; }
.ptile.dirty { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ptile .art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 6px; border-radius: calc(var(--r-card) - 6px);
  background: var(--cbg); overflow: hidden; }
.ptile .art img { width: 76%; height: 76%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.ptile .art .ico { font-size: 52px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.ptile .own { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; }
.ptile .t { display: flex; align-items: baseline; gap: 6px; min-height: 26px; }
.ptile .t b.num { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.ptile .t em { font-style: normal; color: var(--accent-ink); font-size: 15px; margin-left: 2px; }
.ptile .t small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ptile .t .nm { font-size: 14.5px; line-height: 1.25; }
.ptile .price { font-size: 18px; font-weight: 750; }
.ptile .earn { color: var(--muted); font-size: 12.5px; }
.ptile .delta { margin-left: 6px; font-size: 12.5px; font-weight: 700; }
.ptile .delta.up { color: var(--ok); } .ptile .delta.down { color: var(--err); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 8px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.stepper button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stepper b { min-width: 56px; text-align: center; font-size: 15px; }
.savebar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45); }
.savebar > span { margin-right: auto; }
@media (max-width: 760px) {
  .gcards { grid-template-columns: 1fr; }
  .gcard { min-height: 150px; }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stepper button { width: 34px; height: 34px; }
  .stepper b { min-width: 0; }
  .gh-val { justify-items: start; }
  .savebar { bottom: 84px; } /* над нижним меню телефона */
}/* Наценка магазина — полосой над карточками игр */
.mk-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.mk-strip h2 { margin: 0 0 2px; }
.mk-inline { display: flex; gap: 8px; align-items: center; }
.mk-inline .field { width: 120px; }
.mk-samples { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; padding: 0; background: none; font-size: 13.5px; }
.mk-sample { white-space: nowrap; }
@media (max-width: 760px) {
  .mk-strip { grid-template-columns: 1fr; }
  .mk-inline .field { flex: 1; width: auto; }
  .ptile .card-p { display: none; }
  .savebar { gap: 6px; padding: 8px 10px; font-size: 14px; }
  .savebar .sb-long { display: none; }
  .savebar .btn { padding-inline: 12px; }
}
.prices-head .card.mk-strip { max-width: none; padding-block: 16px; }

/* ---------- Товары и цены, вариант E (2026-10-14): доход вводом и ползунком, цены по способам оплаты ---------- */
.ptile.e { gap: 5px; }
.big-in { display: inline-flex; align-items: baseline; gap: 2px; cursor: text; }
.big-in input { field-sizing: content; min-width: 3ch; max-width: 9ch; width: 7ch; border: 1px solid transparent; border-bottom: 1px dashed var(--line-strong);
  border-radius: 8px; background: transparent; color: var(--ok); font: inherit; font-size: 22px; font-weight: 800; padding: 1px 2px; }
.big-in input:hover { border-color: var(--line-strong); }
.big-in input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.big-in span { font-size: 18px; font-weight: 800; color: var(--ok); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
.mth { display: grid; gap: 1px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.mth.soon { opacity: .6; }
.mth-l { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.mth-l .ph { font-size: 13px; flex: none; }
.mth b { font-size: 14.5px; font-weight: 750; }
@media (max-width: 760px) {
  .methods { gap: 4px; } .mth { padding: 5px 6px; } .mth b { font-size: 13.5px; } .mth-l { font-size: 10.5px; }
  .big-in input { font-size: 19px; }
}
.big-in input { field-sizing: fixed; max-width: none; min-width: 0; }
@media (max-width: 760px) { .prices-game .gh-hint { display: none; } }

/* Обложки новых игр — те же официальные заставки, что в Mini App (2026-10-14) */
.cover-ff { --cbg: linear-gradient(180deg, rgba(20, 6, 2, .15), rgba(20, 6, 2, .88)), url("/miniapp/img/ff-art.jpg") right center / cover; /* логотип арта слева не спорит с названием */ }
.cover-mlbb { --cbg: linear-gradient(180deg, rgba(6, 10, 32, .15), rgba(6, 10, 32, .88)), url("/miniapp/img/mlbb-art.jpg") center / cover; }
.cover-zzz { --cbg: linear-gradient(180deg, rgba(10, 10, 8, .15), rgba(10, 10, 8, .88)), url("/miniapp/img/zzz-art.jpg") center / cover; }
.cover-hsr { --cbg: linear-gradient(180deg, rgba(10, 8, 28, .15), rgba(10, 8, 28, .88)), url("/miniapp/img/hsr-art.jpg") center / cover; }
.cover-codm { --cbg: linear-gradient(180deg, rgba(8, 8, 8, .15), rgba(8, 8, 8, .88)), url("/miniapp/img/codm-art.jpg") center / cover; }
.cover-delta { --cbg: linear-gradient(180deg, rgba(8, 12, 10, .2), rgba(8, 12, 10, .9)), url("/miniapp/img/delta-art.jpg") center / cover; }
.cover-tg { --cbg: linear-gradient(180deg, rgba(8, 40, 80, .1), rgba(8, 40, 80, .85)), url("/miniapp/img/tg-art.jpg") center / cover; }
/* На плитке товара — обложка без затемнения снизу, картинка пакета поверх */
.ptile .art.cover-ff, .ptile .art.cover-mlbb, .ptile .art.cover-zzz, .ptile .art.cover-hsr, .ptile .art.cover-codm, .ptile .art.cover-delta, .ptile .art.cover-tg { background-blend-mode: normal; }