/* ==========================================================================
   Mavicovod — дизайн в духе нового VK / YouTube для темы premium_social
   Подключается ПОСЛЕДНИМ (после styles.css и night.css) и переопределяет их.
   Тёмная тема = когда на странице есть <link id="design-stylesheet">
   (штатный переключатель «Ночной режим» движка).
   ========================================================================== */

/* ---------- 1. Токены ---------- */
:root {
  /* светлая — как VK */
  --bg: #EBEDF0;
  --surface: #FFFFFF;
  --surface-2: #F2F3F5;
  --surface-3: #E6E8EB;
  --header: #FFFFFF;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --text: #000000;
  --text-2: #2C2D2E;
  --muted: #818C99;
  --accent: #0077FF;
  --accent-soft: rgba(0, 119, 255, .10);
  --link: #2A5885;
  --btn-bg: #0077FF;
  --btn-ink: #FFFFFF;
  --chip-on-bg: #000000;
  --chip-on-ink: #FFFFFF;
  --bubble-my: #CCE4FF;
  --bubble-my-ink: #000000;
  --signal: #FF3347;
  --ok: #4BB34B;
  --danger: #E64646;
  --card-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .05);
  --pop-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .16);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --top-h: 56px;
  --nav-h: 56px;
  --container: 1220px;
  --gutter: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Roboto", "Inter", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

html:has(#design-stylesheet) {
  /* тёмная — как YouTube / VK dark */
  --bg: #0F0F0F;
  --surface: #1C1C1D;
  --surface-2: #272728;
  --surface-3: #323234;
  --header: #0F0F0F;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #F1F1F1;
  --text-2: #DADADB;
  --muted: #9A9A9C;
  --accent: #3EA6FF;
  --accent-soft: rgba(62, 166, 255, .14);
  --link: #71AAEB;
  --btn-bg: #F1F1F1;
  --btn-ink: #0F0F0F;
  --chip-on-bg: #F1F1F1;
  --chip-on-ink: #0F0F0F;
  --bubble-my: #2B4566;
  --bubble-my-ink: #F1F1F1;
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, .05);
  --pop-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 16px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- 2. База ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
  font-family: var(--font) !important;
  font-size: 14.5px !important;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg) !important;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-decoration: none; }
b, strong { font-weight: 600; }
h1, h2, h3 { color: var(--text); letter-spacing: -.01em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.body-circle, .body-circle2,
.new-panel-top::before, .new-panel-top::after { display: none !important; }

/* ---------- 3. Шапка ---------- */
.new-panel-top,
.new-panel-top.active {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  height: var(--top-h) !important;
  box-sizing: border-box;
  padding: 0 var(--gutter) !important;
  display: flex !important;
  align-items: center;
  gap: 4px;
  background: var(--header) !important;
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 105 !important;
}

.pnl-left { flex: 0 0 auto; display: none; }
.pnl-left img { display: block; width: 34px; height: 34px; object-fit: contain; position: static !important; }

.new-panel-top-info,
.new-panel-top.active > .new-panel-top-info {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: auto !important;
  line-height: 1.2 !important;
  padding: 0 6px !important;
  color: var(--text) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* круглые кнопки-иконки (телефон) */
.new-panel-top-button,
.new-panel-top.active > .new-panel-top-button {
  flex: 0 0 auto;
  width: 40px !important;
  height: 40px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  color: var(--text) !important;
  cursor: pointer;
}
.new-panel-top-button:hover, .new-panel-top-button:active { background: var(--surface-2); }
.new-panel-top-button i,
.new-panel-top.active > .new-panel-top-button i {
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-size: 24px !important;
  background: none !important;
  color: var(--text) !important;
  border-radius: 0 !important;
}
.new-panel-top-button span { position: relative; display: grid; place-items: center; }
.new-panel-top-button b {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 8px !important;
  height: 8px !important;
  background: var(--signal) !important;
  border: 2px solid var(--header);
  border-radius: 50%;
}

/* поиск в шапке (ПК) */
.mv-search { display: none; }

/* правая группа (ПК) */
.pnl-right {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
}
.pnlr, .pnlr-plus {
  width: 40px !important;
  height: 40px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  position: relative;
  border-radius: 50%;
  color: var(--text) !important;
  cursor: pointer;
}
.pnlr:hover { background: var(--surface-2); }
.pnlr i, .pnlr-plus i,
.new-panel-top.active .pnlr i {
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-size: 23px !important;
  background: none !important;
  box-shadow: none !important;
  color: inherit !important;
  animation: none !important;
}
.pnlr span { top: 0 !important; }
.pnlr .avatar { width: 32px !important; height: 32px !important; }
.pnlr:last-child { margin-left: 6px; }
/* «Создать» — чип как в YouTube */
.pnlr-plus {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  width: auto !important;
  height: 36px !important;
  padding: 0 14px 0 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--surface-2) !important;
  color: var(--text) !important;
}
.pnlr-plus:hover { background: var(--surface-3) !important; }
.pnlr-plus i { font-size: 22px !important; color: var(--text) !important; }
.pnlr-plus::after { content: "Создать"; font-size: 14px; font-weight: 500; }

.mode_button, .mode_button2 {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border-radius: 50% !important;
  box-shadow: none !important;
}

/* меню аккаунта — открывается прямо под аватаркой */
.pr_modal {
  position: fixed !important;
  top: calc(var(--top-h) - 2px) !important;
  right: max(12px, calc(50% - var(--container) / 2)) !important;
  left: auto !important;
  transform: none !important;
  width: 280px !important;
  padding: 6px !important;
  box-sizing: border-box;
  background: var(--surface) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--pop-shadow) !important;
  border: 0 !important;
}
.pr_modal .panel-top-account { margin: 0 0 4px !important; box-shadow: none !important; background: transparent !important; }
.pr_modal .panel-top-account:hover { background: var(--surface-2) !important; }
.panel-top-account-menu {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 9px 10px !important;
  border-radius: var(--r-sm);
  color: var(--text) !important;
  font-size: 14px !important;
}
.panel-top-account-menu i { color: var(--muted); font-size: 20px !important; }
.panel-top-account-menu:hover { background: var(--surface-2) !important; }
.pr_close { background: transparent !important; }

/* ---------- 4. Карточка профиля в меню ---------- */
.panel-top-account,
.panel-left-web .panel-top-account,
.sidebar_wrap .panel-top-account {
  display: grid !important;
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  margin: 0 0 6px !important;
  padding: 8px !important;
  border-radius: var(--r) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
}
.panel-top-account:hover { background: var(--surface-2) !important; }
.panel-top-account > span:first-child { grid-row: 1 / 3; }
.panel-top-account b {
  position: static !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-top-account small { position: static !important; grid-column: 2; color: var(--muted); font-size: 13px; }
.panel-top-account > i { position: static !important; grid-column: 3; grid-row: 1 / 3; color: var(--muted); }
.panel-top-account .avatar { width: 40px !important; height: 40px !important; }

/* ---------- 5. Меню разделов (как в VK) ---------- */
.icons-circle {
  --c: var(--accent);
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  flex: 0 0 24px;
  display: inline-grid !important;
  place-items: center;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--c) !important;
}
.icons-circle i { font-size: 22px !important; line-height: 1; }

