/* =========================================================================
   playerokcardinal — дизайн-система (playerok-like, SVG-иконки, без эмодзи)
   Мобайл-фёрст, под Telegram WebApp (safe-area).
   ========================================================================= */

:root {
  /* светлая тема (по умолчанию — тёмная, см. ниже) */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #14151a;
  --muted: #8a8f98;
  --muted-2: #b6bac2;
  --border: #e9eaee;

  --primary: #6d5bd0;
  --primary-600: #5a48c2;
  --primary-50: #efedfc;
  --accent: #ff8a3d;

  --success: #1aa86b;
  --success-50: #e2f6ec;
  --warn: #e8920c;
  --warn-50: #fdf1dc;
  --danger: #e5484d;
  --danger-50: #fce9ea;

  --bar-bg: rgba(255, 255, 255, .86);
  --scrim: rgba(16, 17, 22, .5);
  --grad-card: linear-gradient(135deg, #6d5bd0, #8a7be6);

  --shadow-1: 0 1px 2px rgba(20, 21, 26, .06), 0 1px 1px rgba(20, 21, 26, .04);
  --shadow-2: 0 6px 20px rgba(20, 21, 26, .10);
  --shadow-nav: 0 -1px 0 var(--border), 0 -6px 20px rgba(20, 21, 26, .06);

  --nav-h: 60px;
  --topbar-h: 52px;

  --app-width: 560px;

  /* Радиусы — стиль «скруглённый квадрат» (squircle). Но для вкладок-категорий
     (Заказы/Товары) и бейджей используем полностью круглые 999px — это даёт
     мягкую «капсульную» форму, удобную для прокрутки списком. */
  --r-sm: 8px;     /* мелкое: мелкие кнопки, инпуты-числа */
  --r-md: 12px;    /* среднее: карточки-плитки, кнопки, крупные инпуты, иконки */
  --r-lg: 16px;    /* крупное: hero-блоки, шиты */
  --r-card: 14px;  /* основные карточки */
  --r-pill: 999px; /* пилюли/бейджи/вкладки — круглые (капсула) */

  color-scheme: light;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Inter, Arial, sans-serif;
}

/* Тёмная тема — приятная, без чисто-чёрного и жесткого контраста */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141519;
  --surface: #1c1d23;
  --surface-2: #24252e;
  --text: #e8e9ee;
  --muted: #9499a3;
  --muted-2: #6b707a;
  --border: #2a2c35;

  --primary: #8b7ef0;
  --primary-600: #9d92f2;
  --primary-50: #2a2745;
  --accent: #ff9d5c;

  --success: #34c98a;
  --success-50: #1e3a2c;
  --warn: #f0a52e;
  --warn-50: #3a2e18;
  --danger: #f06164;
  --danger-50: #3a2223;

  --bar-bg: rgba(28, 29, 35, .82);
  --scrim: rgba(0, 0, 0, .62);
  --grad-card: linear-gradient(135deg, #7669d8, #9d8af0);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .30);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-nav: 0 -1px 0 var(--border), 0 -6px 20px rgba(0, 0, 0, .40);
}


* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: inherit; }
a { color: var(--primary-600); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- layout ---------- */
#app { min-height: 100%; }
.screen {
  max-width: var(--app-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.screen-root { min-height: 100vh; }
.page {
  flex: 1;
  padding: calc(var(--topbar-h) + 8px + var(--safe-top)) 14px calc(var(--nav-h) + 18px + var(--safe-bottom));
}
.page.no-nav { padding-bottom: 24px; }
.page-head { padding: 6px 2px 12px; }
.page-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.topbar > .inner { max-width: var(--app-width); margin: 0 auto; width: 100%; height: var(--topbar-h); display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.topbar .title { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { color: var(--muted); font-size: 12px; font-weight: 500; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { background: var(--border); }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow-nav);
  padding-bottom: var(--safe-bottom);
}
.tabbar > .inner { max-width: var(--app-width); margin: 0 auto; height: var(--nav-h); display: flex; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted-2); font-size: 10.5px; font-weight: 600; position: relative;
}
.tab .ic { width: 24px; height: 24px; }
.tab.active { color: var(--primary); }
.tab .dot { position: absolute; top: 8px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- cards / sections ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-1); overflow: hidden; }
.card + .card { margin-top: 12px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 2px 8px; }
.pad { padding: 14px; }

/* ---------- list rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface);
  border: 0; border-bottom: 1px solid var(--border); width: 100%; text-align: left;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .subtitle { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row .meta { color: var(--muted-2); font-size: 11.5px; text-align: right; white-space: nowrap; }
.row .meta .strong { color: var(--text); font-weight: 700; font-size: 13px; }

/* avatar */
.avatar { width: 44px; height: 44px; border-radius: var(--r-pill); background: var(--primary-50); color: var(--primary-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: 0 0 auto; overflow: hidden; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .ic { width: 22px; height: 22px; }

/* непрочитанный чат: обводка-кольцо на аватаре + подсветка строки */
.row.unread .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); }
.row.unread .title { font-weight: 800; }
.row.unread .subtitle { color: var(--text); font-weight: 500; }

/* бейдж активной сделки в карточке чата */
.deal-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 5px;
  padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
  background: var(--success-50); color: var(--success);
}
.deal-chip.warn { background: var(--warn-50); color: var(--warn); }
.deal-chip.danger { background: var(--danger-50); color: var(--danger); }
.deal-chip.muted { background: var(--surface-2); color: var(--muted); }
.deal-chip .ic { width: 11px; height: 11px; }

/* Выделение карточки чата с активным заказом — тонкая цветная полоса слева
   (как «в работе» в плейроке). Не перекрывает unread/pinned/blocked состояния. */
/* Фиолетовая обводка карточки/плашки с активным заказом убрана по просьбе —
   плашка заказа в строке остаётся, но без цветного выделения самой строки. */

/* Плашка активного заказа в шапке диалога (п.5): товар + цена + статус, клик
   → страница заказа /orders/:id с кнопками «Подтвердить»/«Возврат». */
.deal-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 12px; padding: 10px 12px; border-radius: var(--r-card, 14px);
  background: var(--primary-50); border: 1.5px solid var(--primary);
  cursor: pointer; position: relative;
}
.deal-banner:active { transform: scale(.99); }
.deal-banner .db-thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); }
.deal-banner .db-ph { width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--primary); }
.deal-banner .db-ph .ic { width: 18px; height: 18px; }
.deal-banner .db-main { min-width: 0; flex: 1 1 auto; }
.deal-banner .db-title { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-banner .db-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.deal-banner .db-price { font-size: 15px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.deal-banner .db-status { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); background: var(--warn-50); color: var(--warn); }
.deal-banner .db-status.s-paid { background: var(--warn-50); color: var(--warn); }
.deal-banner .db-status.s-pending { background: var(--warn-50); color: var(--warn); }
.deal-banner .db-status.s-sent { background: var(--success-50); color: var(--success); }
.deal-banner .db-chev { color: var(--muted); flex: 0 0 auto; }
.deal-banner .db-chev .ic { width: 16px; height: 16px; }

/* Несколько активных заказов в одном чате: горизонтальный скролл-список плашек.
   Каждая плашка кликабельна → свой /orders/:id. Активная (последняя открытая)
   подсвечена сильнее. Снизу — счётчик «N активных заказа». */
.deal-banners { position: relative; }
.db-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 2px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.db-strip::-webkit-scrollbar { display: none; }
.deal-banner.mini {
  flex: 0 0 78%; max-width: 320px; margin: 0; scroll-snap-align: start;
  border-width: 1px; padding: 8px 10px; gap: 8px;
}
.deal-banner.mini .db-thumb,
.deal-banner.mini .db-ph { width: 32px; height: 32px; border-radius: 8px; }
.deal-banner.mini .db-title { font-size: 12.5px; }
.deal-banner.mini .db-sub { font-size: 11px; }
.deal-banner.mini .db-price { font-size: 13px; }
.deal-banner.mini .db-chev .ic { width: 14px; height: 14px; }
.deal-banner.mini.active {
  border-color: var(--primary); border-width: 2px;
  box-shadow: 0 0 0 2px var(--primary-50);
}
.db-count {
  font-size: 11px; color: var(--muted); text-align: center;
  padding: 4px 0 2px; font-weight: 600;
}

/* Ссылки в сообщениях: выделение цветом + подчёркивание, открытие в новой вкладке.
   На своих (синих) бабблах — светлее, чтобы читалось на цветном фоне. */
.msg-link {
  color: var(--primary-600); text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all; font-weight: 500;
}
.msg.own .bubble .msg-link { color: #fff; text-decoration: underline dashed rgba(255,255,255,.7); }
.msg.sys .bubble .msg-link { color: var(--primary-600); }

/* Превью сообщения в bottom-sheet действий (обрезанный текст выбранного сообщения). */
.msg-action-preview {
  margin: 8px 0 0; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); white-space: pre-wrap;
  word-break: break-word; max-height: 80px; overflow: hidden;
  -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical;
}

/* Long-press фидбэк: лёгкое затемнение bubble при удержании (touch). */
.msg .bubble { transition: background .15s; -webkit-user-select: text; user-select: text; }
.msg .bubble a { -webkit-user-select: text; }

/* рейтинг покупателя под именем */
.peer-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.peer-rating .ic { width: 12px; height: 12px; color: #f5a623; }
.peer-rating .rev { color: var(--muted-2); font-weight: 500; }

/* ведущая иконка строки (сквиркл, без «эмози-аватара») */
.row-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.row-ic .ic { width: 18px; height: 18px; }
.row-ic.accent { background: var(--primary-50); color: var(--primary-600); }
.row-ic.success { background: var(--success-50); color: var(--success); }
.row-ic.warn { background: var(--warn-50); color: var(--warn); }
.row-ic.danger { background: var(--danger-50); color: var(--danger); }

/* ---------- дашборд-плитки ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-tile {
  padding: 13px 14px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.dash-tile .dt-ic { position: absolute; right: -6px; bottom: -8px; width: 46px; height: 46px; opacity: .07; }
.dash-tile .dt-ic .ic { width: 46px; height: 46px; }
.dash-tile .dt-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dash-tile .dt-value { font-size: 22px; font-weight: 800; margin-top: 3px; letter-spacing: -.02em; }
.dash-tile .dt-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
.dash-tile.accent { background: var(--grad-card); border-color: transparent; color: #fff; }
.dash-tile.accent .dt-label, .dash-tile.accent .dt-sub { color: rgba(255,255,255,.85); }
.dash-tile.accent .dt-ic { opacity: .16; color: #fff; }
.dash-tile.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.dash-tile.success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); }

/* ---------- swipe-to-action на строке ---------- */
.swipe-wrap { position: relative; overflow: hidden; }
.swipe-bg {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 16px;
  color: var(--primary-600); font-weight: 700; font-size: 13px; gap: 6px;
  opacity: 0; transition: opacity .12s;
}
.swipe-bg.show { opacity: 1; }
.swipe-body { position: relative; background: var(--surface); transition: transform .18s ease; will-change: transform; }

/* ---------- pull-to-refresh ---------- */
.ptr { position: relative; }
.ptr-indicator {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -100%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: opacity .15s; z-index: 5; opacity: 0;
}
.ptr-indicator .spinner { width: 18px; height: 18px; border-width: 2px; }
.ptr-indicator .ic { width: 18px; height: 18px; transition: transform .15s; }
.ptr.armed .ptr-indicator { opacity: 1; }
.ptr.refreshing .ptr-indicator { opacity: 1; }

/* ---------- поиск в списках ---------- */
.search-bar { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.search-bar .field-wrap { position: relative; flex: 1; }
.search-bar .input { padding-left: 38px; }
.search-bar .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.search-bar .clr { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface-2); }
.search-bar .clr .ic { width: 13px; height: 13px; }
.search-count { color: var(--muted); font-size: 12px; padding: 0 2px 8px; }

/* миниатюра картинки товара */
.thumb { width: 46px; height: 46px; border-radius: 11px; background: var(--surface-2); object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); }
.thumb-ph { width: 46px; height: 46px; border-radius: 11px; background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-weight: 700; font-size: 15px; }

/* badges / chips */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; line-height: 1.2; }
.badge .ic { width: 12px; height: 12px; }
.b-success { background: var(--success-50); color: var(--success); }
.b-warn { background: var(--warn-50); color: var(--warn); }
.b-danger { background: var(--danger-50); color: var(--danger); }
.b-muted { background: var(--surface-2); color: var(--muted); }
.b-primary { background: var(--primary-50); color: var(--primary-600); }

