/* VMESTA v107 — final narrow overrides for the active v99 release. */
/* Этот устаревший индикатор иногда остаётся поверх уже загруженного профиля.
   У маршрутов есть собственные состояния загрузки, поэтому перекрывающий
   страницу дубль полностью исключаем из интерфейса. */
html:root body #vmesta-handle-loading{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
/* Проверка серверной сессии остаётся фоновой и никогда не блокирует первый
   кадр. Даже если старый код вернёт класс pending, пользователь видит каркас. */
html.vmesta-auth-pending body{overflow:auto!important}
html.vmesta-auth-pending body>:not(#vmesta-auth-gate){visibility:visible!important}
html:root body #vmesta-auth-gate{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Единые часы загрузки: стрелки имеют собственные фиксированные точки
   вращения. Так общие transform-правила карточек и модальных окон больше не
   превращают часы в одну прыгающую черту. */
html:root body .vmesta-loading-orbit{
  position:relative!important;
  display:block!important;
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  overflow:visible!important;
}
html:root body .vmesta-loading-orbit::before{
  left:calc(50% - .08rem)!important;
  top:calc(50% - .56rem)!important;
  width:.16rem!important;
  height:.56rem!important;
  transform-origin:50% 100%!important;
  animation:vmesta-loading-hour-hand-v110 4.8s linear infinite!important;
}
html:root body .vmesta-loading-orbit::after{
  left:calc(50% - .0425rem)!important;
  top:calc(50% - .82rem)!important;
  width:.085rem!important;
  height:.82rem!important;
  transform-origin:50% 100%!important;
  animation:vmesta-loading-minute-hand-v110 1.2s linear infinite!important;
}
html:root body .vmesta-loading-orbit>.vmesta-loading-satellite{
  animation:vmesta-loading-satellite-v110 1.35s linear infinite!important;
}
@keyframes vmesta-loading-hour-hand-v110{from{transform:rotate(28deg)}to{transform:rotate(388deg)}}
@keyframes vmesta-loading-minute-hand-v110{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@keyframes vmesta-loading-satellite-v110{from{transform:rotate(0)}to{transform:rotate(360deg)}}
.messenger-mobile-sections-toggle{display:none!important}
html:root body :is(.post-item,.space-post,.profile-post-card,.publication-card,.post-card,.post-detail-card,[data-post-card],#post-viewer-panel){border:0!important;outline:0!important;box-shadow:none!important}
html:root body .post-actions>.pin-ribbon{position:static!important;inset:auto!important;flex:0 0 1.65rem!important;margin:0 .12rem 0 auto!important;transform:none!important}

@media(min-width:768px){
  html:root body #profile-account-switch-trigger,
  html:root body #profile-spaces-switch-trigger{display:none!important}
  html:root body .messenger-desktop-archive-button{display:grid!important}

  /* В полной версии подсказка видеозаписи относится к нижней панели чата.
     Мобильное fixed-позиционирование не должно уносить её к кнопке «Вверх». */
  html:root body .messenger-recording-panel.is-video .messenger-recording-status{
    position:absolute!important;
    z-index:48!important;
    top:auto!important;
    right:auto!important;
    bottom:calc(100% + .48rem)!important;
    left:.2rem!important;
    width:clamp(12.5rem,29vw,18rem)!important;
    max-width:min(18rem,calc(100vw - 2rem))!important;
    justify-content:start!important;
    padding:.42rem .68rem!important;
    border-radius:.72rem!important;
    background:var(--theme-surface-panel,var(--msg-panel,#fff))!important;
    color:var(--theme-text-primary,var(--msg-text,#15243a))!important;
    box-shadow:0 .48rem 1.25rem color-mix(in srgb,#020617 16%,transparent)!important;
  }
}

@media(max-width:767px){
  :root{--vmesta-mobile-header-total:calc(var(--vmesta-mobile-header-height,3.55rem) + env(safe-area-inset-top,0px))}

  html:root body #site-header nav{display:contents!important}
  html:root body #site-header nav>.spaces-top-wrapper{display:none!important}
  html:root body #site-header .site-brand-player{position:absolute!important;z-index:70!important;top:50%!important;left:50%!important;display:flex!important;align-items:center!important;gap:.3rem!important;pointer-events:auto!important;transform:translate(-50%,-50%)!important}
  html:root body #site-header .site-brand-player>[data-site-wordmark]{display:block!important;color:var(--vmesta-ui-text,var(--adaptive-text-primary,#eef6ff))!important;font-size:.86rem!important;font-weight:950!important;letter-spacing:.12em!important;line-height:1!important}
  html:root body #site-header .site-brand-player>#mobile-header-search{display:grid!important;width:2.35rem!important;height:2.35rem!important;min-width:2.35rem!important;place-items:center!important;border:0!important;border-radius:.75rem!important;background:transparent!important;box-shadow:none!important}
  html:root body #site-header .search-wrapper{display:none!important}
  html:root body.mobile-quick-search-open #site-header .search-wrapper{position:fixed!important;z-index:21980!important;top:calc(var(--vmesta-mobile-header-total) + .38rem)!important;right:.55rem!important;left:.55rem!important;display:flex!important;width:auto!important;min-width:0!important;margin:0!important}
  html:root body.mobile-quick-search-open #site-header .search-wrapper>.relative.group{width:100%!important}
  html:root body.mobile-quick-search-open #site-header #global-search{position:static!important;width:100%!important;height:3.35rem!important;padding:0 1rem 0 2.75rem!important;border:0!important;border-radius:1rem!important;background:var(--vmesta-ui-panel,var(--adaptive-surface,#fff))!important;color:var(--vmesta-ui-text,var(--adaptive-text-primary,#eef6ff))!important;caret-color:auto!important;box-shadow:0 .8rem 2rem rgb(3 12 24/.24)!important}
  html:root body.mobile-quick-search-open #site-header #global-search::placeholder{color:var(--vmesta-ui-muted,#8290a8)!important}
  html:root body.mobile-quick-search-open #site-header #search-dropdown{position:fixed!important;z-index:21970!important;top:calc(var(--vmesta-mobile-header-total) + 4rem)!important;right:.55rem!important;left:.55rem!important;width:auto!important;max-height:calc(100dvh - var(--vmesta-mobile-header-total) - 4.8rem)!important;overflow:auto!important;border:0!important;border-radius:0 0 1rem 1rem!important;box-shadow:0 1rem 2.4rem rgb(3 12 24/.28)!important}
  html:root body.mobile-quick-search-open #site-header #search-dropdown:not(.hidden){display:block!important}
  html:root body.mobile-quick-search-open #site-header .search-dropdown-footer{position:sticky!important;bottom:0!important}

  html:root body #profile-left-rail .profile-sidebar-navigation>.nav-item{position:relative!important;min-height:4.1rem!important;padding-right:3.65rem!important;font-size:1rem!important}
  html:root body #profile-left-rail :is(.profile-account-switch-trigger,.profile-spaces-switch-trigger){position:absolute!important;z-index:6!important;top:50%!important;right:.55rem!important;display:grid!important;width:2.65rem!important;height:2.65rem!important;min-width:2.65rem!important;place-items:center!important;border:0!important;border-radius:.8rem!important;background:color-mix(in srgb,var(--vmesta-ui-primary,var(--color-dynamic,#249653)) 12%,var(--vmesta-ui-panel,#fff))!important;color:var(--vmesta-ui-primary,var(--color-dynamic,#249653))!important;box-shadow:none!important;transform:translateY(-50%)!important}
  html:root body #profile-left-rail :is(.profile-account-switch-trigger,.profile-spaces-switch-trigger) svg{width:1.12rem!important;height:1.12rem!important;fill:none!important;stroke:currentColor!important;stroke-width:2.2!important;transition:transform .18s ease!important}
  html:root body #profile-left-rail :is(.profile-account-switch-trigger,.profile-spaces-switch-trigger).is-open svg{transform:rotate(180deg)!important}
  html:root body #profile-left-rail .top-account-switch-menu.is-drawer-origin,
  html:root body #profile-left-rail #top-spaces-dropdown.is-mobile-drawer-spaces-menu{position:static!important;inset:auto!important;display:block!important;width:100%!important;max-width:none!important;max-height:18rem!important;margin:.12rem 0 .35rem!important;overflow:auto!important;border:0!important;border-radius:1rem!important;background:color-mix(in srgb,var(--vmesta-ui-primary,var(--color-dynamic,#249653)) 5%,var(--vmesta-ui-panel,#fff))!important;box-shadow:none!important;transform:none!important}
  html:root body #profile-left-rail :is(.top-account-switch-menu.is-drawer-origin,#top-spaces-dropdown.is-mobile-drawer-spaces-menu).hidden,
  html:root body #profile-left-rail .top-account-switch-menu.is-drawer-origin[hidden]{display:none!important}
  html:root body #profile-left-rail .profile-sidebar-more-toggle{min-height:4.1rem!important;font-size:1rem!important}
  html:root body #profile-left-rail .profile-sidebar-more-menu>button{min-height:4rem!important;background:transparent!important;color:var(--vmesta-ui-text,var(--adaptive-text-primary,#eef6ff))!important;font-size:.9rem!important}
  html:root body #profile-left-rail .profile-sidebar-more-menu>button :is(span,svg){color:inherit!important;stroke:currentColor!important}
  html:root body #profile-left-rail .profile-sidebar-more-menu>button small{color:var(--vmesta-ui-muted,var(--adaptive-text-muted,#8191a7))!important;opacity:1!important}

  html:root body .spaces-index-card.is-list .spaces-index-open{display:grid!important;grid-template-columns:5.7rem minmax(0,1fr)!important;min-height:5.8rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-cover{height:100%!important;min-height:5.8rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-body{gap:.55rem!important;padding:.62rem 3.4rem .62rem .62rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-body img{width:2.75rem!important;height:2.75rem!important;border-radius:.72rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-body strong{font-size:.86rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-body small{font-size:.62rem!important}
  html:root body .spaces-index-card.is-list .spaces-index-genres{display:none!important}
  html:root body .spaces-index-card.is-list .spaces-index-kebab{top:50%!important;right:.5rem!important;transform:translateY(-50%)!important}
  html:root body .spaces-index-content-layout>.spaces-top-panel{display:none!important}

  html:root body[data-mobile-right-context="none"] #mobile-achievements-peek,
  html:root body #mobile-achievements-peek[hidden]{display:none!important}
  html:root body[data-mobile-right-context="spaces"] #profile-right-rail>.sidebar-content,
  html:root body[data-mobile-right-context="spaces"] #profile-right-rail>#messages-side-root,
  html:root body[data-mobile-right-context="spaces"] #profile-right-rail>#mobile-achievements-contacts{display:none!important}
  html:root body[data-mobile-right-context="spaces"] #profile-right-rail>.spaces-top-panel{display:grid!important;width:100%!important;max-width:none!important;margin:.5rem 0 0!important;border:0!important;box-shadow:none!important}
  html:root body[data-mobile-right-context="profile"] #profile-right-rail>.spaces-top-panel{display:none!important}

  html:root body .messenger-dialogs-panel{position:relative!important}
  html:root body .messenger-desktop-archive-button{display:none!important}
  html:root body .messenger-mobile-sections-toggle{display:grid!important}
  html:root body .messenger-mobile-list-tabs{position:absolute!important;z-index:120!important;top:4.65rem!important;right:.65rem!important;display:none!important;width:min(15.5rem,calc(100vw - 1.3rem))!important;max-height:calc(100dvh - 5.5rem)!important;flex-direction:column!important;gap:.28rem!important;padding:.45rem!important;overflow:auto!important;border:0!important;border-radius:1rem!important;background:var(--msg-menu-surface,var(--vmesta-ui-panel,#fff))!important;box-shadow:0 1rem 2.5rem rgb(3 12 24/.3)!important}
  html:root body .messenger-mobile-list-tabs.is-open{display:flex!important}
  html:root body .messenger-mobile-list-tabs>button{width:100%!important;min-height:3.35rem!important;justify-content:flex-start!important;padding:.65rem .8rem!important;font-size:.82rem!important}
  html:root body .messenger-chat-menu.is-row-menu{width:min(17.25rem,calc(100vw - 1.25rem))!important}
  html:root body .messenger-chat-menu.is-row-menu>button{min-height:3.62rem!important;padding:.7rem .78rem!important;font-size:.86rem!important}

  html:root body .messenger-message-menu-stack{position:fixed!important;top:var(--message-menu-y)!important;left:var(--message-menu-x)!important;width:min(15.5rem,calc(100vw - 1rem))!important;max-width:min(15.5rem,calc(100vw - 1rem))!important}
  html:root body .messenger-message-menu-stack.has-reaction-picker{inset:auto!important;top:var(--message-menu-y)!important;left:var(--message-menu-x)!important;display:flex!important;width:min(15.5rem,calc(100vw - 1rem))!important;max-width:min(15.5rem,calc(100vw - 1rem))!important;height:auto!important;max-height:calc(100dvh - var(--message-menu-y) - .5rem)!important;padding:0!important;place-items:initial!important;overflow:visible!important}
  html:root body .messenger-message-menu-stack.has-reaction-picker .messenger-reaction-picker{position:relative!important;inset:auto!important;width:100%!important;max-width:100%!important;margin:0!important;transform-origin:top left!important}

  html:root body .mobile-bottom-navigation{right:.55rem!important;bottom:calc(.35rem + env(safe-area-inset-bottom,0px))!important;left:.55rem!important;width:auto!important;max-width:none!important}
}