a[href*="/m/downloads"]   .icons-circle { --c: #2BB24C; }
a[href*="/m/news"]        .icons-circle { --c: #FF8A00; }
a[href*="/m/blogs"]       .icons-circle { --c: #9B51E0; }
a[href*="/m/guestbook"]   .icons-circle { --c: #F5B800; }
a[href*="/m/music"]       .icons-circle { --c: #FF3D71; }
a[href*="/m/photos"]      .icons-circle { --c: #00B2D6; }
a[href*="/m/videos"]      .icons-circle { --c: #FF3B30; }
a[href*="/m/communities"] .icons-circle { --c: #00B894; }
a[href*="/m/users"]       .icons-circle { --c: #3F8AE0; }
a[href*="/account/mail"]   .icons-circle { --c: #1E9BFF; }
a[href*="/m/forum"]       .icons-circle { --c: #7B61FF; }
a[href*="/m/clips"]       .icons-circle { --c: #FF2D55; }
a[href*="/m/services"]    .icons-circle { --c: #00A3FF; }
a[href*="/m/games"]       .icons-circle { --c: #FF9500; }
a[href*="/m/movies"]      .icons-circle { --c: #E5174D; }
a[href*="/shopping"]      .icons-circle { --c: #FF9500; }
a[href*="/account/cabinet"]  .icons-circle { --c: #5E5CE6; }
a[href*="/account/settings"],
a[href*="/admin"], a[href*="/exit"],
a[href*="/m/info"], a[href*="/m/rules"], a[href*="/m/contacts"],
a[onclick*="languages"], a[onclick*="version"],
[onclick*="DesignMode"]   .icons-circle { --c: var(--muted); }
a[href*="/admin"] .icons-circle, a[href*="/exit"] .icons-circle,
a[href*="/m/info"] .icons-circle, a[href*="/m/rules"] .icons-circle,
a[href*="/m/contacts"] .icons-circle, a[href*="/account/settings"] .icons-circle,
a[onclick*="languages"] .icons-circle, a[onclick*="version"] .icons-circle { --c: var(--muted); }

.panel-left-menu {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin: 0 !important;
  padding: 6px 10px !important;
  box-sizing: border-box;
  border-radius: var(--r-sm) !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 400;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}
.panel-left-menu:hover, .panel-left-menu.hover:hover { background: var(--surface-3) !important; }
.panel-left-menu > span:not(.icons-circle):first-of-type { flex: 1; }
.panel-left-menu > span[style*="absolute"] {
  position: static !important;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.panel-left-menu .mode_button2 { position: static !important; margin-left: auto; width: 28px; height: 28px; display: grid !important; place-items: center; }
.pfm_gray { white-space: nowrap; }
.pfm_gray b { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.panel-left-title {
  height: 1px;
  margin: 10px 10px !important;
  padding: 0 !important;
  background: var(--line);
  font-size: 0 !important;
  overflow: hidden;
  color: transparent !important;
}

/* боковая шторка (телефон) */
.sidebar_wrap {
  width: min(300px, 84vw) !important;
  padding: 10px 10px calc(14px + var(--safe-b)) !important;
  background: var(--surface) !important;
  border-right: 0;
  border-radius: 0 16px 16px 0;
  box-shadow: var(--pop-shadow) !important;
  overflow-y: auto !important;
  z-index: 110 !important;
}
.sidebar_wrap > a:first-child img { width: 36px; height: 36px; object-fit: contain; margin: 4px 0 10px 8px !important; }
.sidebar_wrap #sidebar_hide {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
}
.sidebar_wrap #sidebar_hide:hover { background: var(--surface-2); }
.sidebar_wrap #sidebar_hide i { font-size: 22px !important; position: static !important; transform: none !important; }
.sidebar_wrap .icons-circle { width: 26px !important; height: 26px !important; flex-basis: 26px; }
.sidebar_wrap .panel-left-menu { min-height: 44px; font-size: 15px !important; }
.sidebar_hide {
  background: rgba(0, 0, 0, .5) !important;
  z-index: 109 !important;
}

/* ---------- 6. Сетка ---------- */
#content { position: relative; }
.content-fixed {
  margin: calc(var(--top-h) + 8px) 0 0 !important;
  padding: 0 8px !important;
  width: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  box-sizing: border-box;
  z-index: auto !important; /* иначе модальные окна уходят под навигацию */
}
#ajax_load { width: auto !important; display: block !important; }

.modal_phone, .modal_phone5, .modal_phone_alt, .modal_phone_center { z-index: 108 !important; }
.modal_bottom, .modal_bottom_alt, .modal_bottom5, .modal_center { z-index: 109 !important; }

/* ---------- 7. Карточки ---------- */
.list, .list-body, .gc3 {
  background: var(--surface) !important;
  color: var(--text);
  border: 0 !important;
  border-radius: var(--r) !important;
  box-shadow: var(--card-shadow) !important;
  margin: 0 0 12px !important;
  padding: 16px !important;
  box-sizing: border-box;
}
.list-body { padding: 0 !important; overflow: hidden; }

.list-menu {
  background: transparent !important;
  color: var(--text) !important;
  border: 0 !important;
  padding: 11px 16px !important;
  bottom: 0 !important;
}
.list-menu.hover, .hover { transition: background .12s; }
.list-menu.hover:hover, a:hover > .list-menu.hover { background: var(--surface-2) !important; }
.list-menu i { color: var(--muted); }

.right-list-title {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}
.right-list-title i { display: none !important; }
.right-list-a {
  display: flex !important;
  align-items: center;
  border-top: 1px solid var(--line) !important;
  font-size: 14px;
  color: var(--link) !important;
}
.right-list-a b { font-weight: 500; }
.right-list-a span { margin-left: auto; float: none !important; color: var(--muted); }

/* пустые состояния */
.list2 { box-shadow: none !important; background: transparent !important; color: var(--muted) !important; }
.right-list-empty { padding: 10px 16px 16px !important; color: var(--muted) !important; }
.right-list-empty .list2, .right-list-empty .list2 > * {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  text-align: left !important;
}
.right-list-empty .list2 { display: flex !important; align-items: center; gap: 10px; font-size: 14px; }
.right-list-empty .list2 > span { display: contents !important; }
.right-list-empty .list2 i { font-size: 20px !important; color: var(--muted); width: auto !important; }

/* ---------- 8. Аватары ---------- */
img.avatar { border-radius: 50% !important; object-fit: cover; }
.avatar-o { border-radius: 50% !important; }
.avatar-online-web, .avatar-online-touch {
  position: absolute !important;
  right: 0 !important; bottom: 0 !important; left: auto !important; top: auto !important;
  width: 12px !important; height: 12px !important;
  min-width: 0 !important; padding: 0 !important;
  border-radius: 50% !important;
  background: var(--ok) !important;
  border: 2px solid var(--surface) !important;
  box-shadow: none !important;
  font-size: 0 !important; line-height: 0 !important;
}
.avatar-online-web *, .avatar-online-touch * { display: none !important; }
.user-login-mini a, .user-login a { color: var(--text) !important; }
.time { color: var(--muted) !important; font-size: 13px !important; }

/* ---------- 9. Посты ---------- */
.list[id^="show"] { padding: 14px 16px 12px !important; }
.list[id^="show"] .user-avatar-mini { width: 50px !important; }
.list[id^="show"] .user-avatar-mini .avatar { width: 40px !important; height: 40px !important; }
.list[id^="show"] .user-login-mini span[style] { top: 9px !important; left: 0 !important; font-size: 14.5px; }
.list[id^="show"] .user-login-mini b { font-weight: 600; }
.list[id^="show"] > div[style*="margin-top"] > br:first-child { display: none; }
.list[id^="show"] > div[style*="margin-top"] { margin-top: 10px !important; font-size: 15px; line-height: 1.5; color: var(--text); }
.list .img, .list img.img {
  display: block;
  width: 100%;
  max-width: 100% !important;
  border-radius: var(--r-sm) !important;
}
.list-ell {
  top: 12px !important;
  right: 8px !important;
  width: 36px; height: 36px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  color: var(--muted) !important;
}
.list-ell:hover { background: var(--surface-2); }

/* кнопки под постом — «пилюли» как в VK */
.wall_menu3 {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin: 8px 6px 0 0 !important;
  padding: 0 12px !important;
  border-radius: 999px;
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.wall_menu3 i { font-size: 20px !important; }
.wall_menu3:hover { background: var(--surface-3) !important; color: var(--text) !important; }
.wall_menu3 > span { display: inline-flex !important; align-items: center; gap: 6px; position: static !important; }
.wall_menu3 .lcount:empty, .wall_menu3 span:empty { display: none !important; }
.list[id^="show"] > span[style*="float: right"] { top: 14px !important; }

/* ---------- 10. Вкладки — «чипсы» как в YouTube ---------- */
.menu-nav-content {
  display: flex !important;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu-nav-content::-webkit-scrollbar { display: none; }
.menu-nav {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 32px !important;
  line-height: normal !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  transition: background .12s;
}
html:not(:has(#design-stylesheet)) .menu-nav { background: var(--surface) !important; box-shadow: var(--card-shadow); }
.menu-nav i { font-size: 17px !important; }
.menu-nav:hover { background: var(--surface-3) !important; }
.menu-nav.h, html:not(:has(#design-stylesheet)) .menu-nav.h {
  background: var(--chip-on-bg) !important;
  color: var(--chip-on-ink) !important;
  box-shadow: none;
}

/* ---------- 11. Кнопки ---------- */
.btn, .btn-page, .button, .comments-button, .panel-top-optimize, .avatar_button, .screensaver_button,
button.button, input[type="submit"].button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  background: var(--btn-bg) !important;
  background-image: none !important;
  color: var(--btn-ink) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  cursor: pointer;
  box-sizing: border-box;
}
.btn:hover, .button:hover, .comments-button:hover { filter: brightness(.94); }
html:has(#design-stylesheet) .btn:hover, html:has(#design-stylesheet) .button:hover { filter: brightness(.88); }
.btn-o {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  font-weight: 500;
}

/* ---------- 12. Формы ---------- */
.form-control-textarea, .captcha1, .form-control-100, .form-control-50, .form-control-30, .form-control-20,
.form-control-100-modify-select, .form-control-50-modify-select, .form-control-30-modify-select, .form-control-20-modify-select,
.comments-textarea, textarea, select,
input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="number"], input[type="tel"], input[type="url"] {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 14.5px !important;
  outline: none !important;
}
.form-control-textarea:focus, .captcha1:focus, .form-control-100:focus, .form-control-50:focus, .form-control-30:focus,
.form-control-20:focus, .comments-textarea:focus, textarea:focus, select:focus, input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent) !important;
}
::placeholder { color: var(--muted) !important; opacity: 1; }

/* ---------- 13. Нижняя навигация (телефон) ---------- */
.new-panel-bottom {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  height: calc(var(--nav-h) + var(--safe-b)) !important;
  padding: 0 0 var(--safe-b) !important;
  box-sizing: border-box;
  display: flex !important;
  align-items: stretch;
  background: var(--header) !important;
  border-top: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 104 !important;
}
.npb, .npb-plus {
  flex: 1 1 0;
  width: auto !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  color: var(--muted) !important;
}
.npb i, .npb span, .npb b { position: static !important; transform: none !important; }
.npb b { display: grid; place-items: center; position: relative !important; }
.npb i { font-size: 24px !important; }
.npb > span { font-size: 10.5px !important; font-weight: 500 !important; }
.npb.active { color: var(--text) !important; }
.npb-plus i {
  width: 38px !important;
  height: 38px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  top: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 1.5px solid var(--line-strong);
  color: var(--text) !important;
  font-size: 24px !important;
  box-shadow: none !important;
  animation: none !important;
}
.new-panel-bottom-optimize { padding: 0 !important; height: calc(var(--nav-h) + 12px + var(--safe-b)); }

/* счётчики */
.count-mess, .notif-count {
  position: absolute !important;
  top: -5px !important;
  right: -9px !important;
  left: auto !important;
  min-width: 18px;
  height: 18px !important;
  line-height: 18px !important;
  padding: 0 5px !important;
  box-sizing: border-box;
  border-radius: 999px !important;
  background: var(--signal) !important;
  color: #fff !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-align: center;
  border: 2px solid var(--header);
}
.pnlr .count-mess { top: 0 !important; right: -2px !important; }

/* гости */
.new-panel-bottom-guests {
  background: var(--header) !important;
  color: var(--text) !important;
  border-top: 1px solid var(--line);
  box-shadow: none !important;
}
.new-panel-bottom-guests a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px; margin: 0 4px;
  border-radius: var(--r-sm); font-weight: 500;
  background: var(--btn-bg); color: var(--btn-ink) !important;
}
.new-panel-bottom-guests a + a { background: var(--surface-2); color: var(--text) !important; }

/* ---------- 14. Модальные окна ---------- */
.modal_phone, .modal_phone5, .modal_phone_alt, .modal_phone_center { background: rgba(0, 0, 0, .5) !important; }
.pr_close { background: transparent !important; }
.modal_bottom, .modal_bottom_alt, .modal_bottom5 {
  background: var(--surface) !important;
  color: var(--text);
  border: 0 !important;
  border-radius: 16px 16px 0 0 !important;
  box-shadow: var(--pop-shadow) !important;
  padding-bottom: calc(8px + var(--safe-b));
  height: auto !important;
  max-height: 86vh;
  overflow-y: auto;
}
.modal_center {
  background: var(--surface) !important;
  color: var(--text);
  border: 0 !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--pop-shadow) !important;
}
.mbutton { padding: 8px !important; }
.mbutton b { width: 36px !important; height: 4px !important; border-radius: 99px; background: var(--surface-3) !important; }
.mtitle { font-size: 16px !important; font-weight: 600 !important; margin-bottom: 4px !important; color: var(--text); }
.modal-container { margin: 4px 8px !important; border-radius: 0 !important; background: transparent; }
.modal-container .list-menu {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 12px 12px !important;
  border-radius: var(--r-sm);
  font-weight: 400;
  font-size: 15px;
}
.modal-container .list-menu i { color: var(--text) !important; font-size: 22px !important; }
.modal-container .rc, .modal-container .rc i { color: var(--danger) !important; }
.modal_bottom_title2, .modal_bottom_title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 4px 18px !important;
  font-size: 16px;
  font-weight: 600;
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
}
.modal_bottom_title2 button {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent !important;
  color: var(--text) !important;
  cursor: pointer;
  position: static !important;
}
.modal_bottom_title2 button:hover { background: var(--surface-2) !important; }
#modal-fixed .modal-fixed-content {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: var(--r-lg) !important;
}

/* ---------- 15. Переписка ---------- */
.mail-message-my, .mail-message-user { margin: 4px 0 !important; }
.mail-message-my { text-align: right; }
.mail-message-my-form, .mail-message-user-form {
  display: inline-block;
  max-width: min(78%, 520px);
  padding: 8px 12px 6px !important;
  text-align: left;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: none !important;
  word-wrap: break-word;
}
.mail-message-my-form {
  background: var(--bubble-my) !important;
  color: var(--bubble-my-ink) !important;
  border-radius: 16px 16px 4px 16px !important;
}
.mail-message-my-form a { color: inherit !important; text-decoration: underline; }
.mail-message-user-form {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 0 !important;
  box-shadow: var(--card-shadow) !important;
  border-radius: 16px 16px 16px 4px !important;
}
.mail-message-my::before, .mail-message-my::after,
.mail-message-user::before, .mail-message-user::after,
.mail-message-my-form::before, .mail-message-my-form::after,
.mail-message-user-form::before, .mail-message-user-form::after { display: none !important; content: none !important; }
.mess_time { font-size: 11px !important; color: var(--muted) !important; text-align: right; margin-top: 2px; cursor: pointer; }
.mail-message-my-form .mess_time { color: inherit !important; opacity: .6; }
.mail-list-text { color: var(--muted) !important; }

/* плавающая кнопка мессенджера (ПК) */
.web-dialog-button {
  width: 52px !important;
  height: 52px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--pop-shadow) !important;
  display: grid !important;
  place-items: center;
}
.web-dialog-button i { font-size: 24px !important; color: var(--text) !important; }

/* ---------- 16. Прочее ---------- */
.success_green, .success, .error { border-radius: var(--r) !important; }
.ajax_indication { color: var(--muted) !important; }

/* вход / регистрация */
.guest-container {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  opacity: 1 !important;
  animation: none !important;
  top: 0 !important;
  padding: 24px 16px;
  box-sizing: border-box;
}
.gc3 {
  width: 100%;
  max-width: 380px;
  margin: 0 auto !important;
  padding: 28px 24px !important;
  border-radius: var(--r-lg) !important;
}
.gc3 h1 { font-size: 22px; font-weight: 600; margin: 0 0 18px; text-align: center; }
.gc3 .button, .button-aut { width: 100%; min-height: 42px; margin-top: 12px; }
.no_account { color: var(--muted); text-align: center; margin-top: 16px; font-size: 14px; }
.gc-footer { text-align: center; margin-top: 18px; }
.gc-footer a, .gc-footer span { color: var(--muted) !important; margin: 0 8px; font-size: 13px; }
.gc_info { background: var(--surface-2) !important; color: var(--text-2) !important; border-radius: var(--r) !important; }

/* ==========================================================================
   Адаптивность
   ========================================================================== */

/* телефон */
@media (max-width: 799.98px) {
  .pnl-left, .pnl-right, .panel-left-web, .panel-right-web, .pr_modal, .mv-search, .web-dialog-fixed, #web-dialog-modal { display: none !important; }
  div.nprtm:not(.new-panel-bottom) { display: block !important; }
  .list, .list-body { border-radius: var(--r) !important; }
}
@media (max-width: 480px) {
  /* на узких экранах карточки «во всю ширину», как в приложении VK */
  .content-fixed { padding: 0 !important; }
  .menu-nav-content { padding: 0 10px !important; }
  .list, .list-body { border-radius: 0 !important; margin-bottom: 8px !important; }
}

/* планшет и ПК */
@media (min-width: 800px) {
  :root {
    --top-h: 56px;
  }

  .nprtm, .new-panel-bottom, .new-panel-bottom-optimize, .new-panel-top-button, #sidebar_show { display: none !important; }
  .new-panel-top .new-panel-top-button,
  .new-panel-top.active > .new-panel-top-button { display: none !important; }

  .new-panel-top,
  .new-panel-top.active { gap: 12px; padding: 0 max(16px, calc(50% - var(--container) / 2)) !important; }
  .pnl-left { display: block !important; width: auto !important; padding: 0 !important; }
  .new-panel-top-info {
    flex: 0 1 auto !important;
    max-width: 260px;
    padding: 0 !important;
    font-size: 17px !important;
  }
  .pnl-right { display: flex !important; }

  .mv-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 420px;
    height: 38px;
    margin-left: 24px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted) !important;
    font-size: 14px;
    box-sizing: border-box;
  }
  .mv-search:hover { border-color: var(--line-strong); }
  .mv-search i { font-size: 18px !important; }

  #content {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: calc(var(--top-h) + 14px) max(16px, calc(50% - var(--container) / 2)) 24px !important;
    box-sizing: border-box;
  }
  #content > .panel-left-web {
    grid-column: 1;
    grid-row: 1;
    display: block !important;
    position: sticky !important;
    top: calc(var(--top-h) + 14px) !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: calc(100vh - var(--top-h) - 28px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto !important;
    background: transparent !important;
  }
  #content > .content-fixed {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
  }
  #content > .panel-right-web, .content-fixed > .panel-right-web { display: none !important; }
}

/* широкий ПК: правая колонка */
@media (min-width: 1100px) {
  #content { grid-template-columns: 200px minmax(0, 1fr) 300px; }
  #content > .panel-right-web {
    grid-column: 3;
    grid-row: 1;
    display: block !important;
    position: sticky;
    top: calc(var(--top-h) + 14px);
    width: auto !important;
    margin: 0 !important;
    max-height: calc(100vh - var(--top-h) - 28px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Строка «Расскажите что-нибудь…» (как «Что у вас нового?» в VK)
   ========================================================================== */
#mdclose {
  display: flex !important;
  align-items: center;
  gap: 12px;
  height: auto !important;
  padding: 12px 16px !important;
}
#mdclose .mess_mod_avatar { position: static !important; flex: 0 0 auto; line-height: 0; }
#mdclose .mess_mod_avatar .avatar { width: 36px !important; height: 36px !important; }
#mdclose .mess_mod {
  position: static !important;
  flex: 1 1 auto;
  min-width: 0;
  height: 40px !important;
  line-height: 40px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  font-weight: 400 !important;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s;
}
#mdclose:hover .mess_mod { background: var(--surface-3) !important; }

/* открытая форма нового поста */
#mdopen { padding: 12px 16px !important; }
#mdopen .mess_mod_avatar { position: static !important; display: inline-block; vertical-align: middle; }
#mdopen .mess_mod_avatar .avatar { width: 36px !important; height: 36px !important; }
#mdopen > form > span[style*="float"] .btn,
#mdopen > form > a.btn { min-height: 34px; }
#mdopen > form > a.btn { background: var(--surface-2) !important; color: var(--text) !important; left: -8px !important; }
#mdopen .wall_message {
  display: block;
  width: 100%;
  min-height: 110px;
  margin-top: 8px;
  padding: 12px 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  resize: vertical;
}
.textarea-attachments {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  display: inline-grid !important;
  place-items: center;
  border-radius: 50% !important;
  background: var(--surface-2) !important;
  color: var(--text-2) !important;
}
.textarea-attachments:hover { background: var(--surface-3) !important; }
.textarea-attachments i { font-size: 20px !important; }

/* ==========================================================================
   Окно диалогов (ПК) — как мини-мессенджер VK
   ========================================================================== */
#web-dialog-modal {
  right: 88px !important;
  bottom: 16px !important;
  width: 360px !important;
  height: min(520px, calc(100vh - var(--top-h) - 40px)) !important;
  display: flex;
  flex-direction: column;
  border: 0 !important;
  border-radius: var(--r-lg) !important;
  background: var(--surface) !important;
  color: var(--text);
  box-shadow: var(--pop-shadow) !important;
  overflow: hidden !important;
  z-index: 106 !important;
}
#web-dialog-modal[style*="display: none"] { display: none !important; }
#web-dialog-modal #dialog_modal_result,
#web-dialog-modal #content-mess-dialog { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.web-dialog-modal-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px !important;
  line-height: normal !important;
  padding: 0 6px 0 16px !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--text) !important;
  font-size: 16px;
  font-weight: 600 !important;
  background: transparent !important;
}
.web-dialog-modal-title-close,
.web-dialog-modal-title-close2,
.web-dialog-modal-title-close3 {
  position: static !important;
  flex: 0 0 auto;
  width: 36px !important;
  height: 36px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--muted) !important;
  cursor: pointer;
}
.web-dialog-modal-title-close2 { margin-left: auto; }
.web-dialog-modal-title-close3 + .web-dialog-modal-title-close2 { margin-left: 0; }
.web-dialog-modal-title-close3 { margin-left: auto; }
.web-dialog-modal-title-close:hover,
.web-dialog-modal-title-close2:hover,
.web-dialog-modal-title-close3:hover { background: var(--surface-2) !important; color: var(--text) !important; }
.web-dialog-modal-title-close i, .web-dialog-modal-title-close2 i, .web-dialog-modal-title-close3 i { font-size: 20px !important; }

/* шапка открытого чата */
.web-dialog-modal-title .mail-messages-nav { flex: 1 1 auto; min-width: 0; width: auto !important; color: var(--text) !important; }
.web-dialog-modal-title #messages { display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; align-items: center; }
.web-dialog-modal-title .mail-messages-nav-avatar { grid-row: 1 / 3; position: static !important; line-height: 0; }
.web-dialog-modal-title .mail-messages-nav-avatar .avatar, .web-dialog-modal-title .mail-messages-nav-avatar .avatar-o { width: 36px !important; height: 36px !important; }
.web-dialog-modal-title .mail-messages-nav-login {
  position: static !important;
  color: var(--text) !important;
  font-size: 14.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.web-dialog-modal-title .mail-messages-nav-online { position: static !important; color: var(--muted) !important; font-size: 12.5px; line-height: 1.2; }

/* список диалогов / сообщения */
.content-mess-dialog {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  background: transparent !important;
}
.content-mess-dialog::-webkit-scrollbar-track,
.content-mess-dialog::-webkit-scrollbar-track-piece { background: transparent !important; }
.content-mess-dialog::-webkit-scrollbar-thumb { background: var(--surface-3) !important; }
.content-mess-dialog .list-menu {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px !important;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.content-mess-dialog .list-menu > span[style*="absolute"] {
  position: static !important;
  color: var(--text) !important;
  font-size: 14.5px;
}
.content-mess-dialog .list-menu > span[style*="absolute"] b { font-weight: 600; }
.content-mess-dialog .avatar, .content-mess-dialog .avatar-o { width: 44px !important; height: 44px !important; line-height: 44px; }
.content-mess-dialog .mail-message-my-form,
.content-mess-dialog .mail-message-user-form { max-width: 85%; font-size: 14px; }

/* поле ввода внизу чата */
#web-dialog-modal form { flex: 0 0 auto; padding: 8px; border-top: 1px solid var(--line); background: var(--surface); }
#web-dialog-modal form textarea, #web-dialog-modal form input[type="text"] { border-radius: 20px !important; }
.web-dialog-notif { background: var(--signal) !important; border-color: var(--surface) !important; }
.dmg-error { background: var(--danger) !important; }

/* кнопка мессенджера — правее окна, не перекрывает его */
.web-dialog-fixed { right: 20px !important; bottom: 20px !important; }

/* ==========================================================================
   Выпадающие списки движка (иконка + подпись + select), напр. «Комментирование»
   ========================================================================== */
[class*="-modify-select-optimize"] { position: relative; }
[class*="-modify-select-optimize"] select {
  height: 44px !important;
  padding: 16px 32px 2px 46px !important;
  border-radius: var(--r-sm) !important;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
[class*="-modify-select-optimize"] #form-control-info {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  display: grid !important;
  place-items: center;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
}
[class*="-modify-select-optimize"] .form-control-title,
[class*="-modify-select-optimize"] rm {
  top: 5px !important;
  left: 46px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  pointer-events: none;
}
[class*="-modify-select-optimize"] .form-control-modify-select-appearance { color: var(--muted) !important; pointer-events: none; z-index: 3; }

/* нижняя строка формы поста: «Комментирование» + скрепка/смайлы/шрифт — в один ряд */
#mdopen form > div[style*="relative"] {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0 !important;
}
#mdopen form > div[style*="relative"] > [class*="-modify-select-optimize"] {
  flex: 0 1 190px;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
}
#mdopen form > div[style*="relative"] select { width: 100% !important; }
#mdopen form > div[style*="relative"] > .textarea-attachments {
  position: static !important;
  top: auto !important;
  right: auto !important;
  flex: 0 0 36px;
  margin: 0 !important;
}
#mdopen form > div[style*="relative"] > .textarea-attachments:first-of-type { margin-left: auto !important; }
/* кнопки «Отмена / Опубликовать» и аватар в одной строке */
#mdopen form > span[style*="float"] { margin-left: 8px; }
#mdopen form > a.btn { left: 0 !important; }
#mdopen form > br { display: none; }
#mdopen .wall_message { margin-top: 12px !important; clear: both; }
#mdopen .smiles-show, #mdopen .bb-show { margin-top: 8px; }

/* если движок вывел правую колонку внутри центральной — раскладываем её всё равно справа */
@media (min-width: 1100px) {
  #content > .content-fixed:has(> .panel-right-web) {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 16px;
    align-items: start;
  }
  #content > .content-fixed:has(> .panel-right-web) > #ajax_load { grid-column: 1; grid-row: 1; min-width: 0; }
  #content > .content-fixed > .panel-right-web {
    grid-column: 2;
    grid-row: 1;
    display: block !important;
    position: sticky;
    top: calc(var(--top-h) + 14px);
    width: auto !important;
    margin: 0 !important;
    max-height: calc(100vh - var(--top-h) - 28px);
    overflow-y: auto;
  }
}

/* ==========================================================================
   Страница переписки (/account/mail/messages/) — как в мессенджере
   ========================================================================== */

/* на странице с полем ввода внизу нижняя навигация не нужна (движок тоже её прячет) */
body:has(.panel-bottom-comments) .new-panel-bottom,
body:has(.panel-bottom-comments) .new-panel-bottom-optimize { display: none !important; }

.tmbr { padding-top: 0 !important; margin-top: 0 !important; background: transparent !important; min-height: 0 !important; }
.mail-message-user-form > br:first-child, .mail-message-my-form > br:first-child { display: none; }

/* шапка диалога */
.panel-right-mail-fixed {
  display: flex !important;
  align-items: center;
  gap: 2px;
  height: 56px !important;
  padding: 0 4px !important;
  box-sizing: border-box;
  background: var(--surface) !important;
  color: var(--text);
  border-radius: var(--r) !important;
  box-shadow: var(--card-shadow) !important;
  transform: none !important;
  margin: 0 0 10px !important;
}
.pnwb {
  flex: 0 0 auto;
  width: 40px !important;
  height: 40px !important;
  line-height: normal !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  color: var(--text) !important;
}
.pnwb:hover { background: var(--surface-2); }
.pnwb i { font-size: 24px !important; }
.mail-messages-nav-web {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: auto !important;
  line-height: normal !important;
  top: 0 !important;
  transform: none !important;
  padding: 0 4px !important;
  color: var(--text) !important;
  white-space: normal !important;
  overflow: hidden;
}
.mail-messages-nav-web > div { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.mail-messages-nav-avatar-web { grid-row: 1 / 3; width: 38px !important; top: 0 !important; line-height: 0; }
.mail-messages-nav-avatar-web .avatar, .mail-messages-nav-avatar-web .avatar-o { width: 38px !important; height: 38px !important; line-height: 38px; }
.mail-messages-nav-login-web, .mail-messages-nav-online-web {
  position: static !important;
  width: auto !important;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-messages-nav-login-web { color: var(--text) !important; font-size: 15px !important; font-weight: 600 !important; line-height: 1.25; }
.mail-messages-nav-online-web { color: var(--muted) !important; font-size: 12.5px !important; line-height: 1.25; }
.mail-messages-nav-online-web marquee { display: block; width: 100%; }
.panel-right-mail-fixed > span[style*="relative"] { flex: 0 0 auto; }
.mail-messages-btn-web {
  width: 40px !important;
  height: 40px !important;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  color: var(--text) !important;
}
.mail-messages-btn-web:hover { background: var(--surface-2); }
.mail-messages-btn-web > i { position: static !important; font-size: 22px !important; }

/* выпадающее меню «⋮» */
.panel-top-modal, #panel-top-modal {
  top: 48px !important;
  right: 4px !important;
  width: 240px !important;
  padding: 6px;
  background: var(--surface) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--pop-shadow) !important;
  z-index: 120 !important;
}
.panel-top-modal a, .panel-top-modal span, #panel-top-modal a, #panel-top-modal span {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px !important;
  border: 0 !important;
  border-radius: var(--r-sm);
  color: var(--text) !important;
  font-size: 14px;
  cursor: pointer;
}
.panel-top-modal a:hover, .panel-top-modal span:hover { background: var(--surface-2) !important; }
.panel-top-modal i { color: var(--muted) !important; font-size: 20px !important; }

/* поле ввода сообщения */
.panel-bottom-comments {
  background: var(--header) !important;
  border-top: 1px solid var(--line);
  box-shadow: none !important;
  padding: 8px 8px calc(8px + var(--safe-b)) !important;
  z-index: 104 !important;
}
.panel-bottom-comments .comments { display: flex; align-items: flex-end; gap: 8px; }
.panel-bottom-comments .comments > div {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
}
.panel-bottom-comments .comments-textarea {
  display: block;
  width: 100% !important;
  min-height: 44px;
  max-height: 140px;
  padding: 12px 82px 12px 44px !important;
  border: 1px solid var(--line) !important;
  border-radius: 22px !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
}
.panel-bottom-comments .comments-attachments,
.panel-bottom-comments .comments-smiles,
.panel-bottom-comments .comments-bb {
  top: 2px !important;
  height: 40px !important;
  width: 36px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  color: var(--muted) !important;
}
.panel-bottom-comments .comments-attachments { left: 4px !important; }
.panel-bottom-comments .comments-smiles { right: 40px !important; }
.panel-bottom-comments .comments-bb { right: 6px !important; }
.panel-bottom-comments .comments-attachments i,
.panel-bottom-comments .comments-smiles i,
.panel-bottom-comments .comments-bb i { font-size: 20px !important; }
.panel-bottom-comments .comments-button {
  position: static !important;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--accent) !important;
  color: #fff !important;
  display: grid !important;
  place-items: center;
  font-size: 18px !important;
}
.mail-message-scrollheight {
  bottom: calc(80px + var(--safe-b)) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--pop-shadow) !important;
}

