:root {
  color-scheme: dark;
  /* Фиксированная ТЁМНАЯ тема — НЕ зависим от темы Telegram (иначе при светлой
     теме TG текст становился тёмным и сливался с тёмными карточками). */
  --bg: #0a0b0f;
  --surface: #14161d;
  --surface-2: #1d2029;
  --text: #f4f5f8;
  --muted: #8b91a1;
  --accent: #e23744;
  --accent-2: #ff5161;
  --accent-text: #fff;
  --accent-soft: rgba(226,55,68,.15);
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --ok: #3ad07a;
  --danger: #ff5d6c;
  --r: 18px;
  --r-sm: 13px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: 'Manrope', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(226,55,68,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); padding-bottom: 104px; letter-spacing: -.01em;
}
.hidden { display: none !important; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 0; }

/* ── Шапка ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 19px; flex: 1; letter-spacing: -.02em; }
.brand span { background: linear-gradient(92deg, #fff, #ff8a93);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-back {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform .12s, background .15s;
}
.nav-back:active { transform: scale(.92); }
.white-toggle { border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; font-size: 17px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: .15s; }
.white-toggle.on { background: #fff; color: #111; border-color: #fff; }

/* ── Баннер-шапка (main_menu) ─────────────────────────── */
.hero { position: relative; width: 100%; aspect-ratio: 1376 / 620; max-height: 220px;
  overflow: hidden; background: var(--surface); }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-grad { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,11,15,.05) 0%, rgba(10,11,15,.35) 60%, var(--bg) 100%); }
.hero-content { position: absolute; left: 16px; right: 16px; bottom: 11px; z-index: 1; }
.hero-tag { font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.92);
  letter-spacing: -.01em; text-shadow: 0 1px 10px rgba(0,0,0,.6); }

/* ── Кабинет ─────────────────────────────────────────── */
.cabinet { margin: 14px 16px 0; padding: 16px 18px; border-radius: var(--r);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
  border: 1px solid var(--line); }
.cab-top { display: flex; justify-content: space-between; align-items: center; }
.cab-name { font-size: 15px; font-weight: 600; }
.cab-tier { font-size: 12px; font-weight: 600; color: #ffb3ba;
  background: var(--accent-soft); padding: 4px 10px; border-radius: 20px; }
.balances { display: flex; gap: 10px; margin-top: 14px; }
.bal { flex: 1; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 14px; display: flex; flex-direction: column; gap: 3px; }
.bal-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.bal b { font-size: 19px; font-weight: 800; }

/* ── Заголовки / крошки ──────────────────────────────── */
.app { padding: 18px 16px 8px; }
.loader { color: var(--muted); text-align: center; padding: 60px 0; }
.view-title { font-size: 24px; font-weight: 800; margin: 6px 2px 18px; letter-spacing: -.025em; }
/* Шапка главной: «Каталог» + область входа справа */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-head .view-title { margin: 6px 2px 18px; }
.home-auth { flex-shrink: 0; margin-bottom: 12px; }
.tg-login-btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap;
  border: none; border-radius: 12px; padding: 10px 15px; font-family: inherit; font-weight: 700;
  font-size: 13.5px; color: #fff; background: linear-gradient(135deg, #2aabee, #229ed9);
  box-shadow: 0 6px 16px rgba(34,158,217,.35); transition: transform .12s; }
.tg-login-btn:active { transform: scale(.96); }
.tg-login-btn .tg-ico { font-size: 15px; }
.auth-chip { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 9px 13px; font-family: inherit; font-weight: 700; font-size: 13px; }
.auth-chip .auth-bal { color: var(--accent); }
.crumb { color: var(--muted); font-size: 13px; font-weight: 600; margin: 2px 2px 14px; }
.crumb b { color: var(--text); }
.admin-back { cursor: pointer; font-weight: 800; }
.admin-back:active { opacity: .7; }