.dot-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* status pill */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-paid { color: var(--success); }
.s-pending { color: var(--warn); }
.s-sent { color: #6a5ae0; }
.s-confirmed { color: var(--success); }
.s-rolled { color: var(--danger); }
.s-problem { color: var(--danger); }

/* миниатюра ТОВАРА в строке заказа (квадратная, с обрезкой cover) */
.avatar.thumb { border-radius: var(--r-md); object-fit: cover; padding: 0 !important; background: var(--surface-2); color: var(--muted); border: none; }
.avatar.thumb .ic { width: 18px; height: 18px; }

/* inline-звёзды рейтинга в строке списка заказов (после статуса) */
.stars-inline { margin-left: 6px; color: #f0a52e; font-weight: 700; }

/* крупные звёзды в карточке отзыва покупателя */
.stars-big { display: inline-flex; gap: 2px; font-size: 18px; color: #f0a52e; line-height: 1; }
.stars-big .star.off { color: var(--surface-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: var(--r-md); font-weight: 700; font-size: 14.5px; transition: filter .12s, background .12s; }
.btn:active { filter: brightness(.96); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-dark { background: var(--text); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }

/* ---------- tabs ---------- */
/* Вкладки-категории (Заказы/Товары): округлая «капсула» с фоном, вкладки
   скруглены (999px), не вмещаются → горизонтальная прокрутка (scroll-snap),
   без видимого скроллбара. Активная — залита основным цветом. */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab-pill { flex: 0 0 auto; scroll-snap-align: start; text-align: center; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; background: transparent; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
.tab-pill:active { background: var(--surface); }
.tab-pill.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); outline: none; }
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 84px; }

/* ---------- skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--r-sm); }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-row { display: flex; gap: 12px; padding: 12px 14px; }
.skel-row .skel.av { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; }
.skel-row .skel.ln { height: 12px; margin-bottom: 6px; }

/* spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--primary); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- empty / error ---------- */
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 10px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + var(--safe-bottom)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 90%; padding: 11px 16px; border-radius: var(--r-pill); background: var(--text); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-2); animation: tin .2s ease; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--success); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- live-уведомления (новые сообщения/действия) ---------- */
.live-wrap {
  position: fixed; left: 0; right: 0; top: calc(var(--safe-top) + 8px); z-index: 75;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 12px;
}
.live-card {
  width: 100%; max-width: 440px; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-2); overflow: hidden; cursor: pointer;
  animation: liveIn .32s cubic-bezier(.22,1,.36,1);
  transition: transform .15s ease;
}
.live-card:active { transform: scale(.985); }
.live-card.leaving { animation: liveOut .28s ease forwards; }
@keyframes liveIn { from { transform: translateY(-18px); opacity: 0; } }
@keyframes liveOut { to { transform: translateY(-18px); opacity: 0; } }
.live-body { display: flex; gap: 10px; padding: 11px 12px 9px; align-items: flex-start; }
.live-body .avatar { width: 38px; height: 38px; font-size: 14px; flex: 0 0 auto; }
.live-body .avatar img { width: 100%; height: 100%; object-fit: cover; }
.live-main { flex: 1; min-width: 0; }
.live-top { display: flex; align-items: center; gap: 6px; }
.live-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.live-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-pill); background: var(--primary-50); color: var(--primary-600); flex: 0 0 auto; text-transform: uppercase; letter-spacing: .02em; }
.live-tag.danger { background: var(--danger-50); color: var(--danger); }
.live-tag.warn { background: var(--warn-50); color: var(--warn); }
.live-tag.success { background: var(--success-50); color: var(--success); }