/* телефон: шапка диалога вместо общей шапки сайта, поле ввода прижато к низу */
@media (max-width: 799.98px) {
  body:has(.panel-right-mail-fixed) .new-panel-top { display: none !important; }
  .panel-right-mail-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: var(--header) !important;
    border-bottom: 1px solid var(--line);
    box-shadow: none !important;
    z-index: 106 !important;
  }
  body:has(.panel-right-mail-fixed) .content-fixed {
    margin-top: 64px !important;
    padding: 0 10px !important;
  }
  body:has(.panel-bottom-comments) #ajax_load { padding-bottom: calc(84px + var(--safe-b)); }
  .panel-bottom-comments {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
  }
}

/* ПК: шапка диалога сверху колонки, поле ввода снизу колонки */
@media (min-width: 800px) {
  .panel-right-mail-fixed {
    position: sticky !important;
    top: calc(var(--top-h) + 14px) !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    z-index: 20 !important;
  }
  body:has(.panel-right-mail-fixed) #ajax_load { margin-top: 0 !important; }
  .panel-bottom-comments {
    position: sticky !important;
    bottom: 0 !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 10px;
    border: 0 !important;
    border-radius: var(--r) var(--r) 0 0 !important;
    background: var(--surface) !important;
    box-shadow: var(--card-shadow) !important;
  }
}

