/* ==========================================================================
   basement — слой дизайна поверх совместимых стилей NEO.
   1. Токены   2. База   3. Перекраска NEO   4. Оболочка
   5. Компоненты b-*   7. Адаптив   (страницы — в home.css, profile.css …)
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --b-bg: #111111;
  --b-surface: #181818;
  --b-raised: #1f1f1f;
  --b-hover: #262626;
  --b-line: rgba(255, 255, 255, .06);
  --b-line-strong: rgba(255, 255, 255, .11);

  --b-text: #ededed;
  --b-muted: #8f8f8f;
  --b-dim: #5f5f5f;

  --b-accent: #e08adc;
  --b-accent-hover: #e99fe6;
  --b-accent-ink: #1f0f1e;
  --b-accent-8: rgba(224, 138, 220, .08);
  --b-accent-16: rgba(224, 138, 220, .16);
  --b-accent-30: rgba(224, 138, 220, .30);

  --b-green: #6fcf8e;
  --b-green-12: rgba(111, 207, 142, .12);
  --b-amber: #f2b85b;
  --b-amber-12: rgba(242, 184, 91, .12);
  --b-red: #f0625a;
  --b-red-12: rgba(240, 98, 90, .12);
  --b-blue: #7fb2ff;
  --b-blue-12: rgba(127, 178, 255, .12);
  --b-t: #d9b36c;
  --b-ct: #6fb1d6;

  --b-r-xs: 6px;
  --b-r-sm: 9px;
  --b-r: 12px;
  --b-r-lg: 18px;

  --b-font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --b-display: 'Oswald', 'Onest', 'Arial Narrow', sans-serif;

  --b-ease: cubic-bezier(.2, .7, .2, 1);
  --b-fast: 140ms;
  --b-mid: 260ms;

  --b-nav-h: 64px;
  --b-container: 1440px;
  --b-gutter: 24px;

  /* NEO: шрифты и высоты контролов под нашу систему */
  --font-family-1: var(--b-display);
  --font-family-2: var(--b-font);
  --input-height: 42px;
  --transition-duration: var(--b-fast);
  color-scheme: dark;
}

/* 2. Base ------------------------------------------------------------------ */
html { scrollbar-gutter: stable; }

body.b-body {
  font-family: var(--b-font);
  background: var(--b-bg);
  color: var(--b-text);
  -webkit-font-smoothing: antialiased;
  margin: 0 !important;
}

/* мягкая подсветка сверху — заполняет пустые поля на широких экранах */
body.b-body::before {
  content: "";
  position: fixed; inset: 0 0 auto 0; height: 620px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 18% -10%, rgba(224, 138, 220, .10), transparent 70%),
    radial-gradient(45% 60% at 92% -20%, rgba(127, 120, 255, .07), transparent 70%);
}

[hidden] { display: none !important; } /* иначе display у компонентов (.b-btn, .b-chip…) перебивает атрибут hidden */
::selection { background: var(--b-accent-30); }
:focus-visible { outline: 2px solid var(--b-accent); outline-offset: 2px; }

.b-icon { width: 18px; height: 18px; flex: none; fill: none !important; stroke: currentColor; }
.b-icon--sm { width: 15px; height: 15px; }
.b-icon--xs { width: 13px; height: 13px; }
.b-icon--lg { width: 22px; height: 22px; }

.b-container { width: 100%; max-width: var(--b-container); margin-inline: auto; padding-inline: var(--b-gutter); }

.b-page { min-height: 100vh; }

.container-fluid.b-main {
  max-width: none; padding: 28px 0 64px; height: auto; display: block; flex: 1 0 auto;
  z-index: auto; /* NEO ставит z-index: 1 — модалки внутри main оказывались под навбаром и нижней панелью */
}

.b-num, .b-tabular { font-variant-numeric: tabular-nums; }
.b-muted { color: var(--b-muted); }
.b-dim { color: var(--b-dim); }

/* 3. NEO compatibility skin (низкая специфичность через :where) ------------------------------------------------ */
/* Эти правила перекрашивают разметку модулей NEO под basement, не меняя её. */

.b-body :where(.card) { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg); }
.b-body :where(.card-header) { padding: 18px 20px 0; }
.b-body :where(.badge) { border-bottom-color: var(--b-line); font-family: var(--b-font); color: var(--b-text); }

.b-body :where(button, .button) {
  border-radius: var(--b-r-sm);
  font-family: var(--b-font);
  font-weight: 600;
}
.b-body :where(button.active, .button.active) { background: var(--b-accent); color: var(--b-accent-ink); }
.b-body :where(.secondary_btn) { background: var(--b-accent-8); color: var(--b-accent); }
.b-body :where(.secondary_btn:hover) { background: var(--b-accent-16); color: var(--b-accent); }
.b-body :where(.button-delete) { background: var(--b-red-12); color: var(--b-red); }
.b-body :where(.button-delete:hover) { background: rgba(240, 98, 90, .2); color: var(--b-red); }

.b-body :where(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) {
  border-radius: var(--b-r-sm);
  font-size: 14px;
  border: 1px solid var(--b-line);
}
.b-body :where(input:focus, textarea:focus) { outline: none; border-color: var(--b-accent-30); filter: none; }

