/* ==========================================================
   Premium Touch — СТРАНИЦА СООБЩЕСТВА
   большая обложка • название поверх • панель управления
   ========================================================== */

.cm-hero { position: relative; }

.cm-hero .screensaver,
.cm-hero #sreensaver_upgrade {
  position: relative !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}

.cm-hero .screensaver {
  height: calc(66vw + env(safe-area-inset-top, 0px)) !important;
  min-height: 260px;
  max-height: 400px;
  overflow: hidden;
  border-radius: 0 0 34px 34px !important;
}

.cm-hero .screensaver {
  -webkit-mask-image: none !important;
  mask-image: none !important;
  box-shadow: none !important;
}

.cm-hero .screensaver #sreensaver_upgrade { height: 100% !important; }

.cm-hero .screensaver img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  display: block;
  border-radius: 0 !important;
}

.cm-hero .screensaver::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 6, 30, .38) 0%, rgba(8, 6, 30, 0) 30%, rgba(8, 6, 30, 0) 42%, rgba(8, 6, 30, .82) 100%);
}

.cm-hero .ls_screensaver_button {
  top: auto !important;
  left: auto !important;
  right: 14px !important;
  bottom: 78px !important;
  z-index: 5;
  width: 38px;
  height: 38px;
  line-height: 38px !important;
  text-align: center;
  border-radius: 50% !important;
  background: rgba(10, 10, 30, .4) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff !important;
}

/* кнопки поверх обложки */
.cm-btn {
  position: relative;
  z-index: 6;
  width: 42px;
  height: 42px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 10, 30, .4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.cm-btn:active { transform: scale(.86); }

.cm-back {
  position: absolute;
  left: 12px;
  top: calc(12px + env(safe-area-inset-top, 0px));
}

.cm-top-right {
  position: absolute;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 6;
  display: flex;
  gap: 8px;
}

.cm-title {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.cm-ava { flex: 0 0 auto; }
.cm-ava .avatar_optimize {
  display: block;
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
}

.cm-ava .img__description { width: 66px; height: 66px; line-height: 66px; border-radius: 22px; }

.cm-ava img,
.cm-ava .avatar-left {
  width: 66px !important;
  height: 66px !important;
  border-radius: 22px !important;
  border: 3px solid rgba(255, 255, 255, .92) !important;
  object-fit: cover;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .6);
  display: block;
}

.cm-name { min-width: 0; }

.cm-name b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.1;
  color: #fff !important;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cm-name b a { color: #fff !important; }

.cm-name small {
  display: block;
  margin-top: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .9) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.cm-desc {
  margin: 16px 18px 4px;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--vk-text);
  text-align: left;
}

/* ---------- УПРАВЛЕНИЕ (только админам) ---------- */

.cm-manage {
  margin: 14px 10px 4px;
  padding: 14px 12px 12px;
  border-radius: 26px;
  background: var(--vk-card);
  box-shadow: var(--shadow-card);
}

.cm-manage-title {
  padding: 0 6px 10px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--vk-muted);
}

.cm-manage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cm-manage-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px 10px;
  border-radius: 20px;
  background: var(--vk-card-2);
  color: var(--vk-text) !important;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.cm-manage-grid a:active { transform: scale(.93); }

.cm-manage-grid i {
  width: 42px;
  height: 42px;
  line-height: 42px;
  text-align: center;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--vk-accent);
  font-size: 22px !important;
}

/* ---------- ВСТУПИТЬ / ПРИГЛАСИТЬ ---------- */

body:has(.cm-hero) .act_menu {
  display: block !important;
  width: auto !important;
  margin: 14px 0 8px !important;
  padding: 0 12px !important;
  background: none !important;
  text-align: left !important;
  position: static !important;
}

body:has(.cm-hero) .act_menu #int {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body:has(.cm-hero) .act_menu .btn,
body:has(.cm-hero) .act_menu .btn-o {
  flex: 1 1 auto;
  height: 50px;
  line-height: 50px;
  padding: 0 20px !important;
  margin: 0 !important;
  border-radius: 17px !important;
  font-size: 15.5px;
  font-weight: 700;
  text-align: center;
  float: none !important;
}

body:has(.cm-hero) .act_menu .btn-o {
  background: var(--vk-card) !important;
  color: var(--vk-text) !important;
  box-shadow: var(--shadow-card);
}

body:has(.cm-hero) .act_menu #act_menu { flex: 1 0 100%; flex-direction: column; gap: 8px; }
body:has(.cm-hero) .act_menu #act_menu a { display: block; }

/* ---------- ИНФОРМАЦИЯ (плитки) ---------- */

body:has(.cm-hero) center:has(.mmd1) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 12px;
}

body:has(.cm-hero) .mmd1 {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  float: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 84px;
  padding: 12px 6px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 22px;
  background: var(--vk-card) !important;
  box-shadow: var(--shadow-card);
  color: var(--vk-text) !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

body:has(.cm-hero) .mmd1:active { transform: scale(.94); }
body:has(.cm-hero) .mmd1 i { font-size: 23px !important; color: var(--vk-accent) !important; margin-bottom: 2px; }

body:has(.cm-hero) .mmd1 span {
  display: block;
  margin: 0 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--vk-muted) !important;
}

/* ---------- РАЗДЕЛЫ (блоги, чат, форум, участники) ---------- */

body:has(.cm-hero) .menu_user_optimize { margin: 10px 0 4px; overflow: hidden; position: relative; }

body:has(.cm-hero) .menu_user_container {
  display: flex !important;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 12px 10px !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body:has(.cm-hero) .menu_user_container::-webkit-scrollbar { display: none; }

body:has(.cm-hero) .menu_user {
  flex: 0 0 auto;
  min-width: 104px;
  height: auto !important;
  padding: 13px 18px !important;
  border-radius: 22px;
  background: var(--vk-card) !important;
  box-shadow: var(--shadow-card);
  text-align: center;
  color: var(--vk-text) !important;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

body:has(.cm-hero) .menu_user:active { transform: scale(.94); }
body:has(.cm-hero) .menu_user div { font-size: 21px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; color: var(--vk-text); }
body:has(.cm-hero) .menu_user span { font-size: 12.5px; font-weight: 600; color: var(--vk-muted); }

body:has(.cm-hero) .menu_user_for_left,
body:has(.cm-hero) .menu_user_for_right { display: none !important; }