/* переписка на ПК, когда правая колонка внутри центральной: шапка диалога — первой строкой */
@media (min-width: 1100px) {
  #content > .content-fixed:has(> .panel-right-web) > .panel-right-mail-fixed { grid-column: 1; grid-row: 1; }
  #content > .content-fixed:has(> .panel-right-mail-fixed) > #ajax_load { grid-row: 2; }
  #content > .content-fixed:has(> .panel-right-mail-fixed) > .panel-right-web { grid-row: 1 / span 2; }
}

/* ==========================================================================
   Шапка профиля: статус, кнопки и выпадающее меню действий
   ========================================================================== */
.status {
  width: calc(100% - 32px) !important;
  max-width: 560px;
  margin: 4px auto 14px !important;
  padding: 10px 14px !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border-radius: var(--r) !important;
  font-size: 14px !important;
  line-height: 1.4;
  word-break: break-word !important;
  text-align: center !important;
}
.status::after { border-bottom-color: var(--surface-2) !important; }
.status i { color: var(--muted); }

.act_menu {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 16px 16px !important;
  padding: 0 !important;
}
.act_menu > a.btn { min-height: 38px; margin: 0 !important; }
/* кнопка-стрелка «▾» — вторичная */
.act_menu > a.btn[onclick*="act_menu"] {
  width: 44px;
  padding: 0 !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
}
.act_menu > a.btn[onclick*="act_menu"] i { transition: transform .2s; }
.act_menu:has(#act_menu:not([style*="none"])) > a.btn[onclick*="act_menu"] i { transform: rotate(180deg); }

/* раскрытое меню — аккуратная плашка во всю ширину */
#act_menu {
  flex: 1 0 100%;
  margin-top: 4px;
}
#act_menu:not([style*="none"]) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: var(--r);
  animation: mvDrop .18s ease-out;
}
#act_menu .btn-o {
  justify-content: center;
  min-height: 40px;
  margin: 0 !important;
  padding: 0 10px !important;
  border-radius: var(--r-sm) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