.b-body .chips_btn { border-radius: var(--b-r-sm); border-width: 1px; }
.b-body .chips_active { color: var(--b-accent-ink); }

/* фон модалки оплаты: 485 КБ PNG → 11 КБ WebP (тот же рисунок, выводится 200px с размытием) */
.b-body .popup_pay_info::before { background-image: url(/app/templates/basement/assets/img/wallet.webp); }

/* NEO модалки (.popup_modal / .visible) */
.b-body .popup_modal { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.b-body .popup_modal_content { background: var(--b-surface); border: 1px solid var(--b-line-strong); border-radius: var(--b-r-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.b-body .popup_modal_head { font-family: var(--b-font); font-size: 20px; letter-spacing: -.01em; }
.b-body .popup_modal_close { width: 34px; height: 34px; border-radius: 50%; background: var(--b-raised); display: grid; place-items: center; cursor: pointer; transition: background var(--b-fast); }
.b-body .popup_modal_close:hover { background: var(--b-hover); }

/* таблицы NEO */
.b-body table { border-collapse: collapse; }
.b-body .table th, .b-body table thead th { color: var(--b-dim); font-weight: 500; font-size: 12px; }
.b-body .table td, .b-body .table th { border-color: var(--b-line); }

/* тосты iziToast в стиле basement */
.b-body .iziToast { background: var(--b-raised) !important; border: 1px solid var(--b-line-strong); border-radius: var(--b-r) !important; box-shadow: 0 12px 40px rgba(0, 0, 0, .5) !important; }
.b-body .iziToast::after { display: none; }
.b-body .iziToast > .iziToast-body .iziToast-title { font-family: var(--b-font); }
/* уведомления NEO (noty → iziToast): справа под шапкой, высота по тексту, длинный текст переносится */
.b-body .iziToast-wrapper { z-index: 3000; }
.b-body .iziToast-wrapper-topRight, .b-body .iziToast-wrapper-topCenter, .b-body .iziToast-wrapper-topLeft { top: calc(var(--b-nav-h, 64px) + 8px); padding: 0 16px; }
.b-body .iziToast { height: auto !important; min-height: 64px; max-width: min(420px, calc(100vw - 32px)); margin: 0 0 8px; }
.b-body .iziToast > .iziToast-body { height: auto !important; min-height: 64px; padding-top: 12px !important; padding-bottom: 12px !important; }
.b-body .iziToast > .iziToast-body .iziToast-texts { float: none; max-width: 100%; }
.b-body .iziToast > .iziToast-body .iziToast-title, .b-body .iziToast > .iziToast-body .iziToast-message { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.b-body .iziToast .iziToast-icon { top: 50% !important; transform: translateY(-50%); margin-top: 0 !important; }

/* 4. Shell ----------------------------------------------------------------- */

/* navbar */
.b-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--b-nav-h);
  background: rgba(17, 17, 17, .8);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--b-line);
}
.b-nav { view-transition-name: b-nav; } /* навбар не «мигает» при переходе между страницами */
.b-nav__in { height: 100%; display: flex; align-items: center; gap: 26px; }

.b-logo { display: flex; align-items: center; gap: 10px; flex: none; color: var(--b-text); text-decoration: none; }
.b-logo__mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: #fff; color: #111;
  transition: transform var(--b-mid) var(--b-ease);
}
.b-logo__mark svg { width: 24px; height: auto; }
.b-logo:hover .b-logo__mark { transform: rotate(-8deg) scale(1.04); }
.b-logo__name { font: 700 16px/1 'Unbounded Brand', 'Unbounded', var(--b-font); letter-spacing: .01em; text-transform: uppercase; }

.b-nav__links { display: flex; align-items: center; gap: 2px; min-width: 0; }
.b-nav .b-nav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; width: auto; padding: 0 12px;
  border: 0; border-radius: var(--b-r-sm); background: transparent;
  color: var(--b-muted); font: 500 14px/1 var(--b-font); text-decoration: none; white-space: nowrap;
  transition: color var(--b-fast), background var(--b-fast);
}
.b-nav .b-nav__link svg:not(.b-icon) { width: 16px; height: 16px; fill: currentColor; flex: none; }
.b-nav .b-nav__link:hover { color: var(--b-text); background: var(--b-raised); }
.b-nav .b-nav__link.is-active { color: var(--b-text); }
.b-nav .b-nav__link.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; border-radius: 2px;
  background: var(--b-accent);
}
.b-nav .b-nav__link.is-active > svg { color: var(--b-accent); }

/* dropdown (NEO toggles .dropdown_show) */
.b-dd { position: relative; }
.b-nav .b-dd__menu {
  top: calc(100% + 12px); left: 0; width: 280px; padding: 6px;
  background: var(--b-raised); border: 1px solid var(--b-line-strong); border-radius: var(--b-r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  transform: translateY(-4px) scale(.98); transform-origin: top left;
}
.b-nav .b-dd__menu.dropdown_show { transform: none; }
.b-dd__item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--b-r-sm); color: var(--b-text); text-decoration: none; transition: background var(--b-fast); }
.b-dd__item:hover, .b-dd__item.is-active { background: var(--b-hover); }
.b-dd__icon { width: 36px; height: 36px; border-radius: var(--b-r-sm); background: var(--b-surface); display: grid; place-items: center; color: var(--b-accent); flex: none; }
.b-dd__icon svg { width: 17px; height: 17px; fill: currentColor; }
.b-dd__text b { display: block; font-weight: 600; font-size: 14px; }
.b-dd__text small { display: block; color: var(--b-muted); font-size: 12px; margin-top: 1px; }

