/* Stage68: community responsive polish, friend actions, sharing, unified dark/light surfaces. */
body.shelter-dark {
 --k68-bg:#141414;--k68-card:#242424;--k68-card-hi:#2c2c2c;
 --k68-input:#303030;--k68-edge:#414141;--k68-fg:#efefef;
 --k68-muted:#acb3bd;--k68-blue:#a0cafa;
 --k68-glow:0 7px 20px #0006;
}
body.shelter-light{
 --k68-bg:#f0f4f8;--k68-card:#fff;--k68-card-hi:#f5f8fc;
 --k68-input:#f4f7fb;--k68-edge:#dce6ef;--k68-fg:#25364a;
 --k68-muted:#647c95;--k68-blue:#3275ba;
 --k68-glow:0 7px 23px #14345b18;
}
body.is-community .kv-share-popover{
 background:var(--k68-card)!important;color:var(--k68-fg)!important;
 border:1px solid var(--k68-edge)!important;box-shadow:var(--k68-glow)!important;
 border-radius:13px!important;
}
body.is-community .kv-share-popover :is(.kv-share-popover-heading,.kv-share-options label,.kv-share-note,.kv-share-note textarea,.kv-share-hint){
 color:var(--k68-fg)!important;
}
body.is-community .kv-share-options label{
 border:1px solid transparent;border-radius:9px!important;background:transparent!important;
 padding:11px 10px!important;line-height:1.3!important;cursor:pointer;
 min-height:39px;box-sizing:border-box;
}
body.is-community .kv-share-options label:has(input:checked){
 background:var(--k68-card-hi)!important;border-color:var(--k68-edge)!important;
 color:var(--k68-blue)!important;
}
body.is-community .kv-share-popover input[type=radio]{
 accent-color:var(--k68-blue);flex:0 0 auto;width:17px;height:17px;
}
body.is-community .kv-share-popover .kv-share-options label span{color:inherit!important}
body.is-community .kv-share-popover :is(select,textarea){
 background:var(--k68-input)!important;color:var(--k68-fg)!important;
 border:1px solid var(--k68-edge)!important;border-radius:9px!important;
 padding:10px 11px!important;font:13px system-ui,sans-serif!important;min-width:0;
 width:100%!important;max-width:100%!important;box-sizing:border-box;
}
body.is-community .kv-share-popover :is(select,textarea):focus{
 outline:2px solid var(--k68-blue)!important;outline-offset:1px;
}
body.is-community .kv-share-popover textarea::placeholder{color:var(--k68-muted)!important}
body.is-community .kv-share-popover .kv-share-note{color:var(--k68-muted)!important}
body.is-community .kv-share-popover .kv-share-hint{color:var(--k68-blue)!important}
body.is-community .kv-share-popover .kv-share-confirm{
 display:block!important;width:100%!important;min-height:42px!important;
 background:var(--k68-card-hi)!important;color:var(--k68-fg)!important;
 border:1px solid var(--k68-edge)!important;border-radius:9px!important;
 box-shadow:none!important;font-weight:700!important;
}
body.is-community .kv-share-popover .kv-photo-share-status{color:var(--k68-fg)!important;line-height:1.5}
body.is-community .kv-photo-dialog{
 background:var(--k68-card)!important;color:var(--k68-fg)!important;border-color:var(--k68-edge)!important;
}
body.is-community :is(.kv-lightbox-side,.kv-lightbox-chat,.kv-lightbox-head,.kv-lightbox-toolbar,.kv-lightbox-chat .kv-post-comments,.kv-lightbox-chat .kv-comments-tree){
 background:var(--k68-card)!important;color:var(--k68-fg)!important;border-color:var(--k68-edge)!important;
}
body.is-community .kv-lightbox-photo-pane{background:var(--k68-bg)!important}
body.is-community :is(.kv-share-arrow,.kv-post-share-toggle){
 display:inline-flex;align-items:center;gap:5px;justify-content:center;
 min-height:37px;color:var(--k68-muted)!important;cursor:pointer;
 border:1px solid transparent!important;border-radius:9px;
 background:transparent!important;
}
body.is-community :is(.kv-share-arrow,.kv-post-share-toggle):hover{
 color:var(--k68-blue)!important;background:var(--k68-card-hi)!important;
 border-color:var(--k68-edge)!important;
}
body.is-community .kv-post-share-toggle span{font-size:12px;color:inherit}
body.is-community .kv-post-reactions{display:flex!important;flex-wrap:wrap!important;
 align-items:center!important;justify-content:space-between!important;
 gap:5px;min-width:0}