#act_menu .btn-o:hover { background: var(--surface-3) !important; }
#act_menu .btn-o i { color: var(--muted); }
#act_menu .btn-o[href*="/exit"], #act_menu .btn-o[href*="/exit"] i { color: var(--danger) !important; }
@keyframes mvDrop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ls_page-login, .ls_page-online { top: 0 !important; }
.ls_page-login { margin-top: -62px; font-size: 21px !important; font-weight: 700; }
.ls_page-login a { color: var(--text) !important; }
.ls_page-online { margin-top: 2px; font-size: 13px !important; }
.ls_page-online + a .status, center > a > .status { margin-top: 12px !important; }

/* ==========================================================================
   Поля форм движка: подпись внутри поля («плавающая метка»), иконка слева,
   подсказка под полем при вводе. Работает во всех формах сайта.
   ========================================================================== */
[class*="-optimize"]:has(> rm:not(:empty)) > input,
[class*="-optimize"]:has(> rm:not(:empty)) > textarea {
  height: 54px !important;
  padding: 22px 44px 6px 46px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
}
[class*="-optimize"]:has(> rm:not(:empty)) > input::placeholder { color: transparent !important; }
[class*="-optimize"] > rm,
[class*="-optimize"] > .form-control-title {
  position: absolute !important;
  top: 9px !important;
  left: 46px !important;
  z-index: 4 !important;
  max-width: calc(100% - 90px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  pointer-events: none;
}
[class*="-optimize"]:focus-within > rm { color: var(--accent) !important; }
[class*="-optimize"] > #form-control-info {
  top: 0 !important;
  left: 4px !important;
  width: 38px !important;
  height: 54px !important;
  line-height: 54px !important;
  display: grid !important;
  place-items: center;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  z-index: 4 !important;
}
[class*="-optimize"]:focus-within > #form-control-info { color: var(--accent) !important; }
[class*="-optimize"] > #password-checkbox {
  top: 0 !important;
  right: 4px !important;
  height: 54px !important;
  line-height: normal !important;
  display: grid !important;
  place-items: center;
  color: var(--muted) !important;
  z-index: 4 !important;
  cursor: pointer;
}
/* выпадающие списки — та же высота */
[class*="-modify-select-optimize"] select { height: 54px !important; padding-top: 18px !important; }
[class*="-modify-select-optimize"] #form-control-info { height: 54px !important; line-height: 54px !important; }
[class*="-optimize"] { margin-bottom: 14px !important; }