.b-nav__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.b-nav__right > * { flex-shrink: 0; }
.b-nav__links { flex: 0 1 auto; min-width: 0; }

/* online */
.b-online {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: 999px; flex: none;
  background: var(--b-surface); border: 1px solid var(--b-line);
  font-size: 13px; font-weight: 600; cursor: default;
}
.b-online__num { font-variant-numeric: tabular-nums; }
.b-online__pop {
  position: absolute; top: calc(100% + 10px); left: 0; width: 260px; padding: 12px;
  background: var(--b-raised); border: 1px solid var(--b-line-strong); border-radius: var(--b-r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all var(--b-fast) var(--b-ease);
}
.b-online__pop.visible, .b-online:hover .b-online__pop, .b-online:focus-within .b-online__pop { opacity: 1; visibility: visible; transform: none; }
.b-online::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; } /* мостик, чтобы поповер не гас при наведении */
.b-online__title { font-size: 12px; color: var(--b-dim); font-weight: 500; padding: 0 2px 8px; }
.b-online__mode { display: flex; align-items: center; gap: 10px; padding: 7px 2px; }
.b-online__ico { width: 30px; height: 30px; border-radius: var(--b-r-xs); background: var(--b-surface); display: grid; place-items: center; color: var(--b-accent); flex: none; }
.b-online__mode-main { flex: 1; min-width: 0; }
.b-online__mode-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--b-muted); margin-bottom: 5px; }
.b-online__mode-row b { color: var(--b-text); font-variant-numeric: tabular-nums; font-weight: 600; }
.b-online__mode-row small { color: var(--b-dim); font-weight: 500; }
.b-online__site { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--b-line); font-size: 13px; color: var(--b-muted); }
.b-online__site span:nth-child(2) { flex: 1; }
.b-online__site b { color: var(--b-text); font-variant-numeric: tabular-nums; }

.b-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--b-green); position: relative; flex: none; display: inline-block; }
.b-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--b-green); animation: b-pulse 2.2s var(--b-ease) infinite; }
@keyframes b-pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }

/* search (NEO search.js) */
.b-search { position: relative; }
.b-search .modal-searchcontent form { position: relative; display: flex; align-items: center; }
.b-search .b-search__icon { position: absolute; left: 12px; color: var(--b-dim); pointer-events: none; }
.b-nav .b-search { width: 200px; height: 38px; flex: none; }
.b-nav .b-search .modal-searchcontent { position: absolute; top: 0; right: 0; left: auto; width: auto; z-index: 5; }
.b-nav .b-search .search-input-block {
  width: 200px; height: 38px; padding: 0 12px 0 38px;
  background: var(--b-surface); border: 1px solid var(--b-line); border-radius: 999px;
  font-size: 13px; color: var(--b-text); outline: none;
  transition: width var(--b-mid) var(--b-ease), border-color var(--b-fast), background var(--b-fast);
}
.b-nav .b-search .search-input-block:focus { border-color: var(--b-accent-30); background: var(--b-raised); filter: none; }
/* выпадающий список поиска (search.js NEO: .users_found / .users_notfound) */
.b-nav .b-search .b-search__icon { opacity: 1; z-index: 1; left: 12px; right: auto; top: 50%; transform: translateY(-50%); color: var(--b-text); }
.b-nav .b-search .search-input-block:focus ~ .b-search__icon, .b-nav .b-search form:focus-within .b-search__icon { opacity: 1; color: var(--b-accent); }
.b-nav .b-search .modal_users_container {
  top: calc(100% + 10px); left: auto; right: 0; width: 320px; transform: translateY(-4px);
  background: var(--b-raised); border: 1px solid var(--b-line-strong); border-radius: var(--b-r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); overflow: hidden; z-index: 110;
}
.b-nav .b-search.users_found .modal_users_container, .b-nav .b-search.users_notfound .modal_users_container { transform: none; }
.b-nav .b-search .modal_blocks_content { max-height: 360px; padding: 6px; background: none; border: 0; }
.b-nav .b-search .modal_users_header { position: static; width: auto; height: auto; padding: 10px 12px; background: none; backdrop-filter: none; border-radius: 0; justify-content: flex-start; color: var(--b-muted); font-size: 13px; }
.b-nav .b-search .modal_blocks_content a { border-radius: var(--b-r-xs); }
.b-nav .b-search .modal_blocks_content a:hover { background: var(--b-hover); }

/* icon button */
.b-nav .b-icon-btn, .b-icon-btn {
  position: relative;
  width: 38px; height: 38px; padding: 0; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--b-r-sm);
  color: var(--b-muted);
  transition: background var(--b-fast), color var(--b-fast);
}
.b-icon-btn:hover { background: var(--b-raised); color: var(--b-text); }
.b-icon-btn > .notification { display: contents; } /* обёртка бейджа без собственного бокса: не создаёт вторую строку grid и не сбивает позиционирование бейджа */
.b-icon-btn #main_notifications_badge:not(:empty) {
  position: absolute; top: 5px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--b-accent); color: var(--b-accent-ink);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--b-bg);
}

