/* Калькулятор перекупа by devollve — дизайн-система основного сайта аренды (Pit Lane). */

:root {
  --bg: #0B0D11;
  --bg-raised: #101318;
  --bg-card: #15171C;
  --bg-hover: #1D2026;
  /* Фон всплывающих списков и подсказок: плотный, без прозрачности (сквозь стекло
     текст не читался), цвет — как у окна настроек, чтобы не выбивался из дизайна. */
  --bg-pop: #101318;
  --border: #23262C;
  --text: #FFFFFF;
  --text-dim: #A8ADB7;
  --text-faint: #7A7F87;
  --accent: #FF7A00;
  --accent-2: #FF8D47;
  --accent-dim: rgba(255, 122, 0, 0.14);
  --green: #37C978;
  --red: #FF5C5C;
  --gold: #FBBF24;
  --plat: #60A5FA;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { background: transparent; color: var(--text); font-family: var(--font); min-height: 100vh; }
h2 { font-size: 18px; font-weight: 700; }
button { font-family: inherit; cursor: pointer; transition: background .25s, border-color .25s, color .25s, opacity .25s, transform .2s, box-shadow .25s; }
input, select { font-family: inherit; }
.hidden { display: none !important; }
/* Атрибут hidden должен всегда скрывать — иначе display у .a2-dash/.a2-tab перебивает его
   (гейт показывал сайдбар, вкладки не переключались). */
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-dim); }
.pos { color: var(--green); } .neg { color: var(--red); }

/* Анимированный фон-сеть (за контентом) */
#bg-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* Скроллбары в стиле сайта */
* { scrollbar-width: thin; scrollbar-color: #3A3A40 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3A3A40; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* Контейнеры как на аренде: шапка/футер во всю ширину, контент ограничен */
#app { display: flex; flex-direction: column; min-height: 100vh; }
.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 24px 40px; flex: 1; }
.accent { color: var(--accent); }

/* ---------- Кнопки ---------- */
/* Базовая геометрия у всех кнопок-вариантов: btn-primary/btn-ghost могут
   использоваться и без класса .btn — скругление не должно теряться */
.btn, .btn-primary, .btn-ghost {
  border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); text-decoration: none; display: inline-block;
}
.btn { background: var(--bg-hover); color: var(--text); }
.btn:hover { background: #333338; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1A1204; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; width: 36px; height: 36px; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
/* Клик мышью не должен оставлять «залипающую» обводку; клавиатурный фокус (focus-visible) сохраняем */
button:focus:not(:focus-visible) { outline: none; }
.icon-btn:focus-visible, .tab:focus-visible, .btn:focus-visible, .seg-btn:focus-visible,
.profile-dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Шапка ---------- */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg-raised); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 10px; }
/* Обёртка меню (вкладки + правая часть): на десктопе — обычная строка, на узких
   экранах сворачивается в выпадающую панель под шапкой (см. @media ниже). */