/* подсказка к полю: появляется под полем, когда в нём курсор */
[class*="-optimize"] > .input-info {
  display: block !important;
  position: static !important;
  order: 9;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0 4px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  transition: max-height .2s ease, margin .2s ease;
}
[class*="-optimize"]:focus-within > .input-info { max-height: 90px; margin-top: 6px; }
[class*="-optimize"]:has(> .input-info) { display: flex; flex-direction: column; }
[class*="-optimize"]:has(> .input-info) > input { order: 1; }
[class*="-optimize"] > .input-info b { color: var(--text-2); font-weight: 600; }

/* ==========================================================================
   Страницы входа / регистрации / восстановления пароля
   ========================================================================== */
/* гость ничего лишнего не видит: ни шапки с разделами, ни меню, ни виджетов */
body:has(.guest-container) .new-panel-top,
body:has(.guest-container) .panel-left-web,
body:has(.guest-container) .panel-right-web,
body:has(.guest-container) .sidebar_wrap,
body:has(.guest-container) .sidebar_hide,
body:has(.guest-container) .new-panel-bottom-guests,
body:has(.guest-container) .web-dialog-fixed { display: none !important; }
body:has(.guest-container) #content {
  display: block !important;
  padding: 0 !important;
  max-width: none !important;
}
body:has(.guest-container) .content-fixed { margin: 0 !important; padding: 0 !important; }