/* popovers: notifications / user menu / language (NEO toggles .modalActive) */
.b-pop-wrap { position: relative; }
.b-nav .b-pop {
  position: absolute; top: calc(100% + 12px); right: 0; left: auto;
  width: 340px; padding: 6px;
  background: var(--b-raised); border: 1px solid var(--b-line-strong); border-radius: var(--b-r);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  transform: translateY(-4px) scale(.98); transform-origin: top right;
}
.b-nav .b-pop.modalActive { transform: none; }
.b-pop--sm { width: 220px !important; }
.b-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 10px; }
.b-pop__head b { font-size: 15px; }
.b-nav .b-link-btn { width: auto; height: auto; padding: 4px 6px; background: none; border: 0; color: var(--b-muted); font-size: 12px; gap: 6px; }
.b-nav .b-link-btn:hover { background: none; color: var(--b-red); }
.b-pop .notifications__main { max-height: 380px; overflow-y: auto; }

.b-menu { width: 250px !important; }
.b-menu hr { border: 0; border-top: 1px solid var(--b-line); margin: 6px 0; }
.b-nav .b-menu__item {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  width: 100%; height: auto; padding: 9px 10px;
  background: none; border: 0; border-radius: var(--b-r-xs);
  color: var(--b-text); font: 500 14px/1.3 var(--b-font); text-align: left; text-decoration: none;
}
.b-nav .b-menu__item:hover { background: var(--b-hover); color: var(--b-text); }
.b-nav .b-menu__item > svg { width: 17px; height: 17px; color: var(--b-muted); }
.b-nav .b-menu__item > svg:not(.b-icon) { fill: currentColor; }
.b-nav .b-menu__item--danger, .b-nav .b-menu__item--danger > svg { color: var(--b-red); }

/* аккаунт: ник и баланс + «+» пополнения в одной плашке */
.b-nav .b-acct { display: flex; align-items: center; height: 42px; padding-right: 4px; background: var(--b-surface); border: 1px solid var(--b-line); border-radius: 999px; transition: border-color var(--b-fast); }
.b-nav .b-acct:hover { border-color: var(--b-line-strong); }
.b-nav .b-user {
  display: flex; align-items: center; gap: 10px;
  width: auto; height: 40px; padding: 2px 8px 2px 2px;
  background: none; border: 0; border-radius: 999px;
  color: var(--b-text);
}
.b-nav .b-user:hover { background: none; }
.b-nav .b-topup {
  width: 32px; height: 32px; padding: 0; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--b-accent-16); color: var(--b-accent);
  transition: background var(--b-fast), color var(--b-fast), transform var(--b-fast);
}
.b-nav .b-topup:hover { background: var(--b-accent); color: var(--b-accent-ink); }
.b-nav .b-topup:active { transform: scale(.94); }
.b-nav .b-topup .b-icon { width: 16px; height: 16px; stroke-width: 2.4; }
.b-user__who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; max-width: 140px; }
.b-user__who b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-user__balance { font-size: 12px; color: var(--b-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.b-nav .b-user .b-user__chev { width: 13px; height: 13px; color: var(--b-muted); }

.b-avatar { --size: 36px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; flex: none; background: var(--b-raised); display: inline-block; }
.b-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-avatar--sm { --size: 34px; }
.b-avatar--lg { --size: 56px; }
.b-avatar--xl { --size: 96px; }

/* burger + mobile menu (NEO toggles .mmactive) */
.b-burger { display: none !important; }
.b-nav .b-burger::before, .b-nav .b-burger::after { content: none !important; display: none !important; }
.b-nav .b-burger { position: relative; background: transparent; border: 0; margin: 0; width: 38px; height: 38px; }
.b-nav .b-burger span { position: relative; top: auto; left: auto; width: 18px; background-color: currentColor; transform: none !important; }
.b-nav .b-burger.mmactive span { background-color: transparent; }
.b-burger span, .b-burger span::before, .b-burger span::after {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative;
  transition: transform var(--b-mid) var(--b-ease), background var(--b-fast);
}
.b-burger span::before, .b-burger span::after { content: ""; position: absolute; left: 0; }
.b-burger span::before { top: -6px; }
.b-burger span::after { top: 6px; }
.b-burger.mmactive span { background: transparent; }
.b-burger.mmactive span::before { transform: translateY(6px) rotate(45deg); }
.b-burger.mmactive span::after { transform: translateY(-6px) rotate(-45deg); }

.nav_header_menu.b-mobile-menu {
  position: fixed; inset: var(--b-nav-h) 0 0 0; z-index: 99;
  display: none; flex-direction: column;
  padding: 12px 20px 100px; overflow-y: auto;
  background: var(--b-bg);
}
.nav_header_menu.b-mobile-menu.mmactive { display: flex; animation: b-fade var(--b-mid) var(--b-ease); }
.b-mobile-menu__item { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--b-line); color: var(--b-text); font-size: 17px; font-weight: 500; text-decoration: none; }
.b-mobile-menu__item svg { width: 19px; height: 19px; color: var(--b-muted); }
.b-mobile-menu__item svg:not(.b-icon) { fill: currentColor; }

/* footer */
.b-footer { border-top: 1px solid var(--b-line); padding: 40px 0 44px; color: var(--b-muted); font-size: 14px; background: transparent; }
.b-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.b-footer h4 { color: var(--b-text); font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.b-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.b-footer a { color: var(--b-muted); text-decoration: none; transition: color var(--b-fast); }
.b-footer a:hover { color: var(--b-text); }
.b-footer .b-logo { display: inline-flex; width: max-content; }
.b-footer__about p { margin: 14px 0 0; max-width: 38ch; line-height: 1.55; }
.b-socials { display: flex; gap: 8px; margin-top: 16px; }
.b-socials a { width: 38px; height: 38px; border-radius: var(--b-r-sm); display: grid; place-items: center; background: var(--b-surface); border: 1px solid var(--b-line); }
.b-socials a:hover { border-color: var(--b-line-strong); }
.b-footer__legal { grid-column: 1 / -1; border-top: 1px solid var(--b-line); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--b-dim); }

/* mobile tabbar */
.tabbar_mobile.b-tabbar { display: none; }

/* confirm dialog (modules use #modal) */
dialog.b-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 22px;
  background: var(--b-surface); color: var(--b-text);
  border: 1px solid var(--b-line-strong); border-radius: var(--b-r-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog.b-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
dialog.b-dialog h3 { margin: 0 0 8px; font-size: 19px; }
dialog.b-dialog .dialog-content { color: var(--b-muted); font-size: 14px; }
dialog.b-dialog .dialog-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

/* 5. Components ------------------------------------------------------------ */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; height: 40px; padding: 0 16px; border-radius: var(--b-r-sm);
  border: 1px solid transparent; background: var(--b-raised); color: var(--b-text);
  font: 600 14px/1 var(--b-font); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background var(--b-fast), border-color var(--b-fast), color var(--b-fast), transform var(--b-fast);
}
.b-btn:hover { background: var(--b-hover); color: var(--b-text); }
.b-btn:active { transform: translateY(1px); }
.b-btn:focus { border-color: transparent; }
.b-btn svg { fill: none; }
.b-btn--primary { background: var(--b-accent); color: var(--b-accent-ink); }
.b-btn--primary:hover { background: var(--b-accent-hover); color: var(--b-accent-ink); }
.b-btn--soft { background: var(--b-accent-8); color: var(--b-accent); }
.b-btn--soft:hover { background: var(--b-accent-16); color: var(--b-accent); }
.b-btn--ghost { background: transparent; border-color: var(--b-line-strong); }
.b-btn--ghost:hover { background: var(--b-raised); }
.b-btn--danger { background: var(--b-red-12); color: var(--b-red); }
.b-btn--danger:hover { background: rgba(240, 98, 90, .2); color: var(--b-red); }
.b-btn--lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--b-r); }
.b-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.b-btn--block { width: 100%; }
.b-btn--square { width: 40px; padding: 0; }
.b-btn--sm.b-btn--square { width: 32px; }
.b-btn:disabled { opacity: .5; cursor: default; }

