/* Ковчег · Stage 77. Desktop message scrolling, calm profile columns, stationary navigation & inline shares. */
body.shelter-dark{
 --kv77-card:#272b30;--kv77-muted:#aeb9c5;--kv77-border:#414850;--kv77-surface:#20252b;
 --kv77-link:#a7cefa;--kv77-text:#f2f4f7;
}
body.shelter-light{
 --kv77-card:#fff;--kv77-muted:#657a90;--kv77-border:#dce5ef;--kv77-surface:#f2f6fb;
 --kv77-link:#3477af;--kv77-text:#263950;
}
/* Inline share card replaces the former 'open photo' link in messages. */
body.is-community .kv-msg-body .kv-msg-share-card{
 display:flex!important;flex-direction:column!important;min-width:0!important;
 max-width:100%!important;gap:0!important;margin:4px 0 1px!important;
 border:1px solid var(--kv77-border)!important;border-radius:10px!important;
 background:var(--kv77-card)!important;color:var(--kv77-text)!important;
 text-decoration:none!important;overflow:hidden!important;
}
body.is-community .kv-msg-share-comment{
 font-size:12px!important;line-height:1.5!important;white-space:normal!important;
 color:inherit!important;margin:0 0 9px!important;overflow-wrap:anywhere!important;
}
body.is-community .kv-msg-share-image{
 display:block!important;width:100%!important;max-width:100%!important;
 height:auto!important;max-height:440px!important;
 object-fit:contain!important;object-position:center!important;
 background:var(--kv77-surface)!important;border:0!important;
 border-radius:0!important;margin:0!important;
}
body.is-community .kv-msg-share-meta{
 display:flex!important;flex-direction:column!important;align-items:flex-start!important;
 gap:4px!important;padding:9px 11px!important;min-width:0!important;
 box-sizing:border-box!important;color:var(--kv77-text)!important;
}
body.is-community .kv-msg-share-meta strong{
 color:var(--kv77-text)!important;font-size:12px!important;line-height:1.4!important;
}
body.is-community .kv-msg-share-meta small{
 color:var(--kv77-muted)!important;font-size:11px!important;
}
body.is-community .kv-msg-share-excerpt{
 display:block!important;max-height:160px!important;overflow:hidden!important;
 font-size:12px!important;line-height:1.6!important;color:var(--kv77-text)!important;
 overflow-wrap:anywhere!important;
}
body.is-community .kv-msg-body .kv-msg-share-card:hover{
 border-color:var(--kv77-link)!important;
}
body.is-community .kv-msg-row .kv-msg-bubble:has(.kv-msg-share-card){
 width:min(435px,90%)!important;max-width:min(435px,90%)!important;
}
body.is-community .kv-msg-body .kv-msg-share-image[alt]{cursor:zoom-in}
/* Keep the left-side account widgets in the page document flow.
   Only the outer community navigation stays sticky on DESKTOP. */
@media(min-width:781px){
 body.is-community .kv-vk-app>.kv-vk-sidebar{
  position:sticky!important;top:74px!important;align-self:start!important;
  height:auto!important;max-height:none!important;
  overflow:visible!important;overscroll-behavior:none!important;
  z-index:10;
 }
 body.is-community .kv-vk-app>.kv-vk-sidebar .kv-side-items{
  overflow:visible!important;max-height:none!important;height:auto!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-left{
  position:static!important;top:auto!important;height:auto!important;
  max-height:none!important;overflow:visible!important;align-self:start!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-left>*{
  position:static!important;max-height:none!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-columns,
 body.is-community .kv-oldvk-app .kv-classic-content{
  height:auto!important;max-height:none!important;
  overflow:visible!important;
 }
 /* Messenger layout has bounded height but its thread has a genuine, independently
    scrollable column. Do not allow flex messages to shrink instead of scrolling. */
 body.kv-page-community_messages .kv-vk-messages-layout .kv-msg-shell{
  display:grid!important;grid-template-columns:270px minmax(0,1fr)!important;
  height:clamp(390px,calc(100dvh - 160px),920px)!important;
  min-height:390px!important;max-height:none!important;overflow:hidden!important;
 }
 body.kv-page-community_messages .kv-msg-shell .kv-msg-list,
 body.kv-page-community_messages .kv-msg-shell .kv-msg-conversation{
  height:100%!important;min-height:0!important;max-height:100%!important;
  overflow:hidden!important;
 }
 body.kv-page-community_messages .kv-msg-shell .kv-msg-list{
  overflow-y:auto!important;overscroll-behavior-y:contain!important;
 }
 body.kv-page-community_messages .kv-msg-shell .kv-msg-thread{
  flex:1 1 0!important;min-height:0!important;max-height:none!important;
  height:auto!important;overflow-y:scroll!important;overflow-x:hidden!important;
  overscroll-behavior-y:contain!important;scrollbar-width:thin!important;
  scrollbar-color:var(--kv77-border) transparent!important;
  -webkit-overflow-scrolling:touch;
 }
 body.kv-page-community_messages .kv-msg-thread::-webkit-scrollbar{
  display:block!important;width:8px!important;
 }
 body.kv-page-community_messages .kv-msg-thread::-webkit-scrollbar-thumb{
  border-radius:6px;background:var(--kv77-border)!important;
 }
 body.kv-page-community_messages .kv-msg-thread .kv-msg-row{
  flex:0 0 auto!important;min-height:min-content!important;
 }
 body.kv-page-community_messages .kv-msg-shell .kv-msg-compose,
 body.kv-page-community_messages .kv-msg-shell .kv-msg-person{
  flex-shrink:0!important;
 }
 body.kv-page-community_messages .kv-vk-messages-layout .kv-msg-shell.is-dialog-list{
  grid-template-columns:270px minmax(0,1fr)!important;
 }
}
@media(min-width:781px) and (max-height:720px){
 body.is-community .kv-vk-app>.kv-vk-sidebar .kv-side-ad-area{display:none!important}
 body.is-community .kv-vk-app>.kv-vk-sidebar .kv-side-item>a{padding-block:5px!important}
}
@media(min-width:781px) and (max-width:950px){
 body.kv-page-community_messages .kv-vk-messages-layout .kv-msg-shell{
  grid-template-columns:220px minmax(0,1fr)!important;
 }
}
@media(max-width:780px){
 body.is-community .kv-msg-row .kv-msg-bubble:has(.kv-msg-share-card){
  width:min(435px,94%)!important;max-width:94%!important;
 }
 body.is-community .kv-msg-share-image{max-height:300px!important}
 body.is-community .kv-msg-thread{scrollbar-width:thin!important;overflow-y:auto!important}
 body.is-community .kv-msg-thread .kv-msg-row{flex:0 0 auto!important}
}
/* Persistent link to editable needs page from 'Помочь приюту'. */
.kv-help-needs-direct{margin:14px 0}
.kv-help-needs-direct-link{
 display:inline-flex;align-items:center;gap:12px;padding:13px 18px;
 background:var(--kv77-card);border:1px solid var(--kv77-border);
 border-radius:10px;color:var(--kv77-link)!important;
 text-decoration:none!important;font-size:13px;font-weight:700;
}
.v4-help-editorial-links>a.kv-help-needs-link{border-color:var(--kv77-border)!important}