.guest-container {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  max-width: 1100px !important;
  margin: 0 auto !important;
}
.gc1, .gc2 { width: auto !important; padding: 0 !important; margin: 0 !important; }
.gc1 { flex: 1 1 380px; min-width: 0; max-width: 520px; text-align: center; }
.gc1 .carousel-container { max-width: 100%; overflow: hidden; }
.gc2 { flex: 0 1 420px; }
.gc1 img { width: min(100%, 520px) !important; max-width: 100% !important; margin: 0 auto 10px; display: block; }
.gc_name { font-size: 28px !important; letter-spacing: -.02em; margin: 0 0 12px !important; color: var(--text); }
.gc_text { color: var(--text-2); font-size: 16px; }
.aut-text { color: var(--muted); font-size: 14px; margin: -6px 0 18px; }
.gc3 { max-width: 420px !important; }
.gc3 form { text-align: left; }

/* капча: поле слева, цифры справа, в одну строку */
.gc3 .captcha1, form .captcha1 {
  display: inline-block !important;
  width: calc(100% - 140px) !important;
  height: 54px !important;
  padding: 0 14px !important;
  vertical-align: middle;
}
.gc3 .captcha2, form .captcha2 {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 120px;
  height: 54px;
  margin-left: 8px;
  vertical-align: middle;
  background: #fff;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: static !important;
}
.captcha2 img { height: 30px; width: auto; position: static !important; }
/* «Забыли пароль?» на странице регистрации стояло поверх капчи — переносим вниз */
.gc3 a[href*="get=password"][style*="-48px"] {
  float: none !important;
  top: 0 !important;
  display: block;
  margin: 10px 0 4px;
  text-align: right;
}
.gc3 .custom-checkbox { margin-top: 8px; display: inline-flex; }
.gc3 .custom-checkbox > span { color: var(--text-2) !important; font-size: 14px !important; font-weight: 500 !important; }
.gc3 a[href*="/m/rules"] { bottom: 0 !important; top: -1px; position: relative !important; font-size: 14px !important; margin-left: 2px; }
.gc3 .save_aut { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.gc3 .save_aut a { position: static !important; float: none !important; font-size: 13px !important; }
.gc3 .button-aut { margin-top: 16px !important; }

@media (max-width: 799.98px) {
  .guest-container { padding: 20px 12px 32px !important; gap: 20px; overflow-x: hidden; }
  .gc1, .gc2 { flex: 1 1 100% !important; max-width: 100% !important; }
  .gc1 img { width: min(100%, 360px) !important; }
  .gc_name { font-size: 24px !important; }
  .gc3 { padding: 22px 16px !important; }
}

/* голосовые сообщения */
.voice-msg { margin: 4px 0; }
.voice-msg audio.voice-player { display: block; width: 100%; max-width: 320px; height: 40px; margin: 6px 0 4px; border-radius: 20px; }
.voice-msg small { color: var(--muted); font-size: 12px; }
.mail-message-my-form .voice-msg small, .mail-message-my-form .voice-msg font { color: inherit !important; opacity: .75; }

/* страница входа для гостя на ПК: правила сильнее раскладки колонок */
html body:has(.guest-container) #content > .panel-left-web,
html body:has(.guest-container) #content > .panel-right-web,
html body:has(.guest-container) #content .content-fixed > .panel-right-web,
html body:has(.guest-container) #content > .new-panel-top { display: none !important; }
html body:has(.guest-container) #content {
  display: block !important;
  grid-template-columns: none !important;
  padding: 0 !important;
}
html body:has(.guest-container) #content > .content-fixed {
  display: block !important;
  grid-column: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body:has(.guest-container) #ajax_load { width: 100% !important; }