.b-card { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg); }
.b-card--pad { padding: 20px; }
.b-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.b-card__head h2, .b-card__head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.b-card__link { font-size: 13px; color: var(--b-muted); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.b-card__link:hover { color: var(--b-text); }

.b-section { margin-top: 36px; }
.b-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.b-section-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.b-section-head p { margin: 2px 0 0; color: var(--b-muted); font-size: 14px; }

.b-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--b-raised); color: var(--b-muted);
}
.b-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-badge--accent { background: var(--b-accent-8); color: var(--b-accent); }
.b-badge--green { background: var(--b-green-12); color: var(--b-green); }
.b-badge--amber { background: var(--b-amber-12); color: var(--b-amber); }
.b-badge--red { background: var(--b-red-12); color: var(--b-red); }
.b-badge--blue { background: var(--b-blue-12); color: var(--b-blue); }
.b-badge-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.b-chip {
  display: inline-flex; align-items: center; gap: 7px;
  width: auto; height: 30px; padding: 0 11px; border-radius: var(--b-r-sm);
  background: var(--b-raised); border: 1px solid var(--b-line);
  font-size: 13px; font-weight: 500; color: var(--b-muted); white-space: nowrap; text-decoration: none;
}
.b-chip b { color: var(--b-text); font-weight: 600; }
button.b-chip:hover, a.b-chip:hover { color: var(--b-text); border-color: var(--b-line-strong); background: var(--b-raised); }
.b-chip.is-active { color: var(--b-accent); border-color: var(--b-accent-30); background: var(--b-accent-8); }

.b-body .b-seg { display: inline-flex; flex-direction: row; flex-wrap: nowrap; padding: 3px; gap: 2px; border-radius: var(--b-r-sm); background: var(--b-raised); border: 1px solid var(--b-line); }
.b-seg button, .b-seg a { width: auto; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--b-muted); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.b-seg button:hover, .b-seg a:hover { background: none; color: var(--b-text); }
.b-seg .is-active, .b-seg .is-active:hover { background: var(--b-hover); color: var(--b-text); }