/* Непрочитанные уведомления: лёгкая подсветка строки + точка-индикатор.
   Прочитанные (time <= lastSeenNotifAt) — обычный вид, не «светятся». */
.notif-row.unread { background: var(--primary-50); }
.notif-row.unread .title { color: var(--text); }
.unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--primary); display: block; margin: 0 0 4px auto; box-shadow: 0 0 0 3px var(--primary-50); }
.live-text { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.live-close { width: 26px; height: 26px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; color: var(--muted-2); flex: 0 0 auto; }
.live-close .ic { width: 14px; height: 14px; }
.live-bar { height: 3px; background: var(--border); position: relative; overflow: hidden; }
.live-bar::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: var(--primary); transform-origin: left center;
  animation: liveBar 3s linear forwards;
}
.live-card.success .live-bar::after { background: var(--success); }
.live-card.danger .live-bar::after { background: var(--danger); }
.live-card.warn .live-bar::after { background: var(--warn); }
@keyframes liveBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- тариф-карточки подписки ---------- */
.plan-card {
  position: relative; text-align: left; padding: 14px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.plan-card:active { transform: scale(.98); }
.plan-card.selected { border-color: var(--primary); background: var(--primary-50); }
.plan-card .ribbon { position: absolute; top: -8px; right: 12px; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--r-pill); background: var(--primary); color: #fff; text-transform: uppercase; letter-spacing: .03em; }
.plan-card .pt { font-weight: 700; font-size: 15px; }
.plan-card .pd { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.plan-card .pp { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.plan-card .pp .v { font-weight: 800; font-size: 20px; }
.plan-card .pp .cur { color: var(--muted); font-size: 13px; font-weight: 600; }
.plan-card .pp .old { color: var(--muted-2); font-size: 12.5px; text-decoration: line-through; }
.plan-card .pc { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; color: transparent; }
.plan-card.selected .pc { background: var(--primary); border-color: var(--primary); color: #fff; }
.plan-card.selected .pc .ic { width: 13px; height: 13px; }

/* выбор способа оплаты */
.pay-method {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; width: 100%; text-align: left;
  transition: border-color .15s, background .15s, transform .12s;
}
.pay-method:active { transform: scale(.98); }
.pay-method.selected { border-color: var(--primary); background: var(--primary-50); }
.pay-method .pm-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pay-method.selected .pm-ic { background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--primary-600); }
.pay-method .pm-ic .ic { width: 19px; height: 19px; }
.pay-method .pm-main { flex: 1; min-width: 0; }
.pay-method .pm-t { font-weight: 700; font-size: 14px; }
.pay-method .pm-s { color: var(--muted); font-size: 12px; margin-top: 1px; }
.pay-method .pm-check { width: 20px; height: 20px; color: var(--primary); flex: 0 0 auto; visibility: hidden; }
.pay-method.selected .pm-check { visibility: visible; }

/* ---------- Playerok onboarding / восстановление аккаунта ---------- */
.onboarding-screen { position: relative; isolation: isolate; }
.onboarding-screen::before {
  content: ""; position: fixed; z-index: -1; top: calc(-90px + var(--safe-top)); left: 50%;
  width: min(620px, 130vw); height: 330px; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 68%);
  pointer-events: none;
}
.onboard-page { width: 100%; max-width: 470px; margin: 0 auto; padding-top: calc(var(--topbar-h) + 24px + var(--safe-top)); }
.onboard-hero { text-align: center; padding: 4px 12px 20px; }
.onboard-hero-icon {
  width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--grad-card); box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 30%, transparent);
  transform: rotate(-3deg);
}
.onboard-hero-icon.is-danger { background: linear-gradient(145deg, #ef666a, #c9343a); box-shadow: 0 14px 34px color-mix(in srgb, var(--danger) 28%, transparent); }
.onboard-hero-icon .ic { width: 29px; height: 29px; stroke-width: 1.8; transform: rotate(3deg); }
.onboard-step-label { color: var(--primary-600); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.onboard-hero h2 { margin: 5px 0 4px; font-size: 24px; line-height: 1.18; letter-spacing: -.035em; }
.onboard-hero p { max-width: 370px; margin: 0 auto; color: var(--muted); font-size: 13.5px; }
.onboard-progress { width: 118px; height: 4px; margin: 14px auto 0; background: var(--border); border-radius: var(--r-pill); overflow: hidden; }
.onboard-progress span { display: block; height: 100%; border-radius: inherit; background: var(--grad-card); transition: width .35s cubic-bezier(.2,.8,.2,1); }

.onboard-alert {
  display: flex; align-items: flex-start; gap: 11px; margin: 0 0 12px; padding: 12px 13px;
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1);
}
.onboard-alert-danger { border-color: color-mix(in srgb, var(--danger) 34%, var(--border)); background: color-mix(in srgb, var(--danger-50) 72%, var(--surface)); }
.onboard-alert-icon { width: 34px; height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 11px; color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.onboard-alert-icon .ic { width: 18px; height: 18px; }
.onboard-alert b, .onboard-alert small { display: block; }
.onboard-alert b { font-size: 13.5px; line-height: 1.25; }
.onboard-alert small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.onboard-card { max-width: 440px; margin: 0 auto; padding: 16px; border-radius: 20px; box-shadow: 0 18px 50px rgba(12, 13, 18, .10); overflow: visible; }
:root[data-theme="dark"] .onboard-card { box-shadow: 0 20px 52px rgba(0, 0, 0, .34); }
.onboard-card .field { margin-bottom: 14px; }
.onboard-card .field label { margin-bottom: 7px; color: var(--text); font-size: 12px; font-weight: 750; }
.onboard-card .input { min-height: 48px; border-radius: 13px; background: var(--surface-2); transition: border-color .16s, box-shadow .16s, background .16s; }
.onboard-card textarea.input { min-height: 96px; }
.onboard-card .input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.profile-avatar-editor { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; padding: 12px; border: 1px dashed color-mix(in srgb, var(--primary) 42%, var(--border)); border-radius: 16px; background: color-mix(in srgb, var(--primary-50) 40%, var(--surface)); }
.profile-avatar-editor > div:last-child { flex: 1; min-width: 0; }
.profile-avatar-editor b, .profile-avatar-editor small { display: block; }
.profile-avatar-editor b { font-size: 13.5px; }
.profile-avatar-editor small { margin-top: 3px; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-pick { width: 68px; height: 68px; flex: 0 0 auto; position: relative; display: flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--primary-600); background: var(--surface); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border), var(--shadow-1); overflow: visible; }
.profile-avatar-pick > .ic { width: 25px; height: 25px; }
.profile-avatar-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.profile-avatar-pick i { position: absolute; right: -3px; bottom: -3px; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: #fff; background: var(--primary); box-shadow: 0 0 0 3px var(--surface); font-style: normal; }
.profile-avatar-pick i .ic { width: 13px; height: 13px; }
.username-check { min-height: 18px; display: flex; align-items: center; gap: 6px; margin: -6px 2px 12px; color: var(--muted); font-size: 11.5px; }
.username-check > span:first-child { display: inline-flex; flex: 0 0 auto; }
.username-check .ic { width: 14px; height: 14px; }
.username-check .spinner { width: 13px; height: 13px; }
.username-check.free { color: var(--success); font-weight: 650; }
.username-check.taken { color: var(--danger); font-weight: 650; }
.btn-onboard { min-height: 48px; border-radius: 14px; box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 22%, transparent); }
.btn-link { color: var(--muted); background: transparent; font-size: 13px; }
.btn-link:active { color: var(--text); background: var(--surface-2); }

.proxy-ready-card { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--success) 38%, var(--border)); border-radius: 15px; background: color-mix(in srgb, var(--success-50) 72%, var(--surface)); }
.proxy-ready-card > span:nth-child(2) { flex: 1; min-width: 0; }
.proxy-ready-card b, .proxy-ready-card small { display: block; }
.proxy-ready-card b { font-size: 13.5px; }
.proxy-ready-card small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.proxy-ready-icon { width: 38px; height: 38px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.proxy-ready-icon .ic { width: 20px; height: 20px; }
.proxy-ready-check { color: var(--success); }
.proxy-ready-check .ic { width: 19px; height: 19px; stroke-width: 2.5; }

.flow-choice-list { display: flex; flex-direction: column; gap: 10px; }
.flow-choice { min-height: 76px; padding: 14px; border-radius: 16px; border-width: 1px; position: relative; overflow: hidden; }
.flow-choice::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); opacity: 0; transition: opacity .16s; }
.flow-choice:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: color-mix(in srgb, var(--primary-50) 45%, var(--surface)); }
.flow-choice:hover::before { opacity: 1; }
.flow-choice .pm-ic { width: 46px; height: 46px; border-radius: 14px; color: var(--primary-600); background: var(--primary-50); }
.flow-choice .pm-ic .ic { width: 22px; height: 22px; }
.flow-choice .pm-t { font-size: 15px; letter-spacing: -.01em; }
.flow-choice .pm-s { margin-top: 3px; line-height: 1.25; }
.flow-register .pm-ic { color: var(--success); background: var(--success-50); }
.flow-arrow { color: var(--muted-2); display: flex; }
.flow-arrow .ic { width: 19px; height: 19px; }
.onboard-safe-note { display: flex; align-items: flex-start; gap: 7px; margin: 13px 2px 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.onboard-safe-note .ic { width: 14px; height: 14px; flex: 0 0 auto; color: var(--success); margin-top: 1px; }
.tg-code-help { margin: 12px 3px 4px; font-size: 11.5px; line-height: 1.4; text-align: center; }

.onboard-error { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border)); border-radius: 14px; color: var(--danger); background: color-mix(in srgb, var(--danger-50) 72%, var(--surface)); }
.onboard-error-icon { width: 30px; height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, transparent); }
.onboard-error-icon .ic { width: 16px; height: 16px; }
.onboard-error-main { flex: 1; min-width: 0; }
.onboard-error-main b, .onboard-error-main span { display: block; }
.onboard-error-main b { font-size: 12.5px; }
.onboard-error-main span { margin-top: 2px; color: var(--text); font-size: 12px; line-height: 1.35; }
.onboard-error > .btn { flex: 0 0 100%; margin-top: 0; }