body.is-community .kv-post-share-anchor{margin-left:auto;position:relative}
body.is-community .kv-post-share-anchor .kv-share-popover{z-index:44}
body.is-community .kv-share-anchor .kv-photo-share-form{max-width:100%}
body.is-community .kv-person-more>summary::-webkit-details-marker{display:none}
body.is-community .kv-mobile-person-actions{display:none}
@media(max-width:780px){
 html,body{overflow-x:clip!important}
 body.is-community .kv-oldvk-app .kv-classic-avatar-card{overflow:hidden!important}
 body.is-community .kv-oldvk-app .kv-classic-info-card{
  height:auto!important;max-height:none!important;min-height:0!important;
  overflow:visible!important;display:block!important;clear:both!important;
  padding:15px 14px 17px!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-name-row{gap:0!important;margin-bottom:6px!important}
 body.is-community .kv-oldvk-app .kv-classic-name{max-width:100%!important;min-width:0!important}
 body.is-community .kv-oldvk-app .kv-classic-name :is(h1,small){overflow-wrap:anywhere!important;white-space:normal!important}
 body.is-community .kv-oldvk-app .kv-mobile-profile-stats{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:100%!important;box-sizing:border-box!important;align-items:stretch!important;
  height:auto!important;min-height:66px!important;max-height:none!important;
  margin:10px 0 5px!important;padding:13px 0 5px!important;
  overflow:visible!important;gap:0!important;
 }
 body.is-community .kv-oldvk-app .kv-mobile-profile-stats a{
  min-width:0!important;min-height:49px!important;max-height:none!important;
  display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;
  text-align:center!important;padding:3px 1px!important;
  text-decoration:none!important;overflow:visible!important;
 }
 body.is-community .kv-oldvk-app .kv-mobile-profile-stats strong{
  display:block;line-height:1.25!important;font-size:17px!important;
 }
 body.is-community .kv-oldvk-app .kv-mobile-profile-stats small{
  display:block!important;font-size:10px!important;line-height:1.3!important;
  color:var(--k68-muted)!important;white-space:normal!important;
  overflow-wrap:anywhere!important;
 }
 body.is-community .kv-oldvk-app .kv-mobile-profile-role{
  color:var(--k68-muted)!important;font-size:11px!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-info-body{clear:both;min-height:0}
 body.is-community .kv-oldvk-app .kv-profile-accordion{margin-top:5px}
 /* Actions belong to the person's profile, not to the avatar crop. */
 body.is-community .kv-oldvk-app .kv-mobile-person-actions{
  order:3;display:flex!important;flex-direction:column;gap:9px;
  width:100%;max-width:100%;min-width:0;box-sizing:border-box;
  padding:12px!important;margin:0 0 12px!important;
  border-radius:13px!important;background:var(--k68-card)!important;
  color:var(--k68-fg)!important;border:1px solid var(--k68-edge)!important;
  box-shadow:var(--k68-glow)!important;overflow:visible!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-recent-photos{order:4}
 body.is-community .kv-oldvk-app .kv-vk-wall{order:5}
 .kv-mobile-person-actions form{margin:0!important;min-width:0}
 .kv-mobile-person-actions-primary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
 .kv-mobile-person-actions-primary>a,.kv-mobile-person-actions-primary>form{
  display:flex;min-width:0;width:100%;height:100%;
 }
 .kv-mobile-person-actions .kv-person-action,
 .kv-mobile-person-actions .kv-person-more>summary,
 .kv-mobile-person-actions .kv-person-verify-action button{
  display:flex;justify-content:center;align-items:center;gap:6px;
  box-sizing:border-box;width:100%!important;min-width:0;min-height:44px!important;
  border:1px solid var(--k68-edge)!important;border-radius:10px!important;
  padding:9px 8px!important;background:var(--k68-card-hi)!important;
  color:var(--k68-fg)!important;font-size:12px!important;
  font-weight:650!important;line-height:1.3!important;text-align:center;
  text-decoration:none!important;white-space:normal!important;overflow-wrap:anywhere;
  cursor:pointer;
 }
 .kv-mobile-person-actions .kv-person-action-message{
  background:linear-gradient(130deg,#37648f,#294f74)!important;
  color:#f8fcff!important;border-color:#426c95!important;
 }
 .kv-mobile-person-actions .kv-person-action-message svg{flex:0 0 18px}
 .kv-mobile-person-actions-secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .kv-mobile-person-actions-secondary>form{width:100%}
 .kv-mobile-person-actions-secondary>.kv-person-more:only-child{grid-column:2}
 .kv-person-more{position:relative;min-width:0}
 .kv-person-more>summary{list-style:none;cursor:pointer}
 .kv-person-more-content{
  position:absolute;z-index:38;top:calc(100% + 6px);right:0;
  width:min(250px,calc(100vw - 45px));padding:7px;
  background:var(--k68-card);border:1px solid var(--k68-edge);
  border-radius:12px;box-shadow:var(--k68-glow);
 }
 .kv-person-more-content a,.kv-person-more-content button{
  display:block!important;box-sizing:border-box;
  width:100%!important;min-height:42px;padding:11px 12px!important;
  border:0!important;border-radius:8px;background:transparent!important;
  text-decoration:none!important;text-align:left!important;
  color:var(--k68-fg)!important;font-size:12px!important;line-height:1.5!important;
 }
 .kv-person-more-content :is(a,button):hover{background:var(--k68-card-hi)!important}
 .kv-person-verify-action button{color:var(--k68-blue)!important;font-size:11px!important}
 .kv-profile-action-status{font-size:12px;color:var(--k68-muted)}
 /* Settings, user forms, CRM buttons never overrun mobile width. */
 body.is-crm .crm-main,body.is-crm .crm-shell{width:100%!important;max-width:100%!important;min-width:0!important}
 body.is-crm .crm-head{display:flex!important;flex-wrap:wrap!important;gap:9px!important;min-width:0!important}
 body.is-crm .crm-head>.form-actions,body.is-crm .crm-head .form-actions{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;width:100%!important;min-width:0!important;
 }
 body.is-crm .crm-head .form-actions>*{
  min-width:0!important;max-width:none!important;width:100%!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
  text-align:center!important;line-height:1.35!important;
  min-height:42px!important;height:auto!important;display:flex!important;
  justify-content:center!important;align-items:center!important;
  padding:9px 8px!important;font-size:11px!important;box-sizing:border-box!important;
 }
 body.is-crm .crm-sidebar{display:none!important}
 body.is-crm .crm-main{padding:13px 12px 26px!important}
 body.is-crm :is(.crm-panel,.crm-head,.crm-details,.crm-form,.form-grid){
  max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
 }
 body.is-crm .crm-panel :is(input,textarea,select,button){max-width:100%!important;min-width:0}
 body.is-crm .crm-form .form-grid{grid-template-columns:1fr!important}
 /* Share panel is a real phone-width bottom sheet, not a 290px popup clipped by photo. */
 body.is-community .kv-share-popover:not([hidden]){
  position:fixed!important;left:10px!important;right:10px!important;
  bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
  top:auto!important;width:auto!important;max-width:520px!important;
  max-height:min(76dvh,560px)!important;
  z-index:999!important;padding:15px!important;margin:0 auto!important;
  overflow-y:auto!important;overscroll-behavior:contain!important;
  border-radius:17px!important;
  box-shadow:0 0 0 100vmax #0009,0 15px 45px #0008!important;
 }
 body.is-community .kv-share-popover .kv-share-popover-heading{font-size:15px!important;margin-bottom:12px!important}
 body.is-community .kv-share-popover :is(select,textarea){font-size:16px!important}
 body.is-community .kv-share-popover .kv-share-options{gap:6px!important}
 body.is-community .kv-share-popover .kv-share-options label{min-height:44px!important}
 body.is-community .kv-share-popover .kv-share-disabled{opacity:.5!important}
 body.is-community .kv-photo-dialog-content{height:100%!important;max-width:100%!important}
 body.is-community .kv-lightbox-side{padding:10px!important;min-width:0!important}
 body.is-community .kv-lightbox-chat{min-height:0!important;max-width:100%!important}
 body.is-community .kv-lightbox-chat :is(.kv-comments-tree,.kv-post-comments){max-width:100%!important;overflow-x:hidden!important}
 body.is-community :is(.kv-lightbox-toolbar,.kv-post-reactions){width:100%;box-sizing:border-box;max-width:100%}
 body.is-community .kv-post-share-toggle{min-height:36px!important;padding:5px 9px!important}
 body.is-community .kv-post-share-toggle span{font-size:11px!important}
}
@media(max-width:355px){
 .kv-mobile-person-actions-primary{grid-template-columns:1fr}
 .kv-mobile-person-actions-secondary{grid-template-columns:1fr 1fr}
 body.is-crm .crm-head .form-actions{grid-template-columns:1fr!important}
 body.is-community .kv-oldvk-app .kv-mobile-profile-stats small{font-size:9px!important}
}
@media(min-width:781px){
 body.is-community .kv-mobile-person-actions{display:none!important}
}

/* Stage68 supplementary colour and avatar geometry fixes. */
body.is-community .kv-classic-recent-empty{
 display:grid!important;place-items:center!important;min-height:86px!important;
 background:var(--k68-card-hi)!important;color:var(--k68-muted)!important;
 border:1px dashed var(--k68-edge)!important;border-radius:10px!important;
 padding:13px!important;box-sizing:border-box;text-align:center;
}
body.is-community :is(.kv-lightbox-chat,.kv-vk-wall) .kv-comment-avatar{
 display:block!important;flex:0 0 35px!important;
 width:35px!important;height:35px!important;max-width:35px!important;max-height:35px!important;
 min-width:35px!important;min-height:35px!important;
 object-fit:cover!important;object-position:center!important;
 border-radius:50%!important;aspect-ratio:1!important;
}
body.is-community .kv-comment .kv-comment-main{
 min-width:0!important;max-width:100%!important;flex:1 1 auto!important;
}
body.is-community .kv-comment{
 display:flex!important;align-items:flex-start!important;gap:9px!important;
 min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;
}
body.is-community .kv-comment .kv-comment{
 margin-left:4px!important;padding-left:7px!important;border-left:1px solid var(--k68-edge)!important;
}
@media(max-width:780px){
 body.is-community .kv-oldvk-app .kv-classic-recent-photos{
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;padding-bottom:13px!important;
 }
 body.is-community .kv-oldvk-app .kv-classic-recent-empty{
  min-height:70px!important;color:var(--k68-muted)!important;
 }
 body.is-community .kv-post .kv-post-head{
  display:flex;align-items:center;min-width:0!important;gap:9px!important;
 }
 body.is-community .kv-post .kv-post-head >div{min-width:0!important;flex:1 1 auto!important}
 body.is-community .kv-post .kv-post-head a{overflow-wrap:anywhere}
}