/* ── Блок «Как это работает» (главная — для всех; Каталог — белый режим) ── */
.how-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 16px; }
.how-title { font-weight: 800; font-size: 16px; margin-bottom: 12px; letter-spacing: -.02em; }
.how-steps { display: flex; flex-direction: column; gap: 10px; }
.how-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); line-height: 1.4; }
.how-step b { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.how-link { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: none; }

/* ── Бренд-баннеры разделов (главная) — широкие, как у aoki ───────────── */
.brand-cards { display: flex; flex-direction: column; gap: 12px; }
.brand-card { display: flex; align-items: center; gap: 16px; cursor: pointer; text-align: left;
  border: none; border-radius: var(--r); padding: 20px 18px; min-height: 90px; position: relative;
  overflow: hidden; transition: transform .14s ease; }
.brand-card:active { transform: scale(.985); }
/* Затемняющий скрим — под задним логотипом (делает карточку темнее, но НЕ гасит лого) */
.brand-card::after { content: ''; position: absolute; inset: 0; z-index: 0; background: rgba(0,0,0,.34); }
.brand-card > * { position: relative; z-index: 2; }
/* Крупный размытый логотип-фон справа (за текстом, тот же файл, что слева) —
   z-index 1: ВЫШЕ скрима, поэтому виден и не затемняется */
.brand-card > .brand-bg { position: absolute; z-index: 1; right: 22px; top: 50%;
  transform: translateY(-50%); height: 172%; width: auto; max-width: 58%;
  object-fit: contain; opacity: .38; filter: blur(2.5px) brightness(1.15); pointer-events: none; }
/* Передний логотип — на «чипе»: скруглённый квадрат со светлой подложкой */
.brand-ico { width: 56px; height: 56px; flex-shrink: 0; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px; padding: 9px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
/* Брендовое лого с чёрной заливкой (Apple/Roblox/Google Play, см. NS_GROUP_ICONS)
   на полупрозрачном чипе выше терялось бы на тёмном фоне карточки. */
.brand-ico.chip-white { background: #fff; border-color: rgba(0,0,0,.08); }
.brand-logo { width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)) brightness(1.08); }
.brand-text { flex: 1; min-width: 0; }
.brand-name { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: -.02em; }
.brand-sub { color: rgba(255,255,255,.8); font-size: 12.5px; margin-top: 4px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-go { font-size: 26px; color: rgba(255,255,255,.85); flex-shrink: 0; }
.brand-card[data-brand="playstation"] { background: linear-gradient(110deg, #0a2a86, #1f7ae8); }
.brand-card[data-brand="xbox"] { background: linear-gradient(110deg, #0b6b1f, #36b24a); }
.brand-card[data-brand="emails"] { background: linear-gradient(110deg, #2c313d, #6b7484); }
.brand-card[data-brand="steam"] { background: linear-gradient(110deg, #0e1a27, #2a4d6e); }
.brand-card[data-brand="ns"] { background: linear-gradient(110deg, #7a1020, #e23744); }
.brand-card[data-brand="default"] { background: linear-gradient(110deg, #20232c, #3a3f4e); }

/* ── Подразделы ──────────────────────────────────────── */
.subcards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.subcard { display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 16px;
  transition: transform .14s, border-color .15s; }
.subcard:active { transform: scale(.985); border-color: var(--line-2); }
.subcard-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; background: var(--accent-soft); flex-shrink: 0; }
.subcard-ico.chip-white { background: #fff; border: 1px solid rgba(0,0,0,.08); }
/* Флаги-эмодзи как SVG-картинки (Windows не рендерит флаги шрифтом) */
.flag-img { height: 1em; width: auto; vertical-align: -0.12em; margin: 0 .04em; }
.subcard-ico .flag-img { height: 30px; }
.brand-ico .flag-img { height: 32px; }
.subcard-main { flex: 1; min-width: 0; }
.subcard-name { font-weight: 700; font-size: 15px; }
.subcard-count { color: var(--muted); font-size: 12px; margin-top: 2px; }
.subcard-arrow { color: var(--muted); font-size: 20px; }

/* ── Товары (сетка карточек) ─────────────────────────── */
.group { margin-bottom: 22px; }
.group-head { color: var(--muted); font-size: 13px; font-weight: 700; margin: 6px 2px 12px;
  text-transform: uppercase; letter-spacing: .5px; }
.section-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
/* Описание NS-раздела («В каталог») — переносы строк, как ввёл админ, а не
   схлопнутые в одну строку (браузер по умолчанию игнорирует \n в тексте). */
.ns-group-desc { white-space: pre-line; }

/* Подписки (Essential/Extra/Deluxe/EA Play × 1/3/12 мес.) — были таблицей
   4×3 (до 12 карточек-кнопок разом, владелец дважды назвал результат
   «громоздко»/«неаккуратно», даже после смягчения цвета кнопок). Теперь —
   чипы периода (переиспользуют .ns-region-chips, тот же приём, что и выбор
   региона в «Кодах пополнения») + компактный список .item-list из 4 строк
   с ценой ВЫБРАННОГО периода — см. app.js: subscriptionsBlock. Обёрнуто
   отдельной карточкой (как .how-block) — владелец попросил визуально
   выделить блок подписок, а не оставлять чипы+список голыми на фоне страницы. */
.subs-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 14px 4px; margin-bottom: 22px; }
.subs-block .ns-region-chips { margin: 0 0 14px; }
.subs-block .item-list { margin-bottom: 10px; }

/* Строки товаров (подписки/аккаунты) — во всю ширину, столбиком */
.item-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; }
.item-row.in-cart { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.item-row-name { font-size: 14px; font-weight: 600; }
.item-row-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.item-row-price { font-weight: 800; font-size: 15px; white-space: nowrap; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
.product { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 104px; transition: border-color .15s; }
.product.in-cart { border-color: var(--accent); background:
  linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.product-name { font-weight: 600; font-size: 13.5px; line-height: 1.35; flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.product-price.req { color: var(--muted); font-size: 13px; font-weight: 600; }

.add-btn { border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  width: 34px; height: 34px; border-radius: 11px; font-size: 22px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add-btn:active { transform: scale(.9); }
.stepper { display: flex; align-items: center; background: var(--accent-soft); border-radius: 11px; }
.stepper button { border: none; background: transparent; color: #ffb3ba; width: 30px; height: 34px;
  font-size: 19px; cursor: pointer; font-weight: 800; }
.stepper .qty { min-width: 20px; text-align: center; font-weight: 800; font-size: 14px; }

/* ── Коды пополнения (NS.Gifts «Другие товары») — платформы/регионы/номиналы ──
   Ряд платформ (.ns-platform-row/-tile/-name) убран — платформы внутри «Коды
   пополнения» теперь рендерятся теми же .brand-card, что и главное меню (см.
   renderNsPlatforms/brandCardEl) — владелец: «отличается от того, что бывает
   в главном меню, сделай по их подобию». .ns-platform-img остаётся — тот же
   класс использует _buildNsIcoEl для картинки внутри .subcard-ico. */
.ns-platform-img { width: 60%; height: 60%; object-fit: contain; display: block; }

/* Регионов у некоторых платформ много (PS: Индия/Польша/Великобритания/USA/
   ОАЭ/…) — чипы переносятся на несколько строк (flex-wrap), а не горизонтальный
   скролл с полосой прокрутки (неудобно листать много регионов вбок). */
.ns-region-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.ns-region-chip { flex: 0 0 auto; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 20px; cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: .15s; }
.ns-region-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; }

/* Строка номинала (вертикальный список, как item-row) — остаток показан
   отдельной строкой под названием, а не абсолютным бейджем как в карточке. */
.ns-denom-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ns-denom-row-stock { font-size: 11px; font-weight: 700; color: var(--muted); }
.ns-denom-row.in-cart .ns-denom-row-stock { color: rgba(255,255,255,.85); }

/* Строка подписки (subTypeRow) кликабельна целиком — открывает инфо-модалку
   о преимуществах (openSubTypeInfo); клик по цене/кнопке справа — своё
   stopPropagation, туда не долетает. */
.item-row-clickable { cursor: pointer; }
/* Значок уровня подписки — реальные лого (PS Plus / EA Play, файлы от
   владельца) на нейтральном белом чипе НЕЗАВИСИМО от цвета строки (см.
   .sub-color-* ниже) — иначе, например, красный EA-лого на такой же
   красной строке (EA Play) стал бы не виден. */
.sub-type-badge { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff; padding: 6px; }
.sub-type-badge-img { width: 100%; height: 100%; object-fit: contain; }

/* Цвет — на ВСЮ строку (владелец: «хочу что бы вся кнопка была в цветах, а
   не только фрагмент PS и +» — первая версия красила только маленький
   значок и кружок «+», сама строка оставалась обычной тёмной). Реальные
   цвета официального бейджа PS Plus (бело-жёлто-чёрная гамма Essential/
   Extra/Deluxe, скриншот-референс от владельца — первая версия цветов
   (синий/бирюзовый/фиолетовый) была моей выдумкой, ничем не подтверждённой)
   + EA Play красный (тоже по прямому указанию владельца).
   Составной селектор из 3 классов (.item-row.item-row-clickable.sub-color-*)
   — чтобы гарантированно победить базовый .item-row.in-cart (2 класса)
   независимо от порядка правил в файле (тот же класс бага, что уже
   находили с .admin-input-narrow/.site-auth-tabs). Кнопка «+»/цена/название
   красятся КОНТРАСТНЫМ цветом текста строки — иначе слились бы с фоном. */
.item-row.item-row-clickable.sub-color-essential {
  background: #ffffff; border-color: #ffffff; }
.item-row.item-row-clickable.sub-color-extra {
  background: #f7b500; border-color: #f7b500; }
.item-row.item-row-clickable.sub-color-deluxe {
  background: #17181c; border-color: rgba(247,181,0,.35); }
.item-row.item-row-clickable.sub-color-ea_play {
  background: #d81f26; border-color: #d81f26; }

.item-row.item-row-clickable.sub-color-essential .item-row-name,
.item-row.item-row-clickable.sub-color-essential .ns-denom-row-stock,
.item-row.item-row-clickable.sub-color-essential .item-row-price,
.item-row.item-row-clickable.sub-color-extra .item-row-name,
.item-row.item-row-clickable.sub-color-extra .ns-denom-row-stock,
.item-row.item-row-clickable.sub-color-extra .item-row-price {
  color: #0a0a0f; }
.item-row.item-row-clickable.sub-color-essential .ns-denom-row-stock,
.item-row.item-row-clickable.sub-color-extra .ns-denom-row-stock {
  color: rgba(10,10,15,.65); }

.item-row.item-row-clickable.sub-color-deluxe .item-row-name,
.item-row.item-row-clickable.sub-color-deluxe .item-row-price,
.item-row.item-row-clickable.sub-color-ea_play .item-row-name,
.item-row.item-row-clickable.sub-color-ea_play .item-row-price {
  color: #ffffff; }
.item-row.item-row-clickable.sub-color-deluxe .ns-denom-row-stock {
  color: rgba(247,181,0,.75); }
.item-row.item-row-clickable.sub-color-ea_play .ns-denom-row-stock {
  color: rgba(255,255,255,.75); }

/* Кнопка «+» на цветной строке — контрастный контур вместо сплошной заливки
   акцентным градиентом (тот дефолт слился бы с одинаковым фоном строки). */
.item-row.item-row-clickable.sub-color-essential .add-btn,
.item-row.item-row-clickable.sub-color-extra .add-btn {
  background: rgba(10,10,15,.1); color: #0a0a0f; border: 1.5px solid rgba(10,10,15,.35); }
.item-row.item-row-clickable.sub-color-deluxe .add-btn,
.item-row.item-row-clickable.sub-color-ea_play .add-btn {
  background: rgba(255,255,255,.14); color: #ffffff; border: 1.5px solid rgba(255,255,255,.4); }
/* Степпер (уже в корзине) на цветной строке — та же логика контраста. */
.item-row.item-row-clickable.sub-color-essential .stepper,
.item-row.item-row-clickable.sub-color-extra .stepper {
  background: rgba(10,10,15,.1); }
.item-row.item-row-clickable.sub-color-essential .stepper button,
.item-row.item-row-clickable.sub-color-extra .stepper button,
.item-row.item-row-clickable.sub-color-essential .stepper .qty,
.item-row.item-row-clickable.sub-color-extra .stepper .qty {
  color: #0a0a0f; }
.item-row.item-row-clickable.sub-color-deluxe .stepper,
.item-row.item-row-clickable.sub-color-ea_play .stepper {
  background: rgba(255,255,255,.14); }
.item-row.item-row-clickable.sub-color-deluxe .stepper button,
.item-row.item-row-clickable.sub-color-ea_play .stepper button,
.item-row.item-row-clickable.sub-color-deluxe .stepper .qty,
.item-row.item-row-clickable.sub-color-ea_play .stepper .qty {
  color: #ffffff; }
/* Список преимуществ подписки внутри модалки (openSubTypeInfo). */
.sub-info-bullets { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; margin-bottom: 8px; }
.sub-info-bullet { font-size: 14px; line-height: 1.4; color: var(--text); }

/* ── Калькулятор ─────────────────────────────────────── */
.calc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; margin-bottom: 16px; }
.calc-title { font-weight: 800; font-size: 17px; margin-bottom: 6px; letter-spacing: -.02em; }
.new-badge { display: inline-flex; align-items: center; margin-left: 8px; vertical-align: middle;
  font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, #7b2ff7, #f107a3); padding: 3px 9px; border-radius: 20px;
  animation: newGlow 1.7s ease-in-out infinite; white-space: nowrap; }
@keyframes newGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241,7,163,.5), 0 0 7px rgba(123,47,247,.55); }
  50% { box-shadow: 0 0 0 4px rgba(241,7,163,0), 0 0 17px rgba(241,7,163,.95); }
}
.calc-hint { color: var(--muted); font-size: 12px; margin-bottom: 14px; line-height: 1.5; }
.calc-input-row { display: flex; gap: 10px; }
.calc-input { flex: 1; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font-size: 16px; font-family: inherit; font-weight: 600; }
.calc-input:focus { outline: none; border-color: var(--accent); }
.calc-result { margin-top: 14px; font-size: 16px; min-height: 22px; font-weight: 600; }
.calc-result b { font-weight: 800; font-size: 20px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.calc-sub { color: var(--muted); font-size: 13px; }
.calc-add { width: 100%; margin-top: 14px; padding: 14px; font-size: 15px; }
.calc-select { flex: 0 0 auto; padding: 14px 12px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit; font-weight: 700; }
.calc-select:focus { outline: none; border-color: var(--accent); }
.calc-field-gap { margin-bottom: 12px; }
.calc-limit-hint { margin-top: 8px; margin-bottom: 0; }

/* «Local Equivalent» — сырая (без наценки) конвертация суммы пополнения Steam
   в остальные валюты, аналог одноимённой панели в кабинете провайдера. */
.steam-local-panel { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 14px 16px; margin-top: 14px; }
.steam-local-title { font-size: 10px; font-weight: 800; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.steam-local-row { display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; padding: 3px 0; }
.steam-local-label { color: var(--muted); font-weight: 600; }
.steam-local-value { font-weight: 700; }

/* ── Скидки: один визуальный блок «PlayStation» (лого+заголовок), внутри —
   регионы горизонтальной прокруткой. Отдельная карточка-обёртка нужна, чтобы
   было понятно, что это раздел именно PS — если рядом появится «Steam» со
   своим лого, блоки не будут смешиваться визуально. ──────────────────────── */
.deals-ps-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 18px; margin-bottom: 22px; }
.deals-ps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.deals-ps-logo { height: 26px; width: auto; object-fit: contain; flex-shrink: 0; }
.deals-ps-title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.deals-sections { display: flex; flex-direction: column; gap: 20px; }
.deals-section-title { font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; margin-bottom: 10px; }
.deals-hscroll { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.deals-hscroll::-webkit-scrollbar { height: 5px; }
.deals-hscroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.deals-hscroll .game-card { flex: 0 0 112px; width: 112px; scroll-snap-align: start; }
.deals-ps-block .game-card { background: var(--surface-2); }   /* контраст с фоном блока (тот же --surface) */
.deals-seeall-btn { width: 100%; margin-top: 10px; padding: 11px; border-radius: 12px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--accent); font-weight: 700;
  font-size: 13px; font-family: inherit; cursor: pointer; text-align: center; transition: border-color .15s; }
/* Скелетон «🔥 Скидки», пока грузится /api/deals (на холодном кеше сервер
   реально ходит в PS Store — заметная пауза без этого была бы просто пустым
   местом на главной). Форма/размеры повторяют реальный блок скидок. */
.deals-skeleton .deals-ps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.deals-skeleton-logo, .deals-skeleton-title, .deals-skeleton-card {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: skeleton-pulse 1.4s ease infinite; border-radius: 8px; }
.deals-skeleton-logo { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; }
.deals-skeleton-title { width: 200px; height: 16px; }
.deals-skeleton-row { display: flex; gap: 12px; overflow: hidden; }
.deals-skeleton-card { flex: 0 0 112px; width: 112px; height: 150px; border-radius: 12px; }
@keyframes skeleton-pulse { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.deals-seeall-btn:active { border-color: var(--accent); }
.deals-sort-row { display: flex; justify-content: flex-end; margin: 2px 0 4px; }
.deals-sort { background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; font-size: 12.5px;
  font-weight: 700; font-family: inherit; cursor: pointer; outline: none; }
.deals-sort:focus { border-color: var(--accent); }

/* ── Поиск игр PS (обложки, карточки, страница) ──────── */
.gsearch-seg { margin: 12px 0; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; margin-top: 14px; }
.game-card { cursor: pointer; border-radius: 12px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .12s, border-color .15s; }
.game-card:active { transform: scale(.97); border-color: var(--accent); }
.game-cover-wrap { position: relative; }
.game-cover { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: var(--surface-2); }
.game-plat { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; }
/* Избранное («сердечко») — плитка (правый верх обложки) и модалка (в шапке) */
.fav-heart { position: absolute; top: 6px; right: 6px; z-index: 2; border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.5); font-size: 13px;
  display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.fav-heart:disabled { opacity: .6; }
.modal-head .fav-heart { position: static; width: 34px; height: 34px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); }
.plat-badge { font-size: 9px; font-weight: 800; letter-spacing: .3px; color: #fff;
  background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.25); padding: 1px 5px; border-radius: 4px; }
.game-body { padding: 8px 9px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.game-kind { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.game-name { font-size: 12px; font-weight: 600; line-height: 1.28; max-height: 46px; overflow: hidden; }
.game-price { font-weight: 800; font-size: 13.5px; margin-top: auto; }
/* Отдельная цена для подписчиков PS Plus — маленький синий значок «PS+» +
   подпись, чтобы не путать с обычной скидкой (та — красная, .game-disc-badge). */
.game-plus-price { font-size: 11px; font-weight: 600; color: var(--text); margin-top: 1px; }
.ps-plus-badge { display: inline-block; background: #0d3ea3; color: #fff; font-size: 9.5px;
  font-weight: 800; letter-spacing: .2px; padding: 1px 5px; border-radius: 4px; margin-right: 3px; }
/* Аналог для EA Play (реальный красный цвет бренда, см. logo_ea_play.svg #ff4747
   и тир EA Play подписки #d81f26) — тот же приём, что PS+, просто другой бейдж. */
.ea-play-badge { display: inline-block; background: #d81f26; color: #fff; font-size: 9.5px;
  font-weight: 800; letter-spacing: .2px; padding: 1px 5px; border-radius: 4px; margin-right: 3px; }
/* Местная цена PS Store (₺/₴/₹) — видна только оптовикам, для сверки с
   реальным магазином. Приглушённый цвет — не конкурирует с основной ценой. */
.game-local-price { font-size: 11px; color: var(--muted); margin-top: 1px; }
/* Временный пробник (не постоянный доступ) по PS Plus/EA Play — отдельно от
   .game-plus-price (постоянный доступ): жёлто-амбер «внимание, ограничено по
   времени», чтобы не спутать пробник с полноценной покупкой/подпиской. */
.game-trial-note { font-size: 11px; font-weight: 600; color: #7a4a00; background: #fde68a;
  display: inline-block; padding: 2px 7px; border-radius: 5px; margin-top: 2px; line-height: 1.3; }
.game-disc { display: inline-block; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800;
  padding: 1px 5px; border-radius: 5px; margin-left: 4px; vertical-align: middle; }
/* Скидка PS Store */
.game-disc-badge { background: #e8342b; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .2px; padding: 2px 7px; border-radius: 6px; }
/* Блок скидки внизу плитки: чип «-50%» + время */
.game-disc-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.game-disc-chip { background: #e8342b; color: #fff; font-size: 10.5px; font-weight: 800;
  letter-spacing: .2px; padding: 2px 7px; border-radius: 6px; flex-shrink: 0; }
.game-disc-time { font-size: 10.5px; font-weight: 700; color: #ffb35a; }
.game-disc-line { margin: 2px 0 4px; }
.game-disc-badge.inline { display: inline-block; }
.game-disc-line .disc-timer { font-size: 13px; font-weight: 700; color: #ffb35a; margin-left: 4px; }
/* Старая цена (зачёркнута) + новая */
.game-oldprice { text-decoration: line-through; color: var(--muted); font-weight: 700; font-size: 11.5px; margin-right: 4px; }
.game-oldprice.big { font-size: 17px; }
.game-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.game-price-row .game-bigprice { margin: 0; }
/* Переключатель «Без Plus / С Plus» на полной карточке игры — клиент сам
   отвечает, есть ли у него подписка PS Plus (см. openGamePage в app.js). */
.ps-plus-toggle { display: flex; gap: 8px; margin-top: 10px; }
.ps-plus-toggle-btn { flex: 1; padding: 9px 10px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted);
  cursor: pointer; }
.ps-plus-toggle-btn.active { background: #0d3ea3; border-color: #0d3ea3; color: #fff; }
/* Переключатель «Без EA Play / С EA Play» — тот же `.ps-plus-toggle`
   контейнер (flex-ряд), своя кнопка-класс под цвет бренда EA Play. */
.ea-play-toggle-btn { flex: 1; padding: 9px 10px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted);
  cursor: pointer; }
.ea-play-toggle-btn.active { background: #d81f26; border-color: #d81f26; color: #fff; }
.games-empty { color: var(--muted); text-align: center; padding: 28px 0; grid-column: 1/-1; }
.games-count { color: var(--muted); font-size: 12px; font-weight: 700; margin: 12px 2px 6px; }
.games-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 800; font-size: 14px; cursor: pointer; }
.pg-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* Страница игры (модалка) */
.game-page .modal-card { padding-top: 0; }
.game-hero { margin: 0 -18px 14px; }
.game-hero img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.game-page h3 { margin: 4px 0 6px; }
.game-meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.game-bigprice { font-size: 26px; font-weight: 800; margin: 10px 0 4px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.game-info { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.game-chips { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
.game-summary { font-size: 13.5px; line-height: 1.6; color: var(--text); margin-bottom: 14px; }
.game-subhead { font-size: 13px; font-weight: 800; margin: 14px 0 8px; }
.game-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-chip { font-size: 11.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 4px 9px; border-radius: 20px; }
.game-shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.game-shots img { height: 116px; border-radius: 10px; flex-shrink: 0; border: 1px solid var(--line); cursor: zoom-in; }

/* Лайтбокс скриншотов */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 8px; }
.lb-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,.16); color: #fff; border: none; font-size: 19px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px;
  background: rgba(255,255,255,.14); color: #fff; border: none; font-size: 30px; cursor: pointer; border-radius: 12px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* ── Плавающая корзина ───────────────────────────────── */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 14px 16px;
  background: linear-gradient(transparent, var(--bg) 42%); }
.cart-bar button { width: 100%; border: none; color: #fff; padding: 16px 20px; border-radius: 16px;
  font-size: 16px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 32px rgba(109,94,252,.4); }
.cart-sum { font-weight: 800; }

/* ── Модалка корзины ─────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.66);
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); }
.modal-card { width: 100%; max-width: 560px; background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 18px 18px 28px; max-height: 90vh; overflow: auto; border-top: 1px solid var(--line-2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.modal-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.modal-head-left h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head-left .nav-back { width: 32px; height: 32px; font-size: 18px; flex-shrink: 0; }
.x { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 34px; height: 34px;
  border-radius: 11px; font-size: 16px; cursor: pointer; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-line-main { flex: 1; min-width: 0; }
.cart-line-name { font-size: 14px; font-weight: 600; }
.cart-line-price { color: var(--muted); font-size: 12px; margin-top: 3px; }
.cart-line .rm { border: none; background: none; color: var(--danger); font-size: 18px; cursor: pointer; }
/* Тумблер-слайдер «Аккаунт: На мой | Нужен новый» (один на весь заказ) */
.acc-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 2px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.acc-label { font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.acc-toggle { position: relative; flex: 1; display: flex; background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; cursor: pointer; user-select: none; }
.acc-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform .2s ease; }
.acc-toggle.on .acc-thumb { transform: translateX(100%); }
.acc-opt { flex: 1; z-index: 1; text-align: center; padding: 8px 4px; font-size: 12.5px;
  font-weight: 700; color: var(--muted); transition: color .18s; white-space: nowrap; }
.acc-opt.active { color: #fff; }
.acc-data { margin: 12px 0 2px; }
.acc-data-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.acc-data-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 46px;
  border: 1px solid var(--line-2); border-radius: 13px; background: var(--bg); color: var(--text);
  font-size: 15px; font-family: inherit; padding: 11px 13px; outline: none; }
.acc-data-input:focus { border-color: var(--accent); }
.cart-fee { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 12px 2px 0; text-align: right; }
.cart-fee.promo-off { color: #34c759; }
.promo-row { display: flex; gap: 8px; margin-top: 7px; }
.promo-row input { flex: 1; margin-top: 0; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit; text-transform: uppercase; }
.promo-row .btn-secondary { flex-shrink: 0; padding: 0 16px; }
.promo-msg { margin-top: 7px; font-size: 12.5px; font-weight: 700; }
.promo-msg.promo-ok { color: #34c759; }
.promo-msg.promo-err { color: #ff5964; }
.cart-total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; padding: 16px 2px 4px; }
.cart-total .muted { color: var(--muted); font-weight: 600; font-size: 13px; }
.field { display: block; margin: 14px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field textarea { width: 100%; margin-top: 7px; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; }
.btn-primary { border: none; color: #fff; border-radius: 14px; font-weight: 800; cursor: pointer; padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-primary.big { width: 100%; margin-top: 18px; font-size: 16px; padding: 16px; }
.btn-primary:disabled { opacity: .6; }
.btn-secondary { border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  border-radius: 14px; font-weight: 700; cursor: pointer; padding: 12px 16px; font-family: inherit; }
.logout-btn { display: block; width: 100%; margin-top: 14px; }
.tg-login-box { margin: 14px 0; display: flex; justify-content: center; min-height: 46px; }
/* Вход/регистрация по логину и паролю (без Telegram/VK) */
.site-auth-box { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }
.site-auth-divider { text-align: center; color: var(--muted); font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .5px; margin: 4px 0; }
.site-auth-tabs { align-self: center; }
/* Переопределяем фикс. ширину/высоту .seg button (38×28px, рассчитана на короткие
   иконки-лейблы) — «Регистрация» в неё не помещалась и вылезала за пределы
   активной таблетки. Элемент несёт ОБА класса ("seg site-auth-tabs") — простого
   `.site-auth-tabs button` НЕДОСТАТОЧНО: та же специфичность (1 класс+элемент),
   что у `.seg button`, а `.seg button` в файле ниже по тексту → выигрывает по
   порядку объявления. `.site-auth-tabs.seg button` — специфичность выше (2
   класса+элемент), побеждает независимо от порядка. */
.site-auth-tabs.seg button { width: auto; height: auto; padding: 8px 16px; border: none; background: none; color: var(--muted);
  font-weight: 700; font-size: 13px; border-radius: 8px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.site-auth-tabs.seg button.active { background: var(--accent); color: #fff; }
.site-auth-msg { color: var(--danger); font-size: 12.5px; text-align: center; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; text-align: center; }
.empty-cart { color: var(--muted); text-align: center; padding: 24px 0; }

/* ── Footer ──────────────────────────────────────────── */
.footer { padding: 30px 16px 48px; text-align: center; color: var(--muted); font-size: 13px; }
.footer a { display: inline-block; margin: 0 8px; color: #ff8a93; text-decoration: none; font-weight: 600; }
.footer .support { margin-top: 14px; }

/* ── Toast ───────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(8px);
  background: var(--surface-2); color: var(--text); padding: 11px 18px; border-radius: 13px; font-size: 14px;
  font-weight: 600; z-index: 50; border: 1px solid var(--line-2); opacity: 0; transition: .22s;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Нижняя таб-навигация ────────────────────────────── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px) saturate(140%); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0); }
.tab { flex: 1; border: none; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px;
  position: relative; transition: color .15s; }
.tab.active { color: var(--accent); }
.tab-ico { font-size: 21px; line-height: 1; filter: grayscale(.2); }
.tab.active .tab-ico { filter: none; }
.tab-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: -.01em; }
.tab-badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px;
  font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ── Админ-панель (валюта + белый режим) ─────────────── */
.admin-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-label { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-hint { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }

/* ── Вкладка «Админка» — секции: общее / белый режим / отзывы / FAQ ─────── */
.admin-section { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.admin-section-title { font-size: 15px; font-weight: 800; }
.admin-subtitle { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.admin-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-toggle-label { font-size: 13.5px; color: var(--text); }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  font-size: 13px; }
.admin-list-item-wide { align-items: flex-start; }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-sub { color: var(--accent); font-size: 12px; font-weight: 700; margin-top: 3px; }
.admin-item-text { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
/* Отрицательное значение (убыток за период/дельта баланса) — красным, где бы
   ни встретилось (не только .admin-client-row-balance, см. profitStatsBlockEl). */
.admin-item-text .neg { color: #e5484d; font-weight: 700; }
/* Компактная строка отзыва/FAQ — свёрнута по умолчанию, разворачивается по клику */
.admin-item-head { cursor: pointer; }
.admin-caret { color: var(--muted); display: inline-block; width: 12px; }
.admin-item-sub-inline { color: var(--accent); font-weight: 700; }
.admin-balance-current { background: var(--surface-2, var(--bg)); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 6px; }
.admin-item-text-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-conv-row { cursor: pointer; }
.support-conv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 2px; }
.admin-list-search { margin-bottom: 8px; }
.admin-del-btn { flex-shrink: 0; border: none; background: none; color: var(--danger); font-size: 16px;
  cursor: pointer; padding: 2px 4px; }
.admin-item-btns { flex-shrink: 0; display: flex; gap: 2px; }
.admin-edit-btn { flex-shrink: 0; border: none; background: none; font-size: 15px;
  cursor: pointer; padding: 2px 4px; opacity: .85; }
.admin-add-row { display: flex; gap: 8px; }
.admin-add-row .admin-input { flex: 1; }
.admin-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.admin-form-inline { width: 100%; margin-top: 0; padding-top: 0; border-top: none; }
.admin-input { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; font-size: 13.5px;
  font-family: inherit; outline: none; }
.admin-input:focus { border-color: var(--accent); }
textarea.admin-input { resize: vertical; min-height: 44px; }
/* Узкие числовые поля (тир/процент скидки внутри строки) — ПОСЛЕ .admin-input
   в исходнике, иначе width:100% того же класса перебивает width:72px (была
   реальная causa багa «поля съехали» — узкие инпуты рендерились на всю
   ширину строки и распихивали кнопки). */
.admin-input-narrow { width: 64px; flex: 0 0 auto; text-align: center; }
.admin-list-item-clickable { cursor: pointer; }
.admin-list-item-clickable:active { opacity: .8; }
.admin-client-card { display: flex; flex-direction: column; gap: 14px; margin-top: 4px;
  padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.admin-price-preview img { max-width: 100%; border-radius: 10px; display: block; margin-top: 6px; }
/* Чёткое визуальное разделение блоков «Прайсы» / «Скидки» внутри карточки
   клиента — своя рамка + цветная плашка-заголовок на каждый блок, чтобы их
   нельзя было спутать (по явной просьбе — раньше это были просто два списка
   подряд без разделения). */
.admin-subsection { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-subsection-head { padding: 9px 12px; font-size: 13px; font-weight: 800;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; }
.admin-subsection-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-field-row { display: flex; align-items: center; gap: 8px; }
.admin-field-label { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.admin-client-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.admin-clients-loadmore { align-self: center; }
/* Строка клиента — аккордеон: шапка НАД раскрытым телом (column, не row —
   иначе легли бы рядом, как в .admin-list-item). */
.admin-client-row { display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-client-row-head { padding: 9px 12px; font-size: 13px; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-client-row-head-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-client-row-balance { flex-shrink: 0; font-weight: 700; font-size: 12.5px; color: var(--text); }
.admin-client-row-balance.neg { color: #e5484d; }
.admin-client-row-body { padding: 0 12px 12px; }
/* Открытая строка — акцентная рамка, чтобы видно было, кто сейчас развёрнут
   (один открытый за раз). */
.admin-list-item-open { border-color: var(--accent); }
/* Розница/Опт — фильтр-табы над списком клиентов. */
.admin-kind-tabs { display: flex; gap: 6px; }
.admin-kind-tab { flex: 1; padding: 7px 10px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted);
  cursor: pointer; }
.admin-kind-tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.admin-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--text); cursor: pointer; user-select: none; }
.admin-check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.seg { display: flex; gap: 3px; background: var(--bg); padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.seg button { border: none; background: transparent; color: var(--muted); width: 38px; height: 28px;
  border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 14px; }
.seg button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.sw { width: 46px; height: 27px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg);
  position: relative; cursor: pointer; transition: background .18s; flex-shrink: 0; }
.sw i { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; transition: transform .18s; }
.sw.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.sw.on i { transform: translateX(19px); }

/* ── Поиск ───────────────────────────────────────────── */
.search-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 18px; }
.search-row .search-box { flex: 1; margin-bottom: 0; }
.search-btn { flex-shrink: 0; border: none; border-radius: 14px; padding: 0 18px; cursor: pointer;
  background: linear-gradient(92deg, var(--accent), var(--accent-2)); color: var(--accent-text);
  font-size: 15px; font-weight: 700; font-family: inherit; }
.search-btn:active { transform: scale(.97); }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 14px; padding: 0 14px; margin-bottom: 18px; }
.search-box input { flex: 1; border: none; background: transparent; color: var(--text);
  font-size: 16px; font-family: inherit; padding: 14px 0; outline: none; }
.search-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ── Юр. страницы ────────────────────────────────────── */
.doc { max-width: 720px; margin: 0 auto; padding: 28px 20px 64px; line-height: 1.65; }
.doc h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.doc h2 { font-size: 18px; font-weight: 700; margin-top: 28px; }
.doc a { color: #ff8a93; }
.doc .back { display: inline-block; margin-bottom: 18px; color: #ff8a93; text-decoration: none; font-weight: 600; }
.doc .placeholder { background: rgba(255,200,0,.13); padding: 2px 6px; border-radius: 6px; }
.doc ol { padding-left: 20px; }
.doc ol li { margin: 8px 0; }
/* Бейджи способов оплаты (МИР/Visa/Mastercard) */
.pay-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0 4px; }
.pay-badge { font-size: 12px; font-weight: 800; letter-spacing: .3px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 11px; }

/* ── Steam Gift (игра подарком) ────────────────────────────────────────── */
.sgift-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sgift-row {
  text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: inherit; font: inherit; font-weight: 600;
}
.sgift-row:hover { background: rgba(255,255,255,.09); }
.sgift-body { display: flex; flex-direction: column; gap: 10px; }
.sgift-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sgift-opt {
  padding: 9px 13px; border-radius: 10px; cursor: pointer; font: inherit;
  font-weight: 600; font-size: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: inherit;
}
.sgift-opt.active { background: #ff5964; border-color: #ff5964; color: #fff; }
.sgift-reghead.hidden { display: none; }

/* ── Отзывы + счётчик заказов (соц-доказательство) ───────────────────────── */
.trust-counter { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px;
  background: rgba(52,199,89,.12); border: 1px solid rgba(52,199,89,.35); color: var(--text);
  border-radius: 12px; padding: 8px 14px; font-size: 13.5px; font-weight: 700; }
.trust-counter b { font-weight: 800; }
.trust-check { font-size: 15px; }
.reviews { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 8px; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.review-author { font-weight: 700; font-size: 14px; }
.review-src { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .2px;
  padding: 2px 8px; border-radius: 6px; color: #fff; }
.review-src-avito { background: #0a7d33; }
.review-src-tg { background: #229ed9; }
.review-src-vk { background: #0077ff; }
.review-src-site { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.review-stars { color: #ffb300; font-size: 13px; letter-spacing: 1px; margin-bottom: 5px; }
.review-item { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 5px; }
.review-text { font-size: 13.5px; line-height: 1.45; color: var(--text); }
.review-date { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.reviews-more { display: block; width: 100%; margin-top: 4px; }
/* Лендинг: кнопка «Открыть каталог» */
.landing-cta { margin: 6px 0 22px; }
/* FAQ (низ каталога) — аккордеон */
.faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.faq-q { cursor: pointer; padding: 13px 40px 13px 15px; font-weight: 700; font-size: 14px;
  list-style: none; position: relative; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; position: absolute; right: 15px; top: 12px; color: var(--muted);
  font-weight: 800; font-size: 18px; }
.faq-item[open] .faq-q::after { content: '\2212'; }
.faq-a { padding: 0 15px 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ── Профиль: кнопки, заказы, пагинация ──────────────────────────────────── */
.profile-btn { display: block; width: 100%; margin-top: 12px; }
.orders-box { margin-top: 18px; }
/* Заказ = раскрывающаяся карточка (wrap) — строка-шапка (row) + деталь снизу */
.order-wrap { margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; }
.order-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.order-main { flex: 1; min-width: 0; }
.order-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.order-right { text-align: right; flex-shrink: 0; }
.order-price { font-weight: 800; font-size: 14px; }
.order-status { color: var(--muted); font-size: 12px; margin-top: 3px; }
.order-caret { color: var(--muted); font-size: 18px; flex-shrink: 0; transition: transform .18s ease; }
.order-row.open .order-caret { transform: rotate(90deg); color: var(--accent); }
.order-detail { border-top: 1px solid var(--line); padding: 12px 14px; font-size: 13px; }
.order-detail-line { display: flex; gap: 4px; margin-bottom: 6px; }
.order-detail-label { color: var(--muted); font-weight: 700; }
.order-detail-value { color: var(--text); }
.order-detail-data { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.order-detail-note { color: var(--muted); font-size: 12.5px; }
.orders-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.orders-pageinfo { color: var(--muted); font-size: 13px; font-weight: 700; }

/* ── Аналитика воронки (админ) ───────────────────────────────────────────── */
.analytics-body { display: flex; flex-direction: column; gap: 14px; }
.funnel-table { display: flex; flex-direction: column; gap: 6px; }
.funnel-row { display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.funnel-step { flex: 1; font-size: 13.5px; font-weight: 600; }
.funnel-count { font-weight: 800; font-size: 15px; min-width: 34px; text-align: right; }
.funnel-pct { color: var(--accent); font-weight: 700; font-size: 13px; min-width: 46px; text-align: right; }
.favorites-box { margin-bottom: 6px; }

/* ── Чат с поддержкой ────────────────────────────────────────────────────── */
.support-card { max-width: 520px; display: flex; flex-direction: column; }
.support-list { flex: 1; min-height: 220px; max-height: 52vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 12px; }
.support-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto 10px; line-height: 1.5; }
.support-msg { max-width: 82%; padding: 9px 13px; border-radius: 15px; font-size: 14px; line-height: 1.4;
  word-wrap: break-word; white-space: pre-wrap; }
.support-msg.from-me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-bottom-right-radius: 5px; }
.support-msg.from-admin { align-self: flex-start; background: var(--surface); border: 1px solid var(--line-2);
  color: var(--text); border-bottom-left-radius: 5px; }
.support-input-row { display: flex; gap: 8px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.support-input { flex: 1; resize: none; max-height: 120px; border: 1px solid var(--line-2); border-radius: 13px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 15px; padding: 11px 13px; outline: none; }
.support-input:focus { border-color: var(--accent); }
.support-send { flex-shrink: 0; border: none; border-radius: 13px; width: 46px; height: 46px; cursor: pointer;
  font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.support-send:disabled { opacity: .6; }
.support-attach { flex-shrink: 0; border: 1px solid var(--line-2); border-radius: 13px; width: 46px; height: 46px;
  cursor: pointer; font-size: 18px; background: var(--surface); color: var(--text); }
.support-img { max-width: 220px; max-height: 240px; border-radius: 12px; cursor: pointer; display: block; }
.support-text { margin-top: 6px; }
.support-msg > .support-img + .support-text { margin-top: 6px; }
.support-preview { position: relative; align-self: flex-start; margin: 8px 0 2px; }
.support-preview img { max-width: 120px; max-height: 120px; border-radius: 10px; display: block; }
.support-preview-rm { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #000; color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
/* Красный значок-точка на вкладке (новое сообщение поддержки) */
.tab-badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%;
  background: #ff3b30; margin-left: 8px; }

/* ── Десктоп (ПК): центрируем колонку контента + больше колонок в сетках ──── */
@media (min-width: 900px) {
  /* Полноширинные бары: фон во всю ширину, но контент по центру колонки 900px */
  .topbar { padding-left: max(16px, calc((100% - 900px) / 2));
            padding-right: max(16px, calc((100% - 900px) / 2)); }
  /* Блоки в потоке — центрируем единой колонкой */
  .app, .footer { max-width: 900px; margin-left: auto; margin-right: auto; }
  .hero { max-width: 900px; margin: 16px auto 0; border-radius: 20px; max-height: 300px; }
  .cabinet { max-width: 900px; margin: 14px auto 0; }
  /* Таб-бар: плавающий док по центру, а не растянут во всю ширину экрана */
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: 900px;
            border: 1px solid var(--line); border-bottom: none; border-radius: 18px 18px 0 0; }
  /* Больше колонок: бренд-карточки и подразделы — по 2 в ряд */
  .brand-cards { display: grid; grid-template-columns: repeat(2, 1fr); }
  .subcards { grid-template-columns: repeat(2, 1fr); }
  /* Модалки — по центру экрана как диалог (не нижний лист) */
  .modal { align-items: center; }
  .modal-card { border-radius: 24px; max-height: 86vh; }
  /* Чат поддержки — крупнее на ПК */
  .support-card { max-width: 680px; width: 680px; }
  .support-list { min-height: 420px; max-height: 64vh; }
  /* Ховер-состояния (у ПК есть мышь) */
  .brand-card { transition: transform .14s ease, box-shadow .14s ease; }
  .brand-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
  .subcard:hover, .game-card:hover, .item-row:hover { border-color: var(--accent); }
  .tg-login-btn:hover { filter: brightness(1.07); }
}
/* Широкий десктоп — колонка чуть шире и товары в 4-5 колонок */
@media (min-width: 1200px) {
  .topbar { padding-left: max(16px, calc((100% - 1040px) / 2));
            padding-right: max(16px, calc((100% - 1040px) / 2)); }
  .app, .footer { max-width: 1040px; }
  .hero, .cabinet { max-width: 1040px; }
  .tabbar { max-width: 1040px; }
}