@media (max-width: 380px) {
  .onboard-page { padding-left: 11px; padding-right: 11px; }
  .onboard-hero { padding-bottom: 16px; }
  .onboard-hero-icon { width: 58px; height: 58px; border-radius: 19px; }
  .onboard-card { padding: 13px; border-radius: 17px; }
  .flow-choice { min-height: 70px; padding: 11px; }
}

/* ---------- индикатор WS-соединения ---------- */
.ws-offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  padding: 7px 12px; padding-top: calc(7px + var(--safe-top));
  text-align: center; font-size: 12.5px; font-weight: 600; color: #fff;
  background: var(--warn); cursor: pointer;
  animation: liveIn .25s ease;
}
.ws-offline .ws-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: middle; animation: wsBlink 1s ease infinite; }
@keyframes wsBlink { 50% { opacity: .35; } }
.bell-dot { position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--surface); }
/* «Горящий» колокольчик: когда есть уведомления, точка мягко пульсирует,
   а иконка слегка качается — привлекает внимание к разделу «Уведомления». */
.bell-dot { animation: bell-pulse 1.8s ease-in-out infinite; }
@keyframes bell-pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229,72,77,.45); } 50% { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(229,72,77,0); } }
.bell-wrap:has(.bell-dot) :is(svg, .ic) { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%,80%,100% { transform: rotate(0); } 85% { transform: rotate(12deg); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(8deg); } }

/* ---------- баннер истечения подписки ---------- */
.sub-banner {
  position: fixed; left: 0; right: 0; top: calc(var(--safe-top) + 8px); z-index: 55;
  display: flex; justify-content: center; padding: 0 12px;
  pointer-events: none;
}
.sub-banner .inner {
  pointer-events: auto; width: 100%; max-width: var(--app-width);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; box-shadow: var(--shadow-2);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border));
  animation: liveIn .3s cubic-bezier(.22,1,.36,1);
}
.sub-banner.danger .inner {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
}
.sub-banner .icw { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.sub-banner.danger .icw { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.sub-banner .icw .ic { width: 18px; height: 18px; }
.sub-banner .txt { flex: 1; min-width: 0; }
.sub-banner .txt .t { font-weight: 700; font-size: 13.5px; }
.sub-banner .txt .s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.sub-banner .btn { padding: 8px 14px; font-size: 13px; }
.sub-banner-close { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: transparent; border: 0; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin-left: 2px; }
.sub-banner-close .ic { width: 16px; height: 16px; }
.sub-banner-close:active { background: var(--surface-2); }
.sub-countdown { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; letter-spacing: .02em; color: var(--primary); margin-top: 6px; }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--app-width); background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-bottom)); animation: up .22s ease; }
.sheet h3 { font-size: 17px; margin: 8px 0 4px; }
@keyframes up { from { transform: translateY(100%); } }

/* ---------- chat ---------- */
.chat-list { }
.msgs { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 6px; }
.msg { display: flex; }
.msg-inner { display: flex; flex-direction: column; max-width: 86%; }
.msg .bubble { max-width: 100%; padding: 8px 12px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-1); }
.msg.own .msg-inner { align-items: flex-end; margin-left: auto; }
.msg.own { justify-content: flex-end; }
.msg.own .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg.other .bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.sys { justify-content: center; }
.msg.sys .bubble { background: var(--surface-2); color: var(--muted); font-size: 12.5px; box-shadow: none; max-width: 92%; text-align: center; }
.msg .time { font-size: 10.5px; color: var(--muted-2); margin: 2px 4px; }
/* Компактная кнопка «копировать» под баблом: маленькая, полупрозрачная, не
   мешает чтению. Появляется под каждым несистемным сообщением. */