.topbar-menu { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.burger-btn { display: none; }
.logo {
  font-weight: 800; letter-spacing: 1.2px; font-size: 14px; white-space: nowrap;
  cursor: pointer; user-select: none; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.logo .logo-main span { color: var(--accent); }
.logo:hover .logo-main span { text-shadow: 0 0 14px rgba(255,122,41,.5); }
.logo-by { display: block; color: #B8B8C0; font-size: 11px; font-weight: 600; letter-spacing: 3px; margin-top: 2px; text-align: center; }
/* Ряд вкладок занимает ровно свою ширину и центрируется в свободном месте:
   с flex:1 он растягивался и на пару пикселей поджимал сам себя. */
.tabs { display: flex; gap: 2px; flex: 0 1 auto; min-width: 0; margin: 0 auto; justify-content: center; }
.tab { background: transparent; border: 1px solid transparent; color: var(--text-dim); font-size: 13px; font-weight: 600; padding: 0 8px; height: 34px; display: inline-flex; align-items: center; border-radius: 10px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--accent-dim); }
.topbar-right { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
/* Иконки шапки — одна высота с кнопками-дропдаунами, чтобы ряд читался одной линией. */
.topbar-right .icon-btn { width: 32px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Меню профиля — своё выпадающее, а не системный select (как на аренде) */
.profile-dd { position: relative; }
.profile-dd-btn {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 10px; height: 34px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; max-width: 140px; min-width: 0; white-space: nowrap;
}
/* Имя профиля/контекста в кнопке-дропдауне обрезаем, чтобы длинное название
   команды не растягивало шапку. */
#ctxName, #profileDdName { overflow: hidden; text-overflow: ellipsis; }
.profile-dd-btn:hover { border-color: var(--accent); }
.dd-arrow { color: var(--text-dim); font-size: 11px; }
.profile-dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 230px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.dd-caption { color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px 8px; }
.dd-item { display: flex; align-items: stretch; gap: 2px; border-radius: 8px; }
.dd-item-main {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent; border: none; color: var(--text); text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.dd-item-main small { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.dd-item-main:hover { background: var(--bg-hover); }
.dd-item.active .dd-item-main {
  background: linear-gradient(90deg, rgba(255,122,0,0.10), transparent 75%);
  color: var(--text); box-shadow: inset 3px 0 0 var(--accent);
}
.dd-item.active .dd-item-main small { color: var(--accent); }
.dd-item-edit, .dd-item-del {
  background: transparent; border: none; color: var(--text-dim);
  padding: 0 9px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .15s;
}
.dd-item:hover .dd-item-edit, .dd-item:hover .dd-item-del { opacity: 1; }
.dd-item-edit:hover { color: var(--accent); background: var(--bg-hover); }
.dd-item-del:hover { color: var(--red); background: var(--bg-hover); }
.dd-add {
  width: 100%; margin-top: 8px; background: transparent; border: 1px dashed var(--border);
  color: var(--text-dim); border-radius: 8px; padding: 9px; font-size: 13px; font-weight: 600;
}
.dd-add:hover { color: var(--accent); border-color: var(--accent); }

/* Переключатель контекста (мой профиль / команда). Пункты меню — самостоятельные
   кнопки .dd-item-main, поэтому активный пункт подсвечиваем по своему классу. */
.ctx-dd { position: relative; }
.dd-item-main.active { background: linear-gradient(90deg, rgba(255,122,0,0.10), transparent 75%); box-shadow: inset 3px 0 0 var(--accent); }
.dd-item-main.active small { color: var(--accent); }
a.dd-item-main { text-decoration: none; } /* пункты меню сервисов — ссылки */
.dd-sub { color: var(--text-faint); font-size: 11px; margin-left: 6px; }
/* Кто добавил командный товар (в личном контексте строки нет) */
.deal-owner { color: var(--text-faint); font-size: 11px; display: flex; align-items: center; gap: 4px; }
/* Подпись «кто добавил/продал» под названием в командной истории сделок. */
.hist-who { color: var(--text-faint); font-size: 11px; margin-top: 2px; }

/* Баннер режима «просмотр под пользователем» (виден владельцу при импперсонации). */
.imp-banner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: var(--accent); color: #1a1a1a; padding: 8px 16px; font-size: 13px; font-weight: 600; text-align: center; }
.imp-banner.hidden { display: none; }
.imp-banner .imp-text b { font-weight: 800; }
.imp-banner .btn { background: rgba(0, 0, 0, .28); color: #fff; border: none; }
.imp-banner .btn:hover { background: rgba(0, 0, 0, .45); }

/* Свой выпадающий список (dropdown.js) — вместо системного <select>, который
   рисуется средствами ОС и выпадает из тёмной темы. Оформление — как у меню
   профиля: та же карточка, та же подсветка выбранного. */
.dd { position: relative; }
.dd-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; color: var(--text); font-size: 14px; font-weight: 600; text-align: left;
}
.dd-btn:hover { border-color: var(--accent); }
.dd-label { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-label small { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.dd-ph { color: var(--text-faint); font-weight: 400; }
.dd-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  max-height: 240px; overflow-y: auto;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.dd-menu.hidden { display: none; }
.dd-opt {
  width: 100%; display: flex; align-items: center; gap: 8px; background: transparent;
  border: none; color: var(--text); text-align: left; padding: 8px 10px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
}
.dd-opt:hover { background: var(--bg-hover); }
.dd-opt.active { background: linear-gradient(90deg, rgba(255,122,0,0.10), transparent 75%); box-shadow: inset 3px 0 0 var(--accent); }
.dd-opt.active .dd-label small { color: var(--accent); }
/* Список роли в строке участника — компактнее общего варианта */
.team-member-ctl .dd { min-width: 132px; }
.team-member-ctl .dd-btn { padding: 5px 8px; font-size: 12px; font-weight: 600; }
.team-member-ctl .dd-opt { padding: 6px 8px; font-size: 12px; }

/* Экран команды (модалка #teamModal, модуль teams.js) */
.team-box { max-width: 620px; }
.team-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.team-open {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; text-align: left; color: var(--text); font-size: 14px; font-weight: 600;
}
.team-open:hover { border-color: var(--accent); }
.team-open-name { display: flex; align-items: center; gap: 8px; }
.team-role { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.team-empty { color: var(--text-faint); font-size: 13px; padding: 10px 2px; }
.team-forms { display: flex; gap: 14px; flex-wrap: wrap; }
.team-form { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.team-form h4 { margin: 0 0 2px; font-size: 13px; color: var(--text-dim); }
.team-form input {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; color: var(--text); font-size: 14px;
}
.team-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 1em; }
.team-back { background: transparent; border: none; color: var(--text-dim); font-size: 13px; padding: 2px 0; margin-bottom: 8px; cursor: pointer; }
.team-back:hover { color: var(--accent); }
.team-detail-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.team-detail-head h4 { margin: 0; font-size: 16px; }
.team-rename-btn { background: transparent; border: none; color: var(--text-dim); font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1; }
.team-rename-btn:hover { color: var(--accent); }
.team-rename-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }
.team-rename-form input { flex: 1 1 180px; }
.team-invite-box { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.team-members { display: flex; flex-direction: column; margin-bottom: 14px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.team-member-nick { flex: 1; font-weight: 600; font-size: 14px; }
.team-member-ctl { display: flex; align-items: center; gap: 8px; }
/* Кружок с буквой ника и плашка роли в строке участника */
.team-ava {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent); font-size: 12px; font-weight: 700;
}
.team-role-badge {
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--text-dim); background: var(--bg-hover); border: 1px solid var(--border);
}
.team-role-badge.owner { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.team-kick { background: transparent; border: none; color: var(--text-dim); font-size: 14px; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.team-kick:hover { color: var(--red); background: var(--bg-hover); }
/* Передача владения — рядом с исключением, но подсвечивается акцентом, а не красным. */
.team-crown { background: transparent; border: none; color: var(--text-dim); font-size: 14px; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.team-crown:hover { color: var(--accent); background: var(--bg-hover); }
/* Роспуск команды: отделён от состава, чтобы не нажать случайно. */
.team-danger { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.team-code { font-family: var(--mono); font-size: 16px; letter-spacing: 2px; color: var(--accent); }
.team-hint { color: var(--text-faint); font-size: 11px; }
.team-log-title { margin: 4px 0 6px; font-size: 13px; color: var(--text-dim); }
/* Журнал: показываем ~10 записей, дальше вертикальный скролл. */
.team-log { max-height: 285px; overflow-y: auto; font-size: 12px; color: var(--text-dim); }
.team-log-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.team-log-time { color: var(--text-faint); white-space: nowrap; font-family: var(--mono); }

/* Свод по участникам команды (вкладка «Аналитика») */
#teamStatsBody { overflow-x: auto; }
#teamStatsBody .num { text-align: right; }
/* Заголовки числовых колонок тоже вправо — иначе шапка «уезжает» от значений. */
#teamStatsBody th:not(:first-child) { text-align: right; }

/* Сетка серверов в модалке профиля */
.player-modal { max-width: 640px; }
.server-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.server-cell {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px 6px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: border-color .12s, background .12s;
}
.server-cell:hover { border-color: var(--text-dim); }
.server-cell.active { border-color: var(--accent); background: var(--accent-dim); }
.server-cell.active .server-name { color: var(--accent); }
.server-icon { font-size: 22px; line-height: 1; }
.server-cell small { color: var(--text-dim); font-size: 10px; font-family: var(--mono); }
.server-name { font-size: 12px; font-weight: 700; }
.field-hint { display: block; color: var(--text-dim); font-size: 11px; margin-top: 5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.slots-prop { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; }
.slots-prop span { color: var(--text-faint); }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* Заметки */
.notes-modal { max-width: 560px; }
.notes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.notes-head h3 { margin-bottom: 0; }
.notes-head-actions { display: flex; gap: 8px; align-items: center; }
.notes-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.note-form { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.note-form input, .note-form textarea { margin-bottom: 8px; }
.note-form textarea { min-height: 90px; }
.note-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.note-item-head { display: flex; align-items: center; gap: 8px; }
.note-title { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; }
.note-date { color: var(--text-faint); font-size: 11px; font-family: var(--mono); }
.note-body { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-top: 6px; white-space: pre-wrap; }

/* ---------- KPI-плитки (как .stat основного сайта) ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 16px; }
.kpi { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--text-faint); font-size: 12px; }
.kpi-value { font-size: 22px; font-weight: 700; font-family: var(--mono); }
.kpi-sub { color: var(--text-faint); font-size: 12px; }

/* ---------- VIP-статус (строка чипов, как на основном сайте) ---------- */
.vip-inline { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; flex-wrap: wrap; }
.vip-inline-label { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.vip-chip { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; }
.vip-chip span { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.vip-chip:hover { border-color: var(--text); }
.vip-chip.active { border-color: var(--accent); background: var(--accent-dim); }
.vip-chip.vip-gold { color: var(--gold); }
.vip-chip.vip-gold:hover { border-color: var(--gold); }
.vip-chip.vip-gold.active { border-color: var(--gold); background: rgba(251,191,36,0.1); }
.vip-chip.vip-plat { color: var(--plat); }
.vip-chip.vip-plat:hover { border-color: var(--plat); }
.vip-chip.vip-plat.active { border-color: var(--plat); background: rgba(96,165,250,0.1); }

/* ---------- Панель бота (оранжевая полоса слева, по концепту) ---------- */
.bot-panel { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; }
.bot-panel strong { font-size: 15px; }
.bot-panel p { color: var(--text-dim); font-size: 13px; margin-top: 4px; max-width: 680px; }
.bot-panel-actions { display: flex; gap: 10px; white-space: nowrap; }

/* ---------- Панели / сетка калькулятора ---------- */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
/* Заголовок панели и её управление: на узком управление уезжает под заголовок,
   иначе сегменты периода вылезали за край панели. */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.count { color: var(--text-dim); font-weight: 500; margin-left: 4px; }

/* Раскладка: слева узкая колонка (добавление + инвентарь друг под другом), справа —
   широкая панель активных сделок на всю высоту. Так в сделках помещается 4 карточки
   в ряд вместо двух (см. .deals-grid ниже). */
.calc-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: stretch; --add-h: 500px; --inv-h: 300px; }
.add-panel { grid-column: 1; grid-row: 1; height: var(--add-h); }
.inv-panel { grid-column: 1; grid-row: 2; height: var(--inv-h); }
.deals-panel { grid-column: 2; grid-row: 1 / span 2; height: calc(var(--add-h) + var(--inv-h) + 12px); }
.calc-grid > .panel { display: flex; flex-direction: column; }
.deals-panel .deals-grid { flex: 1; overflow-y: auto; align-content: start; padding-right: 4px; }
/* Фильтр по категориям над списками сделок/истории/инвентаря */
/* Поиск внутри панели (активные сделки, инвентарь) — над фильтром категорий */
.panel-search { width: 100%; margin: 0 0 10px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.panel-search:focus { outline: none; border-color: var(--accent); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cat-filter:empty { display: none; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text-dim); border-radius: 20px;
  padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cat-chip:hover { border-color: var(--accent-2); color: var(--text); }
.cat-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.cat-chip .cat-n { color: var(--text-dim); font-size: 11px; font-weight: 500; font-family: var(--mono); }
.cat-chip.active .cat-n { color: var(--accent-2); }
.deals-panel .deals-grid:empty { flex: 0; }
.deals-panel #dealsEmpty { flex: 1; display: flex; align-items: center; justify-content: center; }
.inv-panel .inv-list { flex: 1; overflow-y: auto; padding-right: 4px; }
.inv-panel .inv-list .empty { height: 100%; display: flex; align-items: center; justify-content: center; }
.add-panel .add-form { overflow-y: auto; }

/* Форма добавления */
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg-btn { flex: 1; background: transparent; border: 0; color: var(--text-dim); padding: 9px; border-radius: 8px; font-weight: 600; }
.seg-btn.active { background: var(--bg-hover); color: var(--text); }
.add-form { display: flex; flex-direction: column; }
.add-form label { color: var(--text-dim); font-size: 12px; margin: 12px 0 6px; font-weight: 600; }
.add-form input, .add-form select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 11px 12px; font-size: 14px; width: 100%; }
.add-form input:focus, .add-form select:focus { outline: none; border-color: var(--accent); }
.btn-primary.submit, .add-form .btn-primary { background: var(--accent); color: #1A1204; border: 0; border-radius: 8px; padding: 12px; font-weight: 700; margin-top: 16px; }
.hint { color: var(--text-faint); font-size: 12px; margin-top: 10px; }
.cash-btns { display: flex; gap: 10px; margin-top: 16px; }
.btn-income, .btn-expense { flex: 1; border: 0; border-radius: 8px; padding: 12px; font-weight: 700; color: #fff; }
.btn-income { background: #1f7a44; } .btn-income:hover { background: #259150; }
.btn-expense { background: #8a3227; } .btn-expense:hover { background: #a63c2f; }

/* Поиск с автодополнением */
.search-wrap { position: relative; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; border: 1px solid var(--border); border-radius: 10px; max-height: 340px; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.active { background: var(--bg-hover); }
.sr-thumb { width: 40px; height: 30px; object-fit: contain; border-radius: 6px; background: var(--bg); flex: 0 0 auto; }
.sr-name { font-weight: 600; font-size: 13px; }
.sr-meta { color: var(--text-dim); font-size: 11px; }
.sr-cat { margin-left: auto; color: var(--accent-2); font-size: 11px; white-space: nowrap; }

/* Выбранный предмет + варианты */
.picked { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.picked img { width: 44px; height: 32px; object-fit: contain; }
.picked .p-name { font-weight: 600; }
.picked .p-clear { margin-left: auto; color: var(--text-dim); background: 0; border: 0; font-size: 16px; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--border); background: var(--bg); object-fit: contain; cursor: pointer; }
.swatch.active { border-color: var(--accent); }

/* Активные сделки */
.deals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.deal-card { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
/* Перетаскивание карточек активных сделок */
.deal-card[draggable="true"] { cursor: grab; }
.deal-card.dragging { opacity: .5; cursor: grabbing; }
.deal-img { width: 100%; height: 96px; object-fit: contain; background: var(--bg-raised); border-radius: 8px; }
/* Название — ровно две строки во всех карточках, иначе строки ниже (дата, цены,
   поле продажи) съезжали друг относительно друга у соседних карточек. */
.deal-name { font-weight: 600; font-size: 13px; padding-right: 20px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.deal-date { color: var(--text-dim); font-size: 11px; }
.deal-comment { color: var(--text-faint); font-size: 11px; line-height: 1.35; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.deal-rows { display: flex; flex-direction: column; gap: 2px; font-size: 12px; margin-top: 4px; }
.deal-rows .r { display: flex; justify-content: space-between; }
.deal-rows .r span:first-child { color: var(--text-dim); }
/* margin-top:auto прижимает блок продажи к низу: строка «Комиссия» есть не у всех
   карточек, и без этого поле «Цена продажи» у соседних карточек стояло на разной высоте. */
/* Поле цены — на всю ширину и крупнее, кнопки «Продать» и «В инвентарь» под ним.
   margin-top:auto прижимает блок к низу: строка «Комиссия» есть не у всех карточек. */
.deal-sell { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 8px; }
.deal-sell input { width: 100%; min-width: 0; background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: var(--mono); text-align: center; }
/* Обе кнопки — ровно по половине ширины и одной высоты. min-width:0 обязателен:
   иначе кнопка с более длинной подписью забирала себе лишнее место. */
.deal-actions { display: flex; gap: 6px; align-items: stretch; }
.deal-actions .sell-btn, .deal-actions .move-btn {
  flex: 1 1 0; min-width: 0; width: auto; margin: 0; height: 32px; padding: 0 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; border-radius: 8px;
}
/* Прозрачная рамка у «Продать»: без неё кнопка на 2px уже соседней (у той рамка есть). */
.deal-actions .sell-btn { background: var(--accent); color: #1A1204; border: 1px solid transparent; }

/* Канал продажи: 5VITO (со сбором) / Лично (без сбора). Карточка узкая — сегменты
   мельче обычного .seg, иначе не влезают в колонку 180px. */
.chan-seg { display: flex; gap: 3px; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; }
.chan-btn { flex: 1 1 0; min-width: 0; background: transparent; border: 0; color: var(--text-dim);
  padding: 4px 2px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chan-btn.active { background: var(--bg-hover); color: var(--text); }
/* Галочка с подписью — по центру карточки, как поле цены и тумблер над ней. */
.chan-market { display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-faint); font-size: 10.5px; line-height: 1.25; cursor: pointer; }
/* Сброс .deal-sell input (width:100% + рамка + padding — это для поля цены): без него
   галочка растягивалась на всю ширину и выдавливала подпись на строку ниже. */
.chan-market input { width: auto; flex: 0 0 auto; margin: 0; padding: 0; border: 0;
  border-radius: 0; background: none; accent-color: var(--accent); }
.chan-market span { min-width: 0; }

/* «Вид для продажи»: карточка-витрина — товар, название и ценник, без цен покупки */
.view-toggle { display: flex; align-items: center; gap: 6px; }
.view-toggle .btn { padding: 6px 12px; font-size: 13px; }
.view-toggle .btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.deal-card.showcase { gap: 8px; padding: 14px; align-items: center; text-align: center; }
.deal-card.showcase .deal-img { height: 128px; }
.deal-card.showcase .deal-name { padding-right: 0; -webkit-line-clamp: 3; min-height: 0; font-size: 14px; }
.deal-ask { margin-top: auto; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent); }
.deal-ask.muted { font-size: 13px; font-weight: 500; color: var(--text-faint); }

/* Крестик удаления */
.card-del { position: absolute; top: 8px; right: 8px; z-index: 2; width: 22px; height: 22px; border-radius: 6px; line-height: 1; background: rgba(0,0,0,.35); color: var(--text-dim); border: 1px solid var(--border); font-size: 12px; }
.card-del:hover { background: var(--red); color: #fff; border-color: var(--red); }
.row-del { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; line-height: 1; background: transparent; color: var(--text-dim); border: 1px solid transparent; font-size: 12px; }
.row-del:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Инвентарь */
.inv-sum { color: var(--accent); font-weight: 700; font-family: var(--mono); }
.inv-list { display: flex; flex-direction: column; }
.inv-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.inv-item img { width: 40px; height: 30px; object-fit: contain; background: var(--bg-raised); border-radius: 6px; }
.inv-main { min-width: 0; flex: 1; }
.inv-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-date { color: var(--text-dim); font-size: 11px; }
.inv-comment { color: var(--text-faint); font-size: 11px; line-height: 1.35; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-val { margin-left: auto; text-align: right; font-size: 12px; white-space: nowrap; font-family: var(--mono); }
.best-rank { color: var(--accent); font-weight: 700; width: 16px; text-align: center; flex: 0 0 auto; }

/* Таблица истории */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
/* Показываем ~10 лотов, дальше прокрутка; шапка таблицы липкая, чтобы не уезжала. */
.table-wrap { overflow-x: auto; max-height: 505px; overflow-y: auto; }
.table-wrap .deals-table th { position: sticky; top: 0; z-index: 1; background: var(--bg-raised); }
.deals-table { width: 100%; border-collapse: collapse; }
.deals-table th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.deals-table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.deals-table td.mono, .deals-table .num { font-family: var(--mono); }

/* Аналитика */
.analytics-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analytics-body .panel { background: var(--bg-raised); }
/* Списки «Лучшие сделки» / «Доход-Расход»: показываем ~5 строк, дальше скролл */
.analytics-scroll { max-height: 250px; overflow-y: auto; padding-right: 4px; }

/* Кастомный календарь (замена нативного input[type=date]) */
.date-trigger { background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.date-trigger.has-value { color: var(--text); border-color: var(--accent); }
.date-pop { position: fixed; z-index: 200; width: 248px; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.date-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.date-nav { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
.date-nav:hover { color: var(--accent); border-color: var(--accent); }
.date-dow, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-dow span { text-align: center; color: var(--text-faint); font-size: 11px; padding: 4px 0; }
.date-day { background: none; border: none; color: var(--text); border-radius: 8px; padding: 7px 0; font-size: 13px; cursor: pointer; }
.date-day:hover { background: var(--bg-hover); color: var(--accent); }
.date-day.sel { background: var(--accent); color: #1A1204; font-weight: 700; }
.date-foot { margin-top: 8px; text-align: right; }
.date-clear { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; }
.date-clear:hover { color: var(--accent); }

/* Рынок — пошаговый выбор */
.market-step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
/* Расцветки предмета — отдельный блок между шагами 1 и 2: без отступа снизу
   ряд картинок липнул к заголовку «Серверы». */
#marketVariants:not(.hidden) { margin: 12px 0 18px; padding-left: 36px; }
.step-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; margin-top: 6px; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(255,122,0,.4); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step-body { flex: 1; min-width: 0; }
.step-label { color: var(--text-dim); font-size: 12px; margin-bottom: 8px; }
.step-label .muted { opacity: .8; }
/* Поиск предмета: компактный, а не во всю ширину панели */
.market-search { flex: 0 1 420px; max-width: 420px; min-width: 220px; }
.market-search input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.market-search input:focus { outline: none; border-color: var(--accent); }

.server-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Сообщение «нет данных» занимает свою строку: рядом с ним кнопка «＋ Сервер»
   прижималась к правому краю и висела ниже строки текста. */
.server-chips > .muted { flex: 1 0 100%; margin-bottom: 2px; }
.server-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); border-radius: 20px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.server-chip:hover { border-color: var(--accent-2); color: var(--text); }
.server-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.chip-n { color: var(--text-dim); font-size: 11px; font-weight: 500; font-family: var(--mono); }
.server-chip.active .chip-n { color: var(--accent-2); }
/* «＋ Сервер» — добавить сервер вручную, даже если данных по нему пока нет */
.server-chip.chip-add { border-style: dashed; color: var(--accent-2); }
.server-chip.chip-add:hover { border-color: var(--accent); color: var(--accent); }
.server-picker { position: fixed; z-index: 60; max-height: 280px; overflow-y: auto; min-width: 190px;
  padding: 6px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); display: flex; flex-direction: column; }
.server-picker button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--text); font-size: 13px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.server-picker button:hover { background: var(--bg-hover); color: var(--accent); }
.server-picker .empty { padding: 8px 10px; font-size: 12px; }
/* Пояснение «название пока только у вас» под шагом 1 */
.market-note { background: var(--accent-dim); border: 1px solid rgba(255,122,0,.3); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.market-view-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.metric-seg, .period-seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.metric-seg button, .period-seg button { background: 0; border: 0; color: var(--text-dim); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.metric-seg button.active, .period-seg button.active { background: var(--bg-hover); color: var(--accent); }

/* Точки графика: заметная реакция на наведение + кастомный тултип в стиле сайта */
.market-chart { min-height: 320px; position: relative; }
.chart-dot { transition: r .1s ease; pointer-events: none; }
.chart-dot.active { r: 6.5; stroke: var(--text); stroke-width: 2; }
.chart-bar { transition: opacity .1s ease; pointer-events: none; }
.chart-bar.active { opacity: 1; filter: brightness(1.35); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-tip {
  position: absolute; z-index: 6; transform: translate(-50%, calc(-100% - 14px));
  background: rgba(16, 19, 24, 0.97); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px; padding: 8px 12px;
  pointer-events: none; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.chart-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(16,19,24,0.97); border-bottom: 0;
}
.chart-tip-date { color: var(--text-faint); font-size: 11px; margin-bottom: 2px; }
.chart-tip-sum { color: var(--accent); font-weight: 800; font-size: 16px; font-family: var(--mono); }
.chart-tip-meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.chart-legend .sw { width: 12px; height: 3px; border-radius: 2px; }

.empty { color: var(--text-dim); text-align: center; padding: 30px; font-size: 13px; }

/* ---------- Модалки (стиль основного сайта: bg-raised + оранжевая полоса сверху) ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: var(--bg-raised); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 14px; padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin: 0 0 6px; font-size: 17px; }
.modal-box .modal-sub { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.modal-box label { display: block; color: var(--text-dim); font-size: 12px; margin: 12px 0 6px; font-weight: 600; }
.modal-box input, .modal-box select, .modal-box textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 11px 12px; font-size: 14px; }
.modal-box input:focus, .modal-box select:focus, .modal-box textarea:focus { outline: none; border-color: var(--accent); }
.modal-box textarea { min-height: 120px; resize: vertical; font-family: var(--font); line-height: 1.5; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Кандидаты для неоднозначной продажи */
.sale-candidates { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sale-cand { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.sale-cand:hover { border-color: var(--accent); background: var(--accent-dim); }
.sale-cand img { width: 40px; height: 30px; object-fit: contain; background: var(--bg-raised); border-radius: 6px; }

/* Тост */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--bg-raised); border: 1px solid var(--border); color: var(--text); padding: 12px 18px; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.5); z-index: 200; max-width: 90vw; text-align: center; }

/* Табы-панели */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Пока всё меню (вкладки + профиль + иконки) не помещается в строку рядом с
   логотипом — сворачиваем его в выпадающую панель под шапкой (как на сайте аренды),
   а не переносим вкладки вторым рядом. Порог высокий: у калькулятора в шапке много
   элементов (5 вкладок + контекст + профиль + 6 иконок), в строку они влезают только
   на широких мониторах. */
@media (max-width: 1250px) {
  .burger-btn { display: inline-flex; margin-left: auto; width: 38px; height: 38px; font-size: 18px; }
  .topbar-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 14px;
    background: rgba(16, 19, 24, 0.98); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); padding: 14px 20px 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  }
  .topbar-menu.open { display: flex; }
  .topbar-menu .tabs { flex-direction: column; gap: 6px; width: 100%; justify-content: stretch; flex: none; }
  .topbar-menu .tab { text-align: left; padding: 12px 14px; border: 1px solid var(--border); }
  .topbar-menu .tab.active { border-color: var(--accent-dim); }
  .topbar-menu .topbar-right { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  .ctx-dd, .profile-dd { flex: 1 1 46%; }
  .ctx-dd .profile-dd-btn, .profile-dd .profile-dd-btn { width: 100%; max-width: none; }
}
@media (max-width: 1200px) {
  .calc-grid { grid-template-columns: 1fr; }
  /* Узкий экран — панели друг под другом в обычном порядке (сбрасываем явную раскладку) */
  .add-panel, .inv-panel, .deals-panel { grid-column: 1; grid-row: auto; }
  .calc-grid > .panel { height: auto; max-height: 560px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .analytics-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #app { padding: 0 12px 40px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .bot-panel { flex-direction: column; align-items: flex-start; }
  .vip-chip { min-width: 0; flex: 1; }
}

/* ---------- Футер (как на сайте аренды) ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 32px; background: rgba(11,13,17,0.5); }
/* Ширина и боковые поля — как у .topbar-inner: край футера должен попадать
   ровно под край шапки, иначе логотип и бренд футера стоят «лесенкой». */
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 24px;
  font-size: 11px; color: var(--text-dim);
}
.footer-brand { font-weight: 600; white-space: nowrap; line-height: 1.25; }
.footer-brand small { display: block; color: var(--text-faint); font-weight: 400; }
.footer-note {
  flex: 1; min-width: 320px; color: var(--text-faint); line-height: 1.35; font-size: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.footer-links { display: grid; grid-template-columns: auto auto; gap: 4px 18px; justify-content: end; }
.footer-links a { color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.footer-links a:hover { color: var(--accent); }
.footer-links a:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fl-ico { display: inline-block; width: 1.5em; }
/* Ниже ~1000px описание и ссылки в одну строку уже не помещаются — описание уходит
   на свою строку (иначе ссылки вылезали за экран и тянули горизонтальный скролл). */
@media (max-width: 1000px) {
  .footer-inner { flex-wrap: wrap; gap: 8px 20px; }
  .footer-note { order: 3; min-width: 100%; }
}
.legal-body { font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.legal-body p { margin-bottom: 12px; }
.legal-body b { color: var(--text); font-weight: 600; }

/* ---------- Подсказки «?» (кружок с пояснением) ---------- */
.help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--text-faint); color: var(--text-faint);
  font-size: 10px; font-weight: 700; cursor: help; margin-left: 6px; line-height: 1;
  position: relative; vertical-align: middle;
}
.help:hover { border-color: var(--accent); color: var(--accent); }
/* Само облачко подсказки рисуется в <body> (см. bindTips в app.js): через ::after
   его обрезали панели со своим скроллом — overflow прячет всё, что вылезло за край. */
.tip-pop {
  position: fixed; z-index: 200; max-width: 280px;
  background: var(--bg-raised); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.45;
  text-align: left; box-shadow: 0 8px 24px rgba(0,0,0,.45); pointer-events: none;
}

/* ---------- Перемещение между активными и инвентарём ---------- */
.move-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600; width: 100%;
}
.move-btn:hover { border-color: var(--accent); color: var(--accent); }
.inv-item .move-btn { width: auto; padding: 5px 8px; font-size: 11px; }
.inv-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

/* ---------- Аналитика: график доходности ---------- */
.chart-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-range input[type="date"] {
  background: rgba(21,23,28,.6); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: var(--font);
  color-scheme: dark;
}
.date-range input[type="date"]:focus { outline: none; border-color: var(--accent); }
.date-range .btn, .date-range .btn-ghost { padding: 7px 12px; font-size: 13px; }
/* Показатели над графиком: карточки, чтобы соседние цифры не сливались в одну строку */
.profit-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ps-item {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 14px;
  background: rgba(21,23,28,.6); border: 1px solid var(--border); border-radius: 10px;
}
.ps-label { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.ps-value { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.ps-sub { color: var(--text-faint); font-size: 11px; font-family: var(--mono); }
@media (max-width: 560px) {
  /* На телефоне пять карточек в столбик занимали пол-экрана — ставим по две в ряд */
  .profit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ps-item { padding: 8px 10px; }
  .ps-value { font-size: 15px; }
}

/* ==================================================================
   СТЕКЛО — финальные переопределения (как на сайте аренды).
   Держать В КОНЦЕ файла: иначе фоны выше по каскаду их перекроют.
   Прозрачность без backdrop-filter: фон-сеть просвечивает, скролл плавный.
   ================================================================== */
.kpi, .panel, .bot-panel, .deal-card, .vip-chip, .seg, .metric-seg, .period-seg, .chan-seg,
.server-chip, .picked, .sale-cand,
.profile-select, .add-form input, .add-form select, .deal-sell input, .market-search input {
  background: rgba(21, 23, 28, 0.6);
}

/* Всё, что всплывает поверх страницы, — плотный тёмный фон. Стекло здесь не
   работает: под подсказками просвечивали панели и живой фон, и текст не читался. */
.search-results, .profile-dd-menu, .date-pop, .server-picker, .tip-pop, .toast, .chart-tip {
  background: var(--bg-pop);
}
/* Строки внутри списков подсвечиваем чуть светлее фона списка, а не «стеклом» */
.search-results .sr-item:hover, .search-results .sr-item.active,
.server-picker button:hover, .chat-at-item:hover,
.chat-menu-item:hover, .chat-menu-reacts button:hover, .chat-emoji-menu button:hover {
  background: #1a1d24;
}
/* Модалки — непрозрачная карточка (как на сайте аренды), не «стеклянная»: содержимое
   страницы не должно просвечивать сквозь окно. */
.modal-box { background: var(--bg-raised); }
.seg-btn.active, .metric-seg button.active, .period-seg button.active, .chan-btn.active { background: rgba(255, 122, 0, 0.14); }
.server-chip.active { background: rgba(255, 122, 0, 0.14); }
.analytics-body .panel { background: rgba(21, 23, 28, 0.45); }
.deal-img, .inv-item img, .sr-thumb, .swatch { background: rgba(11, 13, 17, 0.55); }

/* VIP-чипы: стеклянные, без цветных заливок; активный — оранжевая обводка,
   цветной остаётся только текст статуса (как на аренде) */
.vip-chip { border: 1px solid var(--border); border-radius: 12px; padding: 10px 22px; font-size: 14px; min-width: 118px; gap: 3px; }
.vip-chip span { font-size: 12px; }
.vip-chip:hover { border-color: var(--accent); }
.vip-chip.active,
.vip-chip.vip-gold.active,
.vip-chip.vip-plat.active { border-color: var(--accent); background: rgba(21, 23, 28, 0.6); }
@media (max-width: 860px) { .vip-chip { min-width: 0; padding: 9px 8px; font-size: 12px; } }

/* ===== Порт дизайн-языка админки Аренды (a2) — из web/styles.css ===== */

/* Каркас страницы /admin.html: шапка + меню слева + контент */
.a2-page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
.a2-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.a2-brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.a2-topbar-actions { display: flex; align-items: center; gap: 12px; }
.a2-whoami { color: var(--text-dim); font-size: 13px; }
.a2-dash { display: flex; align-items: flex-start; gap: 20px; }
.a2-side { position: sticky; top: 20px; width: 200px; flex-shrink: 0; }
.a2-nav { display: flex; flex-direction: column; gap: 4px; }
.a2-nav-btn {
  text-align: left; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: transparent; border: 1px solid transparent; color: var(--text-dim); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.a2-nav-btn:hover { background: var(--bg-hover); color: var(--text); }
.a2-nav-btn.active { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.a2-content { flex: 1; min-width: 0; }
.a2-tab { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 860px) {
  .a2-dash { flex-direction: column; }
  .a2-side { position: static; width: 100%; }
  .a2-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .a2-nav-btn { white-space: nowrap; }
}

/* Гейт доступа (код разблокировки) */
.a2-gate { display: flex; justify-content: center; padding: 50px 0; }
.a2-gate-card { max-width: 430px; width: 100%; text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; }
.a2-gate-ico { font-size: 40px; margin-bottom: 8px; }
.a2-gate-card h2 { margin-bottom: 10px; font-size: 20px; }
.a2-gate-card p { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.a2-gate-card code { background: var(--bg); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); color: var(--accent); }
.a2-code-wrap { position: relative; margin-bottom: 14px; }
.a2-code-input {
  width: 100%; text-align: center; letter-spacing: 3px; font-family: var(--mono); font-size: 18px;
  padding: 12px 44px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
}
.a2-code-input:focus { border-color: var(--accent); outline: none; }
.a2-code-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer; font-size: 16px; opacity: .6; padding: 4px 8px;
}
.a2-code-eye:hover { opacity: 1; }
.a2-gate-card .btn { width: 100%; }
.a2-gate-err { color: var(--red); font-size: 13px; margin-top: 12px; }

/* Карточки-графики и карточки-таблицы */
.chart-card {
  margin-top: 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.chart-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text-dim); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; color: var(--text-faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.admin-table tbody td { height: 50px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
/* Таблицы в админке не растут бесконечно: ~10 строк, дальше вертикальный скролл; шапка липкая */
.a2-tab .table-wrap { max-height: 540px; overflow-y: auto; }
.a2-tab .admin-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-card); }

/* KPI-плитки, счётчик, поля ввода */
.a2-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 4px; }
.a2-count { color: var(--text-faint); font-size: 13px; font-family: var(--mono); }
.a2-input, .a2-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: var(--font); font-size: 14px; padding: 10px 12px; margin-bottom: 10px;
}
.a2-textarea { resize: vertical; min-height: 110px; }
.a2-input:focus, .a2-textarea:focus { outline: none; border-color: var(--accent); }

@media (max-width: 860px) {
  .a2-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Админка калькулятора: доп. элементы ===== */
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--bg-hover); color: var(--text-dim); }
.badge.on { background: rgba(60,180,90,.22); color: #cdeccd; }
.badge.off { background: rgba(200,80,80,.20); color: #f0cccc; }
.admin-table code { cursor: pointer; font-family: var(--mono); color: var(--accent); }
.a2-kpi-tile { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); }
.a2-kpi-tile b { font-size: 22px; }
.a2-kpi-tile span { font-size: 12px; color: var(--text-dim); }
.admin-gen { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0; }
.admin-gen input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 11px; width: 100%; }
/* Поле формы генерации с подписью сверху */
.gen-field { display: flex; flex-direction: column; gap: 4px; }
.gen-field > span { font-size: 12px; color: var(--text-dim); }
.gen-field-grow { flex: 1; min-width: 140px; }
.admin-filter { margin: 8px 0; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-filter button { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; padding: 4px 10px; }
.admin-filter button.active { background: var(--accent); color: #1A1204; border-color: var(--accent); }
/* Раскрывающаяся пачка ключей */
.key-batch { border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; overflow: hidden; }
.key-batch > summary { cursor: pointer; padding: 10px 14px; background: var(--bg-card); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.key-batch > summary::-webkit-details-marker { display: none; }
.key-batch > summary::before { content: '▸'; color: var(--text-dim); }
.key-batch[open] > summary::before { content: '▾'; }
.key-batch .table-wrap { padding: 0 8px 8px; }
/* Блок подписки в настройках */
.sub-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.sub-block .sub-status { font-size: 14px; margin-bottom: 12px; }
.sub-block .sub-row { display: flex; gap: 8px; margin: 10px 0; }
.sub-block .sub-row input { flex: 1; }
/* Активная подписка — карточка без поля ключа */
.sub-block .sub-active { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px;
  background: var(--accent-dim); border: 1px solid rgba(255, 122, 0, 0.4); border-radius: 10px; }
.sub-block .sub-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.25); }
.sub-block .sub-active.sub-expiring .sub-dot { background: #d29922; box-shadow: 0 0 0 4px rgba(210, 153, 34, 0.25); }
.sub-block .sub-active-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sub-block .sub-active-title { font-weight: 700; font-size: 14px; }
.sub-block .sub-active-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--text-dim); }
.sub-block .sub-active-meta b { color: var(--text); font-weight: 600; }
.sub-block .sub-left { color: var(--accent); }
/* Реферальная программа в настройках */
.ref-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ref-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 16px; font-weight: 700;
  letter-spacing: 1px; padding: 6px 10px; border-radius: 8px; background: var(--bg-hover); border: 1px solid var(--border); }
.ref-code-row .btn, .ref-code-row .btn-ghost { width: auto; white-space: nowrap; }
.ref-stats { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.ref-hint { margin-top: 6px; font-size: 12px; color: var(--text-dim); opacity: .8; }
.ref-used { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.ref-used b { color: var(--text); }

/* Пояснение к подписке в таблице «Учётки» (админка) */
.sub-note { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.3; }

/* ===== Виджет чата ===== */
#chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 900; }
.chat-bubble { position: relative; width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--accent); color: #1A1204; font-size: 24px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.chat-dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg); }
.chat-panel { position: absolute; right: 0; bottom: 64px; width: 340px; max-width: calc(100vw - 40px);
  height: 460px; max-height: calc(100vh - 120px); display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  resize: both; min-width: 300px; min-height: 320px; }
/* Плавающий режим: панель перетащена/зафиксирована по вьюпорту */
.chat-panel.floating { position: fixed; right: auto; bottom: auto; max-width: 90vw; max-height: 90vh; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-weight: 600; cursor: move; user-select: none; }
.chat-x { background: none; border: none; color: var(--text-dim); font-size: 20px; line-height: 1; cursor: pointer; }
.chat-x:hover { color: var(--text); }
/* Шапка справа: сколько человек в сети, поиск, свернуть */
.chat-head-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.chat-head-tools .chat-x { font-size: 15px; }
.chat-head-tools #chat-close { font-size: 20px; }
.chat-online { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500;
  color: var(--text-dim); background: var(--bg-hover); border-radius: 999px; padding: 2px 8px; cursor: default; }
.chat-online b { color: var(--text); font-weight: 700; }
/* Строка поиска по сообщениям канала */
.chat-search { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.chat-search input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.chat-search input:focus { outline: none; border-color: var(--accent); }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
/* Сообщение = кружок автора + тело (цитата, подпись, текст, реакции) */
.chat-msg { max-width: 90%; align-self: flex-start; display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.mine { align-self: flex-end; text-align: right; }
.chat-msg-body { min-width: 0; }
.chat-meta { font-size: 11px; color: var(--text-dim); }
/* Аватар: своя картинка либо кружок с первой буквой ника */
.chat-ava { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; margin-top: 14px;
  object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.chat-ava-letter { color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
/* Серая подложка под текстом — как в мессенджерах; у адресованных мне она оранжевая (ниже) */
.chat-text { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 10px; word-break: break-word; white-space: pre-wrap; display: inline-block; }
.chat-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 20px 10px; }
/* Карточка прикреплённого предмета (в сообщении чата и лички) */
.chat-attach { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; max-width: 260px; }
.chat-attach-img { width: 44px; height: 44px; flex: 0 0 auto; object-fit: contain;
  background: var(--bg-card, #1b1f27); border-radius: 6px; }
.chat-attach-info { display: flex; flex-direction: column; min-width: 0; }
.chat-attach-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attach-variant { color: var(--text-dim, #9aa0aa); font-size: 11px; }
/* Пикер предмета (прикрепить вещь в чат/личку) */
.cip-panel { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 6px; z-index: 30;
  background: var(--bg-card, #1b1f27); border: 1px solid var(--border); border-radius: 10px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.cip-search { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit; }
.cip-search:focus { outline: none; border-color: var(--accent); }
.cip-results { max-height: 220px; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.cip-item { display: flex; align-items: center; gap: 8px; padding: 6px; background: 0; border: 0; color: inherit;
  cursor: pointer; text-align: left; border-radius: 8px; }
.cip-item:hover { background: var(--bg-hover, #1D2026); }
.cip-thumb { width: 36px; height: 28px; object-fit: contain; flex: 0 0 auto; border-radius: 4px; }
.cip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cip-empty { color: var(--text-dim, #9aa0aa); font-size: 13px; padding: 6px; }
.cip-variants { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; }
.cip-swatch { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); }
.cip-swatch:hover { border-color: var(--accent); }
/* Полоса-чип прикреплённого предмета над полем ввода (черновик) */
.chat-attach-chip { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 4px 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.chat-attach-chip .chat-attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-attach-x { background: 0; border: 0; color: var(--text-dim, #9aa0aa); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }
.chat-attach-x:hover { color: var(--text, #fff); }
/* Разделитель дней: подпись по центру с линиями по бокам */
.chat-day { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.chat-day span { color: var(--text-faint); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chat-err { color: var(--red); font-size: 12px; padding: 4px 12px; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
/* min-width:0 обязателен: без него поле не сжимается ниже своей «родной» ширины
   и на узкой панели выдавливает кнопку отправки за правый край. */
.chat-form input, .chat-form textarea { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }
.chat-form button[type="submit"] { flex: 0 0 auto; padding: 8px 12px; }
.chat-locked { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; text-align: center; color: var(--text-dim); }
.msg-deleted { opacity: .5; }
.chat-tabs { display: flex; gap: 4px; }
.chat-tabs button { background: transparent; border: 1px solid transparent; color: var(--text-dim);
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.chat-tabs button.active { color: var(--text); background: var(--accent-dim); }
/* Ник в ленте — интерактивный (клик/ПКМ вставляет @ник); упоминания подсвечены */
.chat-nick { background: none; border: none; padding: 0; color: var(--accent-2); font: inherit; font-size: 11px; cursor: pointer; }
.chat-nick:hover { text-decoration: underline; }
.chat-mention { color: var(--accent); font-weight: 600; }
/* Приглушённая плашка сервера рядом с ником (чат и личка). */
.chat-server {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted, #8a93a6);
  background: rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}
/* Подложка только там, где это про меня: упомянули или ответили на моё сообщение */
.chat-msg.pinged .chat-text,
.chat-msg.reply-me .chat-text { background: rgba(255,122,0,.14); border-color: rgba(255,122,0,.3); border-left: 3px solid var(--accent); }

/* Цитата сообщения, на которое отвечают */
.chat-quote { font-size: 11px; color: var(--text-dim); border-left: 2px solid var(--border);
  padding: 1px 8px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chat-quote-nick { color: var(--accent-2); font-weight: 600; margin-right: 6px; }

/* Реакции под сообщением: только контур, без заливки — своя выделяется цветом рамки */
.chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-react { background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 1px 8px; font-size: 12px; line-height: 1.6; cursor: pointer; }
.chat-react:hover { border-color: var(--accent-2); color: var(--text); }
.chat-react.mine { background: none; border-color: var(--accent); color: var(--accent); }

/* Сообщение заблокированного: свёрнуто, раскрывается кнопкой (как в Discord) */
.chat-blocked-note { font-size: 11px; color: var(--text-faint); font-style: italic; display: flex; gap: 8px; align-items: center; }
.chat-reveal { background: none; border: 0; color: var(--accent); font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline; }

/* Контекстное меню сообщения (ПКМ) */
.chat-menu { position: fixed; z-index: 1200; min-width: 180px; padding: 6px;
  background: var(--bg-pop); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.chat-menu-reacts { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.chat-menu-reacts button { background: none; border: 0; font-size: 17px; line-height: 1; padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.chat-menu-reacts button:hover { background: var(--bg-hover); }
.chat-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); font-size: 13px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.chat-menu-item:hover { background: var(--bg-hover); }
.chat-menu-item.danger { color: var(--red); }

/* Панель «отвечаю на …» над полем ввода */
.chat-reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-top: 1px solid var(--border); background: var(--bg-hover); font-size: 12px; color: var(--text-dim); }
.chat-reply-to { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-x { background: none; border: 0; color: var(--text-dim); font-size: 16px; line-height: 1; cursor: pointer; }
.chat-reply-x:hover { color: var(--text); }

/* Эмодзи — иконкой внутри поля ввода справа (как в мессенджерах) */
.chat-input-wrap { flex: 1; min-width: 0; position: relative; display: flex; }
/* min-height:0 обязателен: поле лички живёт внутри .modal-box, где у textarea
   задана min-height:120px — иначе однострочный ввод раздувался на треть окна.
   overflow скрыт по умолчанию, полосу включает autoGrow при переполнении. */
.chat-input-wrap textarea { flex: 1; min-width: 0; padding-right: 60px; resize: none; overflow-y: hidden;
  font: inherit; line-height: 1.35; min-height: 0; max-height: 96px; }
.chat-emoji-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; border-radius: 6px; font-size: 15px; line-height: 1;
  width: 26px; height: 26px; padding: 0; cursor: pointer; opacity: .75; }
.chat-emoji-btn:hover { opacity: 1; background: var(--bg-hover); }
/* Вторая иконка в поле — левее эмодзи, иначе обе легли бы в right:4px друг на друга. */
.chat-item-btn { right: 30px; }
.chat-emoji-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 2px); z-index: 6;
  display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; max-height: 160px; overflow-y: auto;
  background: var(--bg-pop); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.chat-emoji-menu button { background: none; border: 0; font-size: 18px; line-height: 1; padding: 4px; border-radius: 6px; cursor: pointer; }
.chat-emoji-menu button:hover { background: var(--bg-hover); }
/* @-пикер упоминаний над полем ввода: ник + плашка сервера (тёзки — разные строки) */
.chat-form-wrap { position: relative; }
.chat-at-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 2px); z-index: 5;
  max-height: 220px; overflow-y: auto;
  background: var(--bg-pop); border: 1px solid var(--border); border-radius: 10px; overflow-x: hidden; }
.chat-at-item { display: flex; align-items: center; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 8px 12px; font-size: 13px; cursor: pointer; }
.chat-at-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-at-item:hover, .chat-at-item.active { background: var(--bg-hover); color: var(--accent); }
/* Аватар в настройках: превью + кнопки */
.avatar-row { display: flex; align-items: center; gap: 14px; }
.avatar-preview { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  background: var(--bg-hover); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-letter { font-size: 22px; font-weight: 700; color: var(--text-dim); }
.avatar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar-actions .btn, .avatar-actions .btn-ghost { width: auto; padding: 8px 14px; font-size: 13px; }

/* Экран-заглушка доступа (закрытая бета / нужен вход) */
.access-gate { position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
/* Поле активации ключа внутри экрана покупки (переопределяем .btn width:100%) */
.a2-gate-card .sub-row { display: flex; gap: 8px; }
.a2-gate-card .sub-row input { flex: 1; width: auto; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; }
.a2-gate-card .sub-row .btn { width: auto; white-space: nowrap; }

/* Экран входа: статус ожидания подтверждения в боте + спиннер */
.login-status { margin-top: 16px; }
.login-status p { margin: 10px 0 12px; }
.login-status .spinner { width: 26px; height: 26px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent); animation: gate-spin .8s linear infinite; }
@keyframes gate-spin { to { transform: rotate(360deg); } }

/* Угловой баннер «подписка кончается» (правый верхний угол, с крестиком) */
.expiry-banner { position: fixed; top: 14px; right: 14px; z-index: 950; max-width: 340px;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--bg-raised); border: 1px solid var(--accent); border-left: 3px solid var(--accent);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 13px; }
.expiry-banner a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.expiry-x { background: none; border: none; color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.expiry-x:hover { color: var(--text); }

/* Личка (фаза E1) */
.dm-badge { position:absolute; top:-4px; right:-4px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:var(--red,#e5484d); color:#fff; font-size:11px; line-height:16px; text-align:center; }
#dmBtn { position:relative; }
.btn-x { background:none; border:none; color:var(--text-dim); font-size:20px; line-height:1; cursor:pointer; padding:0 2px; }
.btn-x:hover { color:var(--text); }
.dm-box { width:min(760px,94vw); max-width:94vw; height:min(560px,86vh); display:flex; flex-direction:column; }
.dm-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.dm-body { display:flex; gap:12px; flex:1; min-height:0; }
.dm-side { width:240px; display:flex; flex-direction:column; gap:8px; min-height:0; }
.dm-convos { overflow-y:auto; display:flex; flex-direction:column; gap:4px; }
/* Строка диалога: аватар, ник с последним сообщением, счётчик, крестик */
.dm-convo { display:flex; align-items:center; gap:8px; text-align:left; padding:6px 8px; border-radius:8px; background:var(--bg-card,#1b1f27); border:0; cursor:pointer; color:inherit; }
.dm-convo.active { outline:1px solid var(--accent,#6b8afd); }
.dm-convo-ava { width:32px; height:32px; margin:0; }
.dm-convo-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
/* Ник и плашка сервера — одной строкой: в колонке .dm-convo-main плашка иначе
   уезжала под ник и растягивалась на всю ширину. */
.dm-convo-top { display:flex; align-items:center; min-width:0; }
.dm-convo-nick { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Места мало — ужимается плашка, а не ник: у неё потолок в половину строки
   и большой flex-shrink, поэтому ник в списке диалогов читается целиком. */
.dm-convo-top .chat-server { flex:0 20 auto; max-width:55%; margin-left:4px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-convo-last { color:var(--text-dim,#9aa0aa); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-convo-last.muted { font-style:italic; color:var(--text-faint,#7A7F87); }
.dm-convo-badge { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; background:var(--red,#e5484d); color:#fff; border-radius:999px; min-width:18px; height:18px; padding:0 5px; font-size:11px; font-weight:700; line-height:1; text-align:center; }
/* Кнопка закрепа диалога: приглушена, активна — ярче. */
.dm-convo-pin { opacity:.35; cursor:pointer; font-size:13px; margin-left:4px; }
.dm-convo-pin:hover { opacity:.7; }
.dm-convo-pin.active { opacity:1; }
/* Крестик «скрыть переписку» — тусклый, ярче на наведении */
.dm-convo-del { flex:0 0 auto; color:var(--text-faint,#7A7F87); font-size:16px; line-height:1; cursor:pointer; padding:2px 5px; border-radius:6px; opacity:.5; transition:opacity .12s, color .12s, background .12s; }
.dm-convo:hover .dm-convo-del { opacity:1; }
.dm-convo-del:hover { color:var(--text,#fff); background:var(--bg-hover,#1D2026); }
.dm-thread { flex:1; display:flex; flex-direction:column; min-height:0; }
.dm-thread-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:20px; font-weight:600; padding-bottom:6px; border-bottom:1px solid var(--border,#2a2f3a); }
.dm-thread-head:empty { border-bottom:0; }
.dm-thread-nick { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dm-log { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:8px 0; }
/* Сообщение = кружок собеседника + пузырь (у своих кружка нет) */
.dm-msg { max-width:75%; display:flex; align-items:flex-start; gap:8px; }
.dm-msg.mine { align-self:flex-end; }
.dm-msg-ava { width:28px; height:28px; margin:0; }
.dm-bubble { min-width:0; padding:6px 10px; border-radius:10px; background:var(--bg-card,#1b1f27); }
.dm-msg.mine .dm-bubble { background:var(--accent,#6b8afd); color:#fff; }
.dm-text { word-break:break-word; white-space:pre-wrap; }
.dm-time { font-size:10px; color:var(--text-dim,#9aa0aa); text-align:right; }
.dm-msg.mine .dm-time { color:rgba(255,255,255,.75); }
.dm-thread-ava { width:28px; height:28px; margin:0; flex:0 0 auto; }
.dm-thread-head .dm-thread-nick { flex:1; }
.dm-form-wrap { position:relative; }
.dm-form { display:flex; gap:6px; align-items:flex-start; }
.dm-form textarea { flex:1; min-width:0; background:var(--bg); border:1px solid var(--border); color:var(--text);
  border-radius:8px; padding:8px 10px; resize:none; overflow-y:hidden; font:inherit; line-height:1.35;
  min-height:0; max-height:96px; }
.dm-form textarea:focus { outline:none; border-color:var(--accent); }
.dm-search-res { max-height:160px; overflow-y:auto; display:flex; flex-direction:column; }
.dm-search-ava { width:24px; height:24px; margin:0; font-size:11px; }
.dm-search-item { display:flex; align-items:center; gap:8px; text-align:left; padding:6px 8px; background:0; border:0; color:inherit; cursor:pointer; }
.dm-search-item:hover { background:var(--bg-card,#1b1f27); }
.dm-empty { color:var(--text-dim,#9aa0aa); font-size:13px; padding:6px; }
.dm-err { color:var(--red,#e5484d); font-size:12px; }

/* Уведомления (фаза E2) — окно со списком */
#notifBtn { position:relative; }
.notif-box { width:min(460px,94vw); max-height:80vh; display:flex; flex-direction:column; }
/* max-height ≈ 5 уведомлений — дальше прокрутка, окно не растёт на весь экран. */
.notif-list { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:4px; margin-top:8px; min-height:0; max-height:250px; }
.notif-section { font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--text-faint,#6a7180); font-weight:700; padding:8px 4px 2px; }
.notif-item { display:flex; align-items:center; gap:10px; text-align:left; width:100%; padding:9px 10px; border:0; border-radius:8px;
  background:var(--bg-card,#1b1f27); color:inherit; font-size:13px; cursor:pointer; }
.notif-item:hover { background:var(--border,#2a2f3a); }
.notif-item.unread { border-left:3px solid var(--accent,#6b8afd); }
.notif-item-text { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notif-item-time { flex:none; font-size:11px; color:var(--text-dim,#9aa0aa); }
.notif-empty { padding:16px; color:var(--text-dim,#9aa0aa); font-size:13px; text-align:center; }

/* ---------- Импорт лотов по скриншоту (OCR) ---------- */
.import-entry-btn { width:100%; margin:0 0 10px; padding:9px 12px; background:var(--bg-raised,#1b1f27);
  border:1px dashed var(--border); border-radius:10px; color:var(--text); font:inherit; cursor:pointer; }
.import-entry-btn:hover { border-color:var(--accent); background:var(--bg-hover); }
/* Шире базовых 520px .modal-box: очередь — сетка карточек, как у активных сделок. */
.modal-box.imp-box { width:min(820px,94vw); max-width:none; max-height:88vh;
  display:flex; flex-direction:column; position:relative; }
.imp-x { position:absolute; top:10px; right:12px; background:0; border:0; color:var(--text-dim,#9aa0aa); font-size:22px; line-height:1; cursor:pointer; }
.imp-x:hover { color:var(--text); }
.imp-drop { margin:8px 0; padding:14px 12px; border:2px dashed var(--border); border-radius:12px;
  text-align:center; font-size:13px; color:var(--text-dim,#9aa0aa); outline:none; }
.imp-drop.over, .imp-drop:focus { border-color:var(--accent); color:var(--text); }
.imp-bar { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.imp-add { flex:none; padding:7px 12px; background:var(--bg-raised,#1b1f27); border:1px solid var(--border);
  border-radius:8px; color:var(--text); font-size:12.5px; font-weight:600; cursor:pointer; }
.imp-add:hover { border-color:var(--accent); }
.imp-add-picker { position:relative; margin-bottom:8px; }
.imp-status { flex:1; min-width:0; font-size:13px; color:var(--text-dim,#9aa0aa); }
.imp-status.ok { color:#4ccf8e; } .imp-status.err { color:#ff6b6b; }
/* Очередь — та же сетка карточек, что у активных сделок (.deals-grid/.deal-card),
   только вдвое уже: вещей за раз много, важнее охват, а не размер плитки. */
.imp-queue { overflow-y:auto; flex:1; display:grid; grid-template-columns:repeat(auto-fill, minmax(155px,1fr));
  gap:10px; align-content:start; padding-right:4px; }
.imp-card { padding:8px; gap:4px; }
.imp-card .deal-img { height:84px; }
.imp-empty { grid-column:1/-1; padding:18px; text-align:center; color:var(--text-faint); font-size:13px; }
.imp-card.need { border-color:#c9922e; }
.imp-card.custom { border-color:#3b6ea5; }
.imp-box .imp-name-edit { width:100%; min-width:0; padding:4px 6px; font-size:12.5px; font-weight:600;
  background:var(--bg-raised); border:1px solid var(--border); border-radius:6px; }
.imp-box .imp-name-edit:focus { border-color:var(--accent); }
.imp-box .imp-cat { width:100%; }
.imp-box .imp-cat .dd-btn { padding:4px 6px; font-size:11.5px; background:var(--bg-raised); }
.imp-box .imp-cat .dd-opt { padding:5px 8px; font-size:11.5px; }
.imp-own-btn { display:block; width:100%; margin-bottom:6px; padding:7px 10px; text-align:left;
  background:var(--bg-raised); border:1px dashed var(--border); border-radius:8px;
  color:var(--text); font-size:12.5px; cursor:pointer; }
.imp-own-btn:hover { border-color:var(--accent); }
.imp-own-btn small { color:var(--text-dim,#9aa0aa); }
/* «+» — рядом с крестиком: дублирует карточку, когда одинаковых вещей несколько. */
.imp-dup { right:34px; font-size:14px; font-weight:700; }
.imp-dup:hover { background:var(--accent); color:#1A1204; border-color:var(--accent); }
/* Галочка «переносить» — в одной строке с названием, а не поверх картинки. */
.imp-title { display:flex; align-items:flex-start; gap:6px; margin:0; cursor:pointer; }
.imp-title .deal-name { padding-right:0; font-size:12.5px; min-height:0; -webkit-line-clamp:2; }
/* Поля внутри .modal-box глобально идут в width:100% (см. .modal-box input выше) —
   свои размеры задаём через .imp-box, иначе чекбокс распирает карточку на всю ширину. */
.imp-box .imp-sel { flex:none; width:13px; height:13px; margin:2px 0 0; padding:0; accent-color:var(--accent); cursor:pointer; }
.imp-meta { font-size:11px; color:var(--text-dim,#9aa0aa); }
.imp-fix { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.imp-fix button { padding:3px 8px; background:var(--bg-raised,#1b1f27); border:1px solid var(--border); border-radius:6px; color:var(--text); font-size:11.5px; cursor:pointer; }
.imp-fix button:hover { border-color:var(--accent); }
/* Цена и «куда положить» — под названием, прижаты к низу карточки (как блок продажи). */
.imp-buy { display:flex; flex-direction:column; gap:5px; margin-top:auto; padding-top:8px; }
.imp-box .imp-price { width:100%; min-width:0; padding:0 8px; height:30px;
  font-size:13px; font-family:var(--mono); text-align:center; background:var(--bg-raised); }
/* Выпадающий список назначения — в стиле меню профиля (.profile-dd-*) */
.imp-dest { position:relative; }
.imp-box .imp-dest-btn { display:flex; align-items:center; justify-content:space-between; gap:6px;
  width:100%; height:30px; padding:0 8px; background:var(--bg-raised); border:1px solid var(--border);
  border-radius:8px; color:var(--text); font-size:12px; font-weight:600; cursor:pointer; }
.imp-box .imp-dest-btn:hover { border-color:var(--accent); }
.imp-dest-menu { position:absolute; bottom:calc(100% + 4px); left:0; right:0; z-index:40;
  background:var(--bg-raised); border:1px solid var(--border); border-radius:10px; padding:4px;
  box-shadow:0 12px 40px rgba(0,0,0,.5); }
.imp-dest-menu .dd-item-main { width:100%; padding:7px 8px; font-size:12px; justify-content:flex-start; }
.imp-dest-menu .dd-item-main.active { background:var(--accent-dim,rgba(255,122,0,.14)); box-shadow:inset 3px 0 0 var(--accent); }
.imp-foot { display:flex; gap:8px; margin-top:10px; }
.imp-foot .btn-primary { flex:1; }

/* ---------- Адаптив: телефон / планшет / десктоп ----------
   Блок держим в конце файла: правила ниже перебивают точечные @media у своих
   секций (футер, VIP-плашки), иначе те выигрывали бы по порядку. */

/* Планшет: управление панелей уезжает под заголовок (см. .panel-head flex-wrap). */
@media (max-width: 900px) {
  .chart-controls { width: 100%; }
  .period-seg, .metric-seg { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .page { padding: 0 12px 40px; }
  /* Пальцем в 18-пиксельный значок не попасть: подтягиваем цели закрепа/скрытия
     по высоте, ширину бережём — строка диалога и так тесная. */
  .dm-convo-pin, .dm-convo-del { display:inline-flex; align-items:center; justify-content:center;
    min-width:24px; min-height:32px; padding:0; }
  /* Шапка на телефоне — одна строка «логотип + бургер»; само меню уезжает в
     выпадающую панель (см. блок @media 1100px выше), поэтому в колонку её не ломаем. */
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .profile-dd-btn { max-width: 100%; }
  .footer-inner { padding: 8px 12px; }
}
@media (max-width: 480px) {
  .logo { font-size: 13px; letter-spacing: 1px; }
  /* На телефоне поля модалки съедали половину ширины — ужимаем отступы. */
  .modal { padding: 12px; }
  .modal-box { padding: 16px; max-height: 92vh; }
  .modal-btns { flex-wrap: wrap; }
  /* Ссылки футера в один столбец: в два они не помещались по ширине телефона. */
  .footer-links { grid-template-columns: 1fr; justify-content: start; width: 100%; }
  .vip-inline { gap: 6px; }
  .vip-chip { font-size: 11px; padding: 8px 6px; }
}
@media (max-width: 380px) {
  .logo { font-size: 12px; letter-spacing: .5px; }
  .logo-by { letter-spacing: 2px; }
  .kpi-row { grid-template-columns: 1fr; }
}

/* Уважение к системной настройке «меньше движения»: гасим анимации и переходы. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