@media (min-width: 800px) {
  html body:has(.guest-container) .guest-container { min-height: 100vh !important; padding: 32px 24px !important; }
}

/* ==========================================================================
   Подписи и подсказки в полях (особенно на телефоне)
   ========================================================================== */
/* пустое поле без курсора: подпись крупно по центру поля, как обычная подсказка;
   при вводе — уезжает наверх */
[class*="-optimize"] > input:placeholder-shown:not(:focus) ~ rm {
  top: 50% !important;
  transform: translateY(-50%);
  font-size: 15px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
}
[class*="-optimize"] > rm { transition: top .15s ease, font-size .15s ease, transform .15s ease, color .15s; }
/* у полей с подсказкой поле не центрируется по всей высоте блока — считаем от поля */
[class*="-optimize"]:has(> .input-info) > input:placeholder-shown:not(:focus) ~ rm { top: 27px !important; }

/* подсказка под полем видна всегда на страницах входа/регистрации */
.gc3 [class*="-optimize"] > .input-info {
  max-height: none !important;
  margin-top: 6px !important;
  padding: 0 6px;
}
.gc3 [class*="-optimize"]:focus-within > .input-info { color: var(--text-2); }

/* ==========================================================================
   Боковая панель с разделами (телефон): один слой прокрутки
   ========================================================================== */
.sidebar_wrap {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.sidebar_wrap .pfm {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
/* пока шторка открыта, страница под ней не прокручивается */
html:has(.sidebar_wrap.wrap_active), body:has(.sidebar_wrap.wrap_active) { overflow: hidden !important; }
.sidebar_hide.hide_active { touch-action: none; }
/* шторка открыта — браузер не должен «тянуть для обновления» страницу */
html:has(.sidebar_wrap.wrap_active) { overscroll-behavior: none; }

/* ---------- Кнопка голосового рядом с «Отправить» ---------- */
.panel-bottom-comments .comments-voice {
  position: static !important;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid !important;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text) !important;
  cursor: pointer;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s, transform .1s;
}
.panel-bottom-comments .comments-voice i { font-size: 20px !important; }
.panel-bottom-comments .comments-voice:hover { background: var(--surface-3); }
.panel-bottom-comments .comments-voice:active { transform: scale(.94); background: #FF4D4D; color: #fff !important; }
@media (max-width: 380px) {
  .panel-bottom-comments .comments { gap: 6px; }
  .panel-bottom-comments .comments-voice, .panel-bottom-comments .comments-button { flex-basis: 40px; width: 40px !important; height: 40px !important; }
}
.panel-bottom-comments .comments-textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* На телефоне место нужнее голосовой кнопке: форматирование (A) прячем */
@media (max-width: 480px) {
  .panel-bottom-comments .comments-bb { display: none !important; }
  .panel-bottom-comments .comments-smiles { right: 6px !important; }
  .panel-bottom-comments .comments-textarea { padding-right: 46px !important; }
}

/* счётчик непрочитанных в пункте левого меню */
.panel-left-menu .mv-menu-count {
  margin-left: auto;
  min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px;
  box-sizing: border-box; border-radius: 999px;
  background: var(--signal, #FF3B4E); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}

/* ---------- Блок «Последние новости» ---------- */
.mv-news { margin: 0 0 var(--gutter); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--card-shadow); overflow: hidden; }
.mv-news-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 4px; }
.mv-news-head span { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--text); }
.mv-news-head span .fa, .mv-news-head span i, .mv-news-head span svg { color: var(--accent); }
.mv-news-x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted) !important; background: transparent; transition: background .15s; }
.mv-news-x:hover { background: var(--accent-soft); color: var(--text) !important; }
.mv-news-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px 12px; color: var(--text) !important; text-decoration: none !important; }
.mv-news-item:hover .mv-news-title { color: var(--accent); }
.mv-news-img { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.mv-news-body { flex: 1; min-width: 0; }
.mv-news-title { font-size: 16px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.mv-news-meta { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-news-meta a, .mv-news-meta span { color: var(--muted) !important; font-weight: 500; }
.mv-news-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.mv-news-stats span { display: inline-flex; align-items: center; gap: 5px; }
.mv-news-all { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-weight: 600; font-size: 14.5px; color: var(--accent) !important; text-decoration: none !important; }
.mv-news-all:hover { background: var(--accent-soft); }