.b-rows { padding: 8px; }
.b-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: var(--b-r); border: 0; background: none;
  color: var(--b-text); text-align: left; text-decoration: none; height: auto;
  transition: background var(--b-fast);
}
a.b-row:hover, button.b-row:hover { background: var(--b-raised); color: var(--b-text); }
.b-row__main { flex: 1; min-width: 0; }
.b-row__title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.b-row__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-row__sub { font-size: 13px; color: var(--b-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.b-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.b-row__time { font-size: 12px; color: var(--b-dim); }

.b-fill { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.b-fill i { display: block; height: 100%; width: var(--p, 0%); background: var(--b-accent); border-radius: inherit; transform-origin: left; animation: b-fill 1.1s var(--b-ease) both; animation-delay: var(--d, 0ms); }
.b-fill--hot i { background: linear-gradient(90deg, var(--b-accent), #ffb3d9); }
@keyframes b-fill { from { transform: scaleX(0); } }

.b-empty { padding: 36px 20px; text-align: center; color: var(--b-muted); font-size: 14px; }

.b-skeleton { background: linear-gradient(90deg, var(--b-raised) 0%, var(--b-hover) 50%, var(--b-raised) 100%); background-size: 200% 100%; animation: b-shimmer 1.3s linear infinite; border-radius: var(--b-r-xs); }
@keyframes b-shimmer { to { background-position: -200% 0; } }
@keyframes b-fade { from { opacity: 0; transform: translateY(4px); } }

/* side navigation (profile, moderator cabinet) */
.b-side { position: sticky; top: calc(var(--b-nav-h) + 20px); display: flex; flex-direction: column; gap: 2px; align-self: start; }
.b-side a, .b-body .b-side button {
  display: flex; align-items: center; gap: 11px; width: 100%; height: auto;
  padding: 10px 12px; border: 0; border-radius: var(--b-r-sm); background: none;
  color: var(--b-muted); font: 500 14px/1.3 var(--b-font); text-align: left; text-decoration: none;
  transition: background var(--b-fast), color var(--b-fast);
}
.b-side a:hover, .b-body .b-side button:hover { background: var(--b-surface); color: var(--b-text); }
.b-side .is-active, .b-side .is-active:hover { background: var(--b-surface); color: var(--b-text); }
.b-side .is-active .b-icon { color: var(--b-accent); }
.b-side__count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--b-accent); color: var(--b-accent-ink); font-size: 12px; font-weight: 700; text-align: center; }
.b-side__group { padding: 16px 12px 6px; font-size: 12px; color: var(--b-dim); }

/* form fields */
.b-body .b-field { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 7px; flex: 1; min-width: 0; text-align: left; margin: 0; }
.b-field > span { font-size: 13px; font-weight: 500; color: var(--b-muted); }
.b-body .b-field input, .b-body .b-field textarea, .b-body .b-field select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--b-r-sm);
  background: var(--b-raised); border: 1px solid var(--b-line); color: var(--b-text); font-size: 14px;
  transition: border-color var(--b-fast), background var(--b-fast);
}
.b-body .b-field textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.b-body .b-field input:focus, .b-body .b-field textarea:focus { border-color: var(--b-accent-30); background: var(--b-hover); outline: none; filter: none; }
.b-field-row { display: flex; gap: 12px; }
.b-hint { font-size: 12px; color: var(--b-dim); }

/* modal (basement pages) */
.b-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity var(--b-mid) var(--b-ease);
}
.b-modal.is-open { opacity: 1; pointer-events: auto; }
.b-modal__box {
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--b-surface); border: 1px solid var(--b-line-strong); border-radius: var(--b-r-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transform: translateY(8px) scale(.97); transition: transform var(--b-mid) var(--b-ease);
}
.b-modal.is-open .b-modal__box { transform: none; }
.b-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.b-modal__head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.b-modal__body { padding: 18px 22px 22px; overflow-y: auto; }
.b-punish { display: flex; flex-direction: column; gap: 16px; } /* общая модалка наказания (главная, репорты, наказания) */
.b-punish .b-chips-row { margin-top: -8px; }
.b-punish .b-summary[hidden] { display: none; }
.b-modal__close { width: 34px !important; height: 34px !important; padding: 0 !important; border-radius: 50% !important; border: 0; background: var(--b-raised) !important; color: var(--b-muted) !important; display: grid !important; place-items: center; flex: none; }
.b-modal__close:hover { background: var(--b-hover) !important; color: var(--b-text) !important; }

.b-toasts { position: fixed; z-index: 2000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.b-toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--b-r); background: var(--b-raised); border: 1px solid var(--b-line-strong); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 500; animation: b-toast-in var(--b-mid) var(--b-ease); }
.b-toast .b-icon { color: var(--b-green); }
.b-toast.is-error .b-icon { color: var(--b-red); }
.b-btn.is-busy { opacity: .6; pointer-events: none; }
.b-toast.is-out { animation: b-toast-out var(--b-mid) var(--b-ease) forwards; }
@keyframes b-toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes b-toast-out { to { opacity: 0; transform: translateY(6px); } }

/* page title */
.b-page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.b-page-title h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.b-page-title h1 .b-icon { color: var(--b-accent); width: 24px; height: 24px; }

/* reveal on scroll (basement.js добавляет .is-in) */
.b-reveal { opacity: 0; transform: translateY(10px); transition: opacity 500ms var(--b-ease), transform 500ms var(--b-ease); }
.b-reveal.is-in { opacity: 1; transform: none; }