.msg-copy {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: flex-start; gap: 4px;
  margin: 2px 2px 4px; padding: 3px 8px; min-height: 22px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--muted-2); font-size: 11px; cursor: pointer;
  opacity: .55; transition: opacity .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.msg-copy .ic { width: 13px; height: 13px; }
.msg-copy:hover { opacity: 1; background: var(--surface-2); }
.msg-copy:active { opacity: 1; background: var(--surface-2); transform: scale(.94); }
.msg.own .msg-copy { align-self: flex-end; }
.msg.own .time { text-align: right; }
/* Подсветка сообщения при переходе из уведомления (?msg=ID): жёлтая рамка/
   фон на ~1.2с, плавно затухает. Применяется к .msg[data-msg-id]. */
.msg.msg-highlight .bubble { animation: msg-flash 1.2s ease-out; }
@keyframes msg-flash {
  0% { box-shadow: 0 0 0 3px var(--warn); background: var(--warn-50); }
  70% { box-shadow: 0 0 0 3px var(--warn); background: var(--warn-50); }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}
.msg.msg-highlight.own .bubble { animation-name: msg-flash-own; }
@keyframes msg-flash-own {
  0%, 70% { box-shadow: 0 0 0 3px var(--warn); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding: 8px 10px calc(8px + var(--safe-bottom)); }
.composer .inner { max-width: var(--app-width); margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; max-height: 120px; min-height: 42px; padding: 11px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); resize: none; outline: none; }
.composer .send { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.composer .send[disabled] { background: var(--border); color: var(--muted); }

/* ---------- deal / item cards ---------- */
.kv { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.price { font-weight: 800; }
.price .cur { color: var(--muted); font-weight: 600; }

/* utility */
.muted { color: var(--muted); }
.rowgap { display: flex; flex-direction: column; gap: 12px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}
.right{ text-align:right } .nowrap{white-space:nowrap}
.h-divider { height:1px; background: var(--border); margin: 4px 0; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.fade-enter-active, .fade-leave-active { transition: opacity .15s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ---------- переключатель темы ---------- */
.theme-toggle {
  position: fixed; right: 14px; top: calc(var(--safe-top) + 8px); z-index: 50;
  width: 38px; height: 38px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  box-shadow: var(--shadow-1);
}
.theme-toggle .ic { width: 20px; height: 20px; }
.theme-toggle:active { transform: scale(.94); }
/* на десктопе убираем поверх topbar — ставим правее */
@media (min-width: 820px) { .theme-toggle { right: calc(50% - var(--app-width)/2 + 14px); } }

/* ---------- адаптив: планшет / десктоп ----------
   Стратегия: телефон (по умолчанию) — узкая колонка, всё в 1 столбец;
   планшет (768+) — шире контейнер + лёгкое увеличение типографики;
   десктоп (1100+) — ещё шире, фон с градиентом, сетка для карточек-списков;
   большой десктоп (1500+) — максимум ширины.
   Сетка не ломает мобильный вид: правила применяются только на широких.
   Переходы плавные (изменения --app-width и padding), т.к. всё на var(). */
@media (min-width: 768px) {
  :root { --app-width: 720px; }
  .page { padding-left: 18px; padding-right: 18px; }
  .topbar .title { font-size: 17.5px; }
  .row .title { font-size: 15px; }
  .row .subtitle { font-size: 13.5px; }
  .section-title { font-size: 13.5px; }
}
@media (min-width: 1100px) {
  :root { --app-width: 920px; }
  body { background: var(--bg); background-image: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%); background-attachment: fixed; }
  .page { padding-left: 24px; padding-right: 24px; }
  .topbar .title { font-size: 18.5px; }
  .row .title { font-size: 15.5px; }
  /* Сетка для обобщённых списков: .card с .item-row превращается в плитки.
     Работает для Товаров; для других списков карточка остаётся одним блоком
     (там внутри логически один список). Сетка — только на широком экране,
     на мобильном — прежний вертикальный список с разделителями. */
  .card.items-grid,
  .items-grid > .card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; }
  /* строки-плитки: убираем нижний разделитель, рисуем полноценные карточки */
  .items-grid .item-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    margin-bottom: 8px;
    overflow: hidden;
  }
  .items-grid .item-row:last-child { margin-bottom: 0; }
  .items-grid .item-row .item-row-main { border-bottom: 0; }
}
@media (min-width: 1500px) {
  :root { --app-width: 1080px; }
  .card.items-grid,
  .items-grid > .card { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .items-grid .item-row { margin-bottom: 0; }
}

/* на широких экранах колонку центрируем (привычный desktop-вид) */
@media (min-width: 1100px) {
  .screen, .topbar > .inner, .tabbar > .inner, .composer > .inner { margin-left: auto; margin-right: auto; }
}

/* тонкие скроллбары */
@media (pointer: fine) {
  *::-webkit-scrollbar { width: 9px; height: 9px; }
  *::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
  *::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- плавный переход темы ---------- */
body, .card, .topbar, .tabbar, .composer, .row, .input, textarea.input, .btn,
.icon-btn, .switch .track, .sheet, .tab-pill, .badge, .kv, .setting-row,
.country-btn, .theme-toggle, .input-mini, select.input, .msg .bubble, .avatar,
.overlay, .empty {
  transition: background-color .26s ease, border-color .26s ease, color .26s ease, background .26s ease;
}

/* микроклик/нажатие */
.btn, .icon-btn, .tab, .tab-pill, .country-btn, .row, .brand-logo {
  transition: transform .12s ease, filter .12s ease, background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn:active, .icon-btn:active, .tab:active, .country-btn:active, .brand-logo:active { transform: scale(.96); }

/* ---------- лого бренда: текст Cardinal с градиентной молнией ---------- */
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.brand-mark {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--grad-card);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 42%, transparent);
}
.brand-mark .ic { width: 34px; height: 34px; }
.brand-wordmark {
  font-weight: 800; font-size: 30px; letter-spacing: -.03em; line-height: 1;
  background: linear-gradient(120deg, var(--text), color-mix(in srgb, var(--primary) 75%, var(--text)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-tag { color: var(--muted); font-size: 13.5px; text-align: center; }

/* старый класс brand-logo оставляем для совместимости (используется в редких местах) */
.brand-logo {
  width: 78px; height: 78px; border-radius: 22px;
  background: var(--grad-card);
  color: #fff; font-weight: 800; font-size: 36px; letter-spacing: -.03em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 38%, transparent);
}

/* ---------- плавная смена экранов ---------- */
.page-enter-active { transition: opacity .2s ease, transform .2s ease; }
.page-leave-active { transition: opacity .12s ease; }
.page-enter-from { opacity: 0; transform: translateY(8px); }
.page-leave-to { opacity: 0; }

/* switch / toggle — мягкий «круглый» переключатель */
.switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; border: 0; padding: 0; cursor: pointer; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .18s ease; }
.switch .thumb { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s cubic-bezier(.4,.0,.2,1); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track + .thumb { transform: translateX(20px); }
/* Переключатель без нативного input (компонент Toggle): состояние по классу .on.
   Дублирует правила выше, чтобы старые <label class=switch> и новые <button class=switch>
   смотрелись одинаково. */
.switch.on .track { background: var(--primary); }
.switch.on .thumb { transform: translateX(20px); }
.switch:active .thumb { width: 26px; }  /* лёгкое «растекание» при нажатии */
.switch:focus-visible .track { outline: 2px solid var(--primary); outline-offset: 2px; }

.setting-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .main { flex: 1; min-width: 0; }
.setting-row .title { font-weight: 600; font-size: 14.5px; }
.setting-row .subtitle { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.input-mini { width: 80px; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--r-sm); text-align: right; }
.input-mini:disabled { opacity: .5; }

/* утилиты для экранов «Функции» */
.mt4 { margin-top: 4px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { cursor: default; font-size: 12px; padding: 4px 10px; }
.card.disabled, .setting-row.disabled { opacity: .55; pointer-events: none; }
.setting-row.disabled .switch { pointer-events: auto; } /* тоггл внутри отключён через :disabled компонента */

/* Строки-чекбоксы (выбор товаров в Автоподнятия/Автовосстановление) */
.check-row { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; }
.check-row.on { background: var(--primary-50); }
.check { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; color: #fff; transition: background .12s, border-color .12s; }
.check-row.on .check, .check.on { background: var(--primary); border-color: var(--primary); }
.check svg { width: 14px; height: 14px; }

/* Сегментированный выбор (интервал автоподнятия) */
.seg-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.seg { padding: 9px 4px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; text-align: center; }
.seg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.seg.disabled { opacity: .5; cursor: not-allowed; }
.custom-int { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.custom-int.disabled { opacity: .5; pointer-events: none; }
.custom-int-input { display: flex; align-items: center; gap: 8px; }
.custom-int-input .input { width: 90px; text-align: center; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }

/* Быстрые ответы: счётчик символов под полем */
.counter { margin-top: 4px; font-size: 11px; color: var(--muted); text-align: right; }
.counter.over { color: var(--danger); font-weight: 700; }

/* Тексты бота: подсказка по переменным + подсветка целевого шаблона */
.msg-hint { background: var(--surface-2); }
.msg-hint-title { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.msg-hint-title svg { width: 16px; height: 16px; color: var(--primary); }
.msg-hint-grid { display: grid; grid-template-columns: 1fr; gap: 5px; }
.msg-hint-grid code { background: var(--surface); }
.msg-card.focus { box-shadow: 0 0 0 2px var(--primary); }

.country-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.country-btn { padding: 12px 8px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-weight: 600; font-size: 13px; text-align: center; position: relative; }
.country-btn.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
/* Купленная страна: статическая зелёная подсветка (1 прокси = 1 страна). */
.country-btn.owned { border-color: var(--success); background: rgba(26,168,107,.12); color: var(--success); box-shadow: 0 0 0 1px var(--success) inset; }
.country-btn.owned .owned-check { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; display: inline-flex; }
.country-btn.owned .owned-check .ic { width: 14px; height: 14px; }
.country-btn.locked { opacity: .5; cursor: not-allowed; }
.country-btn.locked:active { transform: none; }

/* Колокольчик в шапке профиля: обёртка нужна, чтобы бейдж непрочитанных не
   «съезжал» с иконки (раньше position:relative стоял inline и ломал позицию). */
.icon-btn.bell-wrap { position: relative; }

/* Карточка статуса прокси: активный — с зелёным акцентом, истёкший — с красным.
   Плавная смена акцента при переходе жив→истёк и наоборот. */
.card.proxy-card { transition: border-color .25s ease, box-shadow .25s ease; }
.card.proxy-active { border-color: var(--success); box-shadow: 0 0 0 1px var(--success) inset; }
.card.proxy-expired { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.proxy-countdown { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.proxy-countdown .pc-clock { display: inline-flex; color: var(--success); }
.proxy-countdown .pc-clock .ic { width: 22px; height: 22px; }
.proxy-countdown .pc-info { min-width: 0; }
.proxy-countdown .pc-time { font-weight: 800; font-size: 18px; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--success); }
.proxy-countdown .pc-time.soon { color: var(--warn); }
.proxy-countdown .pc-label { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Модалка смены прокси: warn-иконка (amber) + компактная сетка стран внутри
   sheet. Анимация появления/ухода — стандартная sheet-fade + sheet-up. */
.sheet-ic.sheet-ic-warn { background: var(--warn-50); color: var(--warn); }
.proxy-change-sheet { max-width: 480px; }
.country-grid-compact { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.country-grid-compact .country-btn { padding: 9px 6px; font-size: 12px; }
/* Сегментированный переключатель «блоком» (2 опции рядом) для режима смены. */
.seg-block { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; border: none; background: transparent; }
.seg-block .seg-btn { padding: 11px 8px; border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .12s; text-align: center; }
.seg-block .seg-btn:active { transform: scale(.97); }
.seg-block .seg-btn.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); }

/* Обратный отсчёт в списке уведомлений профиля (колокольчик). */
.notif-ttl { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.notif-ttl .ttl-clock { display: none; }
.notif-ttl .ttl-time { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.notif-ttl.soon .ttl-time { color: var(--warn); }


/* Галерея фото товара (карточка /items/[id]). */
.item-gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main { width: 100%; aspect-ratio: 1 / 1; max-height: 360px; background: var(--surface-2); border-radius: var(--r-md); overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.gallery-img { width: 100%; height: 100%; object-fit: contain; }
.gallery-ph { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; }
.gallery-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb { position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; background: var(--surface-2); padding: 0; cursor: pointer; }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb .thumb-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.gallery-thumb .thumb-del:disabled { opacity: .5; cursor: wait; }
.gallery-thumb .thumb-del svg { width: 11px; height: 11px; }

/* Список чатов: chip-фильтры (Все/Непрочитанные/Активные) — ОДНОЙ строкой,
   прижаты вплотную к левому краю (padding-left:0). Если не влезают —
   горизонтальный скролл (без переноса на новую строку). */
.chips-bar { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; padding: 6px 0 8px; margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chips-bar::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary); }
.chip-count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; align-items: center; justify-content: center; background: var(--border); color: var(--text); border-radius: 9px; font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.chip.active .chip-count { background: var(--primary); color: #fff; }
/* счётчик в label характеристики (сколько значений выбрано в мультиселекте) */
label .chip-count { background: var(--primary-50); color: var(--primary-600); }
.chip.active .chip-count { background: var(--primary); color: #fff; }

/* Row чата: состояния pinned (закреплён) и blocked (ЧС). */
.row.pinned { background: linear-gradient(90deg, var(--primary-50) 0%, transparent 30%); }
.row.pinned .pin-icon { position: absolute; top: 8px; right: 8px; color: var(--primary); display: flex; }
.row.pinned .pin-icon svg { width: 13px; height: 13px; fill: var(--primary); stroke: var(--primary); }
.row.blocked { opacity: .6; }
.row.blocked .ban-icon { display: inline-flex; color: var(--danger); }
.row.blocked .ban-icon svg { width: 13px; height: 13px; }

/* Skeleton-bubbles в диалоге (вместо большого спиннера при загрузке). */
.sk-bubble { background: var(--surface-2); min-width: 60%; padding: 12px 14px; }
.sk-line { display: block; height: 10px; background: var(--border); border-radius: 5px; animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 0%, 100% { opacity: .4; } 50% { opacity: .8; } }

/* ЧС-пометка поверх bubble: сообщение от заблокированного пользователя. */
.bubble.fromblocked { border: 1px dashed var(--danger) !important; }
.fromblocked-tag { font-size: 11px; color: var(--danger); margin-bottom: 4px; font-weight: 600; }

/* ===== Товары: живая сводка над списком + строка с восстановлением ===== */
.item-summary { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.item-summary::-webkit-scrollbar { display: none; }
.is-cell { flex: 1 0 auto; min-width: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; box-shadow: var(--shadow-1); }
.is-val { font-weight: 800; font-size: 17px; color: var(--text); line-height: 1.15; display: flex; align-items: baseline; gap: 2px; }
.is-unit { font-size: 13px; font-weight: 700; }
.is-cur { font-size: 12px; font-weight: 700; color: var(--muted); }
.is-lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* Строка-обёртка: кликабельный ряд + кнопка восстановления снизу.
   Разделитель рисует сам .row (item-row-main), здесь — только обнуление последнего. */
.item-row:last-child .item-row-main { border-bottom: 0; }
.item-row-main { border: 0; width: 100%; text-align: left; background: transparent; }
/* Просмотры компактно в подзаголовке строки. */
.item-views { color: var(--muted-2); font-weight: 600; }

/* Топ товара в выдаче категории. */
/* Бейдж в строке списка: «🏆 6/299». Цвет по позиции (золото/зелёный/синий). */
.top-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; margin-left: 4px; white-space: nowrap; }
.top-badge.tb-gold { background: rgba(245,166,35,.16); color: #f5a623; }
.top-badge.tb-green { background: var(--success-50); color: var(--success); }
.top-badge.tb-blue { background: var(--primary-50); color: var(--primary); }
.top-badge.tb-muted { background: var(--surface-2); color: var(--muted); }
/* Маленькая кнопка «🏆 топ» в строке — запускает поиск позиции (лениво). */
.top-load-btn { display: inline-flex; align-items: center; padding: 1px 7px; border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; margin-left: 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.top-load-btn:active { background: var(--surface-2); }
/* Карточка Топа в деталях товара. */
.top-card { border: 1px solid var(--border); }
.top-card.top-gold { border-color: #f5a623; background: rgba(245,166,35,.08); }
.top-card.top-green { border-color: var(--success); background: var(--success-50); }
.top-card.top-blue { border-color: var(--primary); background: var(--primary-50); }
.top-card.top-muted { background: var(--surface-2); }
.top-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.top-val { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 2px; }
.top-val .top-of { font-size: 14px; font-weight: 600; color: var(--muted); }
.top-val.muted { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Компактная кнопка «Восстановить» под строкой неактивного товара. */
.restore-btn { width: 100%; border: 0; border-top: 1px dashed var(--border); background: var(--surface-2); color: var(--success); font-weight: 700; font-size: 13px; padding: 9px 14px; display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.restore-btn svg { width: 14px; height: 14px; }
.restore-btn:active { background: var(--success-50); }
.restore-btn:disabled { opacity: .6; cursor: wait; }

/* ===== Кнопка «Восстановить все» (вкладка Проданные) + плавный confirm-sheet ===== */
.restore-all-btn { width: 100%; border: 1.5px solid var(--success); background: var(--success-50); color: var(--success); font-weight: 700; font-size: 14px; padding: 12px 14px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; margin-bottom: 12px; transition: filter .12s, transform .1s; }
.restore-all-btn svg { width: 16px; height: 16px; }
.restore-all-btn:active { transform: scale(.98); filter: brightness(.96); }
.restore-all-btn.restoring { border-style: dashed; cursor: wait; opacity: .85; }

/* Полноэкранный оверлей под confirm-sheet. */
.sheet-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; padding: 0 12px calc(16px + var(--safe-bottom)); }
/* Плавное затемнение фона. */
.sheet-fade-enter-active, .sheet-fade-leave-active { transition: opacity .22s ease; }
.sheet-fade-enter-from, .sheet-fade-leave-to { opacity: 0; }
/* Сама карточка подтверждения — выезжает снизу. */
.confirm-sheet { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 10px 20px calc(20px + var(--safe-bottom)); }
.sheet-up-enter-active { transition: transform .28s cubic-bezier(.22,1,.36,1); }
.sheet-up-leave-active { transition: transform .2s ease; }
.sheet-up-enter-from, .sheet-up-leave-to { transform: translateY(110%); }
.sheet-grip { width: 36px; height: 4px; border-radius: 999px; background: var(--border); margin: 4px auto 14px; }
.sheet-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--success-50); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.sheet-ic svg { width: 26px; height: 26px; }
.sheet-title { text-align: center; font-weight: 800; font-size: 18px; }
.sheet-text { text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-top: 8px; }

/* Баннер причины удаления модерацией в карточке товара. */
.block-banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--danger-50); color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.35; }
.block-banner svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ====================== ФОТО В ЧАТЕ ====================== */

/* Скрытый input type=file (открывается программно кнопкой-скрепкой). */
.hidden-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Полоса превью выбранных фото над полем ввода. */
.attach-strip { max-width: var(--app-width); margin: 0 auto 6px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.attach-strip::-webkit-scrollbar { display: none; }
.attach-thumb { position: relative; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.attach-x .ic { width: 12px; height: 12px; }
.attach-x:active { transform: scale(.9); }
.attach-err { position: absolute; inset: 0; background: rgba(229,72,77,.85); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }

/* Галерея фото внутри bubble сообщения. */
.msg-imgs { display: grid; gap: 3px; margin-top: 6px; overflow: hidden; border-radius: 12px; max-width: 240px; }
.msg-imgs.count-1 { grid-template-columns: 1fr; max-width: 240px; }
.msg-imgs.count-2 { grid-template-columns: 1fr 1fr; max-width: 240px; }
.msg-imgs.count-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; max-width: 240px; }
.msg-imgs.count-4 { grid-template-columns: 1fr 1fr; max-width: 240px; }
.msg-img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: var(--surface-2); -webkit-tap-highlight-color: transparent; }
/* 3 фото: первое большое слева, два маленьких справа стопкой */
.msg-imgs.count-3 .msg-img:first-child { grid-row: span 2; }
.msg-imgs.count-1 .msg-img { max-height: 320px; }
/* Аватарная высота для одиночного — квадратичные пропорции */
.msg-imgs.count-1 { aspect-ratio: auto; }
.msg-imgs.count-1 .msg-img { min-height: 120px; }
/* Для своих сообщений галерея прижимается вправо */
.msg.own .msg-imgs { margin-left: auto; }

/* ====================== ПРОСМОТРЩИК ФОТО (полный экран) ====================== */
.photo-viewer { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.96); display: flex; align-items: center; justify-content: center; animation: pv-fade .18s ease; touch-action: none; }
@keyframes pv-fade { from { opacity: 0; } to { opacity: 1; } }
.pv-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; transition: transform .08s ease-out; will-change: transform; -webkit-tap-highlight-color: transparent; }
/* При свайпе-закрытии убираем transition для прямой следования за пальцем */
.pv-stage:active .pv-img { transition: none; }
.pv-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top, 0px) + 8px) 12px 14px; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.pv-counter { color: rgba(255,255,255,.92); font-size: 14px; font-weight: 600; }
.pv-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; backdrop-filter: blur(6px); }
.pv-btn:active { background: rgba(255,255,255,.28); transform: scale(.94); }
.pv-btn .ic { width: 20px; height: 20px; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; backdrop-filter: blur(6px); }
.pv-nav:active { background: rgba(255,255,255,.26); }
.pv-nav .ic { width: 22px; height: 22px; }
.pv-prev { left: 10px; }
.pv-next { right: 10px; }
@media (min-width: 600px) { .pv-prev { left: 24px; } .pv-next { right: 24px; } }

/* ====================== CTA «Выставить товар» (сверху списка Товары) ======================
   Плашка-приглашение: всегда видна над списком, чтобы создать новый лот можно
   было в любой момент, а не только когда список пуст. Градиент в фирменном
   фиолетовом, плавные press/hover, мягкая тень. Стили в духе .restore-all-btn,
   но акцентнее (это главный CTA раздела). */
.publish-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 0;
  border-radius: var(--r-lg);
  text-align: left;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  box-shadow: 0 4px 14px rgba(109, 91, 208, .32), var(--shadow-1);
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, box-shadow .18s ease, filter .14s ease;
  animation: publish-cta-in .32s cubic-bezier(.2, .7, .3, 1.2) both;
}
@keyframes publish-cta-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.publish-cta:hover { filter: brightness(1.04); box-shadow: 0 6px 18px rgba(109, 91, 208, .38), var(--shadow-1); }
.publish-cta:active { transform: scale(.985); filter: brightness(.97); }
.publish-cta-ic {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
}
.publish-cta-ic .ic { width: 22px; height: 22px; color: #fff; }
.publish-cta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.publish-cta-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.publish-cta-sub { font-size: 12.5px; color: rgba(255, 255, 255, .82); line-height: 1.2; }
.publish-cta-arrow { flex: 0 0 auto; opacity: .85; }
.publish-cta-arrow .ic { width: 18px; height: 18px; color: #fff; }

/* ====================== Фото в мастере «Выставить товар» ======================
   Превью выбранных файлов с кнопкой удаления; первое помечено «обложка».
   В едином стиле с .gallery-thumbs карточки товара (размеры/радиусы). */
.publish-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.publish-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  animation: publish-thumb-in .2s ease both;
}
@keyframes publish-thumb-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.publish-thumb.cover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.publish-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.publish-thumb-cover {
  position: absolute; left: 4px; bottom: 4px;
  padding: 2px 6px; border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 1.3;
  text-transform: uppercase; letter-spacing: .03em;
}
.publish-thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(20, 21, 26, .65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .14s ease;
  backdrop-filter: blur(4px);
}
.publish-thumb-del:active { transform: scale(.88); background: var(--danger); }
.publish-thumb-del .ic { width: 12px; height: 12px; }


/* ====================== Мастер «Выставить товар» — лого игр + цена ====================== */
/* Строка игры с лого: иконка слева (лого или заглушка), название + тип. */
.game-row { gap: 12px; }
.game-logo {
  width: 44px; height: 44px; border-radius: var(--r-md); object-fit: cover;
  flex: 0 0 auto; background: var(--surface-2); transition: opacity .2s ease;
}
.game-logo-ph {
  width: 44px; height: 44px; border-radius: var(--r-md); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-50); color: var(--primary-600);
}
.game-logo-ph .ic { width: 24px; height: 24px; }
.game-row .subtitle { color: var(--muted-2); font-size: 12px; }

/* Подсказка о доходе под полем цены (−20% комиссия playerok). */
.price-hint {
  margin-top: 6px; padding: 7px 10px; border-radius: var(--r-sm);
  background: var(--success-50); color: var(--text);
  font-size: 12.5px; display: flex; align-items: baseline; gap: 4px;
  animation: price-hint-in .2s ease both;
}
.price-hint .strong { font-weight: 700; color: var(--success); }
.price-hint .cur { font-size: 11px; }
@keyframes price-hint-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

/* Бейдж «обложка» на первом фото — уже есть .publish-thumb-cover, но добавим
   плавности появления через transition на .publish-thumb (см. ниже). */
.publish-thumb { transition: transform .18s ease, box-shadow .18s ease; }
.publish-thumb:active { transform: scale(.96); }

/* ====================== Мастер «Выставить товар» v2 ====================== */

/* Обёртка лого в строке игры (фиксированный квадрат — лого или заглушка). */
.game-logo-wrap { flex: 0 0 auto; width: 44px; height: 44px; display: flex; }
.game-logo-wrap .game-logo, .game-logo-wrap .game-logo-ph { width: 100%; height: 100%; }

/* Шеврон справа в строках мастера (вместо инлайн). */
.row .chev, .game-row .chev { flex: 0 0 auto; color: var(--muted-2); display: flex; }
.row .chev .ic, .game-row .chev .ic { width: 18px; height: 18px; }

/* Подсветка совпадений в поиске игр. */
mark { background: var(--primary-50); color: var(--primary-600); border-radius: 3px; padding: 0 1px; }

/* Прогресс-бар загрузки полного каталога игр. */
.catalog-progress {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 2px 10px;
}
.catalog-progress .muted { font-size: 11.5px; }
.catalog-progress-bar {
  height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden;
}
.catalog-progress-fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .3s ease;
}

/* ── Характеристики: чипы-переключатели ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
}
.chip-choices {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  margin: 0 -2px; padding: 2px;
  -webkit-overflow-scrolling: touch;
}
.chip-choices.wrap { flex-wrap: wrap; overflow: visible; }
.chip-choice {
  flex: 0 0 auto; padding: 9px 14px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.chip-choices.wrap .chip-choice { flex: 0 1 auto; }
.chip-choice:active { transform: scale(.96); }
.chip-choice.active {
  background: var(--primary-50); border-color: var(--primary);
  color: var(--primary-600);
}

/* ── Поле с действием (показать/скрыть пароль) ── */
.input-with-action { position: relative; }
.input-with-action .input { padding-right: 42px; }
.input-suffix {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.input-suffix:active { background: var(--surface-2); }
.input-suffix .ic { width: 17px; height: 17px; }

/* ── Drag-reorder превью фото ── */
.publish-thumb.drag { opacity: .5; transform: scale(.94); }
.publish-thumb.dragover { box-shadow: 0 0 0 2px var(--primary) inset; }
.publish-thumb[draggable="true"] { cursor: grab; }
.publish-thumb[draggable="true"]:active { cursor: grabbing; }

/* transition-group для превью (плавное добавление/удаление/перемещение). */
.pv-move, .pv-enter-active, .pv-leave-active {
  transition: transform .22s cubic-bezier(.22,1,.36,1), opacity .18s ease;
}
.pv-enter-from { opacity: 0; transform: scale(.85); }
.pv-leave-to { opacity: 0; transform: scale(.85); position: absolute; }
.pv-leave-active { position: absolute; }
.publish-thumbs { position: relative; }

/* ====================== Sheet выбора публикации после создания ====================== */
/* Переиспользует .confirm-sheet / .sheet-overlay / .sheet-grip / .sheet-ic.
   Контейнер выбора приоритетов — вертикальный список карточек-кнопок. */
.pub-sheet { max-width: 420px; width: 100%; }
.pub-choices {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; margin-top: 14px;
}
.pub-choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.pub-choice:active:not([disabled]) { transform: scale(.985); }
.pub-choice:active:not([disabled]) { background: var(--surface-2); }
.pub-choice[disabled] { opacity: .55; cursor: default; }
/* Активная (загружаемая) кнопка — остаётся яркой, остальные приглушены. */
.pub-choice.loading { opacity: 1; cursor: default; border-color: var(--primary); }
.pub-choice.loading .pub-choice-ic { background: var(--primary); color: #fff; }
.pub-choice.loading .pub-choice-title { color: var(--primary-600); }
.pub-choice[disabled]:not(.loading) { opacity: .4; }
.pub-choice.premium {
  border-color: var(--primary); background: var(--primary-50);
}
.pub-choice-draft { border-style: dashed; }
.pub-choice-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.pub-choice.premium .pub-choice-ic { background: var(--primary); color: #fff; }
.pub-choice-draft .pub-choice-ic { background: transparent; }
.pub-choice-ic .ic { width: 20px; height: 20px; }
.pub-choice-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.pub-choice-title { font-weight: 600; font-size: 14px; }
.pub-choice.premium .pub-choice-title { color: var(--primary-600); }
.pub-choice-sub { font-size: 12px; color: var(--muted); }
.pub-choice-arrow { flex: 0 0 auto; color: var(--muted-2); display: flex; }
.pub-choice-arrow .ic { width: 18px; height: 18px; }