/* layout: боковое меню + контент (профиль, кабинет модератора) */
.b-split { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.b-split__content { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.b-split__content > .b-page-title { margin-bottom: 4px; }

/* плитки-счётчики */
.b-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.b-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
  background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg);
  color: var(--b-text); text-decoration: none; transition: border-color var(--b-fast), transform var(--b-fast);
}
a.b-tile:hover { border-color: var(--b-line-strong); color: var(--b-text); transform: translateY(-1px); }
.b-tile__label { font-size: 13px; color: var(--b-muted); font-weight: 500; }
.b-tile__value { font: 600 34px/1.05 var(--b-display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.b-tile__delta { font-size: 12px; color: var(--b-dim); }
.b-tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.b-tile--accent { background: linear-gradient(145deg, var(--b-accent-16), var(--b-surface) 70%); border-color: var(--b-accent-16); }
.b-tile--accent .b-tile__value { color: var(--b-accent); }

/* таблицы basement */
.b-table-wrap { overflow-x: auto; }
.b-body .b-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.b-body .b-table th { padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 500; color: var(--b-muted); border-bottom: 1px solid var(--b-line); white-space: nowrap; line-height: 1.3; }
.b-body .b-table td { padding: 11px 14px; border-bottom: 1px solid var(--b-line); vertical-align: middle; font-weight: 400; color: var(--b-text); }
.b-body .b-table td.b-muted { color: var(--b-muted); }
.b-body .b-table td.b-dim { color: var(--b-dim); }
.b-body .b-table tbody tr:last-child td { border-bottom: 0; }
.b-body .b-table tbody tr { transition: background var(--b-fast); }
.b-body .b-table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.b-table__num { text-align: right !important; font-variant-numeric: tabular-nums; }
.b-table__wrap { max-width: 320px; overflow-wrap: anywhere; }
.b-table tr.is-past { opacity: .55; }

.b-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 260px; color: var(--b-text); text-decoration: none; font-weight: 500; }
.b-who > span:not(.b-avatar):not(.b-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.b-who:hover { color: var(--b-accent); }
.b-avatar--xs { --size: 26px; }

/* пагинация */
.b-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.b-pager a, .b-pager span {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--b-r-sm);
  display: inline-grid; place-items: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--b-muted); text-decoration: none; background: var(--b-surface); border: 1px solid var(--b-line);
}
.b-pager a:hover { color: var(--b-text); border-color: var(--b-line-strong); }
.b-pager .is-active { background: var(--b-accent); border-color: var(--b-accent); color: var(--b-accent-ink); }
.b-pager span:not(.is-active) { background: none; border-color: transparent; }

/* ряды чипов, панель фильтров, хлебные крошки */
.b-chips-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.b-chips-row::-webkit-scrollbar { display: none; }
.b-chips-row--wrap { flex-wrap: wrap; overflow: visible; }
.b-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-toolbar__search { margin-left: auto; position: relative; display: flex; align-items: center; }
.b-toolbar__search .b-icon { position: absolute; left: 12px; color: var(--b-dim); pointer-events: none; }
.b-body .b-toolbar__search input { width: 240px; height: 38px; padding: 0 12px 0 36px; background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-sm); color: var(--b-text); }
.b-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--b-dim); flex-wrap: wrap; }
.b-crumbs a { color: var(--b-muted); text-decoration: none; }
.b-crumbs a:hover { color: var(--b-text); }
.b-crumbs .b-icon { color: var(--b-dim); }

/* переключатель */
.b-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--b-muted); user-select: none; position: relative; }
.b-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.b-toggle > span { width: 38px; height: 22px; border-radius: 999px; background: var(--b-hover); position: relative; flex: none; transition: background var(--b-fast); }
.b-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #bdbdbd; transition: transform var(--b-mid) var(--b-ease), background var(--b-fast); }
.b-toggle input:checked + span { background: var(--b-accent); }
.b-toggle input:checked + span::after { transform: translateX(16px); background: var(--b-accent-ink); }
.b-toggle input:focus-visible + span { outline: 2px solid var(--b-accent); outline-offset: 2px; }

/* копирование SteamID */
.b-body .b-copy { display: inline-flex; align-items: center; gap: 6px; width: auto; height: auto; padding: 0; border: 0; background: none; color: var(--b-muted); font: 500 13px/1.3 var(--b-font); font-variant-numeric: tabular-nums; cursor: pointer; }
.b-body .b-copy:hover { background: none; color: var(--b-text); }

/* пресеты срока, сегмент на всю ширину, итог */
.b-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.b-body .b-presets button { width: 100%; height: 38px; padding: 0 6px; border: 1px solid var(--b-line); border-radius: var(--b-r-sm); background: var(--b-raised); color: var(--b-muted); font-size: 13px; font-weight: 600; }
.b-body .b-presets button:hover { color: var(--b-text); border-color: var(--b-line-strong); background: var(--b-raised); }
.b-body .b-presets button.is-active { color: var(--b-accent); border-color: var(--b-accent-30); background: var(--b-accent-8); }
.b-body .b-seg--fill { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.b-seg--fill button { justify-content: center; }
.b-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--b-r-sm); background: var(--b-raised); font-size: 14px; }
.b-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.b-form > .b-field, .b-form > .b-field-row { width: 100%; }
.b-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* место в рейтинге */
.b-place { width: 24px; text-align: center; font: 600 17px/1 var(--b-display); color: var(--b-dim); flex: none; font-variant-numeric: tabular-nums; }
.b-place--1 { color: #ffd66b; }
.b-place--2 { color: #cfe3ff; }
.b-place--3 { color: #f5ab85; }
.b-fill--thin { height: 3px; margin-top: 6px; max-width: 220px; }
.b-rows--flush { padding: 0; width: 100%; }

/* карточка отзыва (главная, страница отзывов) */
.b-rev-avg { display: inline-flex; align-items: center; gap: 4px; color: var(--b-accent); font-weight: 600; }
.b-rev-avg .b-icon { fill: currentColor !important; stroke: none; }
.b-review { scroll-snap-align: start; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.b-review__head { display: flex; align-items: center; gap: 12px; }
.b-review__head b { display: block; font-size: 14px; }
.b-stars { display: flex; gap: 2px; margin-top: 3px; }
.b-star { width: 14px; height: 14px; fill: var(--b-accent); }
.b-star.is-off { fill: var(--b-hover); }
.b-review__text {
  margin: 0; color: #c9c9c9; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.b-review__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--b-dim); }
.b-body .b-like {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: 30px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent; color: var(--b-muted); font-size: 13px;
}
.b-body .b-like:hover { background: var(--b-raised); color: var(--b-accent); }
.b-body .b-like.is-on { color: var(--b-accent); }
.b-like.is-on .b-icon { fill: currentColor !important; }

/* 7. Responsive ------------------------------------------------------------ */
@media (max-width: 1280px) {
  .b-nav__in { gap: 18px; }
  .b-nav .b-nav__link { padding: 0 9px; }
}
@media (max-width: 1519px) {
  /* поиск — круглая кнопка; по фокусу поле открывается ПОД шапкой, ничего не двигая и не перекрывая меню */
  .b-nav .b-search { width: 38px; }
  .b-nav .b-search .search-input-block { width: 38px; padding: 0; cursor: pointer; }
  .b-nav .b-search .search-input-block::placeholder { color: transparent; }
  .b-nav .b-search:focus-within .modal-searchcontent { top: calc(100% + 12px); }
  .b-nav .b-search .search-input-block:focus { width: min(320px, calc(100vw - 32px)); padding: 0 12px 0 38px; cursor: text; background: var(--b-raised); border-color: var(--b-accent-30); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
  .b-nav .b-search .search-input-block:focus::placeholder { color: var(--b-dim); }
  .b-nav .b-search:focus-within .modal_users_container { top: calc(100% + 62px); width: min(320px, calc(100vw - 32px)); }
}
}

@media (max-width: 1200px) {
  .b-nav .b-nav__link > span { display: none; }
  .b-nav .b-nav__link { padding: 0 10px; }
  .b-nav .b-nav__link > .b-icon--xs { display: none; }
}

@media (max-width: 1100px) {
  .b-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-search { display: none; }
}

@media (max-width: 860px) {
  :root { --b-gutter: 16px; }
  .b-side { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--b-gutter) * -1); padding-inline: var(--b-gutter); gap: 6px; }
  .b-side::-webkit-scrollbar { display: none; }
  .b-side a, .b-body .b-side button { width: auto; white-space: nowrap; background: var(--b-surface); }
  .b-side__group { display: none; }
  .b-split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .b-toolbar__search { margin-left: 0; width: 100%; }
  .b-body .b-toolbar__search input { width: 100%; }
  .b-field-row { flex-direction: column; }
  .b-nav__links, .b-online { display: none; }
  .b-burger { display: grid !important; }
  .b-user__who, .b-nav .b-user .b-user__chev { display: none; }
  .b-nav .b-user { padding: 2px; }
  .b-nav .b-pop { position: fixed; top: calc(var(--b-nav-h) + 8px); left: 12px; right: 12px; width: auto !important; }
  .container-fluid.b-main { padding: 18px 0 96px; }
  .b-footer { padding-bottom: 100px; }
  .b-footer__grid { grid-template-columns: 1fr 1fr; }
  .b-footer__about { grid-column: 1 / -1; }

  .tabbar_mobile.b-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 98;
    display: flex; justify-content: space-around; gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(17, 17, 17, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--b-line);
  }
  .b-tabbar a, .b-tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: auto; height: auto; padding: 6px 0; border: 0; background: none; border-radius: var(--b-r-sm);
    color: var(--b-muted); font: 500 11px/1 var(--b-font); text-decoration: none; text-transform: none; letter-spacing: 0;
  }
  .b-tabbar a:hover, .b-tabbar button:hover { background: none; color: var(--b-text); }
  .b-tabbar .is-active { color: var(--b-accent); }
  .b-tabbar .b-icon { width: 21px; height: 21px; }
}

@media (max-width: 640px) {
  .b-logo__name { display: none; }
  .b-section { margin-top: 28px; }
  .b-section-head h2 { font-size: 20px; }
  .b-page-title h1 { font-size: 23px; }
  .b-footer__grid { grid-template-columns: 1fr; }
  .b-modal { padding: 0; place-items: end center; }
  .b-tile { padding: 14px 16px; }
  .b-tile__value { font-size: 28px; }
  .b-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-modal__box { max-width: none; border-radius: var(--b-r-lg) var(--b-r-lg) 0 0; max-height: 92vh; transform: translateY(40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .b-reveal { opacity: 1; transform: none; }
}
