/* SocialPress V4.5.7 — definitive comments viewer layout */
.sp-comments-modal.is-open{display:flex!important;align-items:center!important;justify-content:center!important}
.sp-comments-dialog{overflow:hidden!important}
.sp-comments-dialog-head{flex:0 0 50px!important;height:50px!important;min-height:50px!important;padding:0 12px!important;display:flex!important;justify-content:flex-end!important;align-items:center!important;background:#fff!important;border-bottom:1px solid #e4e6eb!important}
.sp-comments-dialog-head h3,.sp-comments-dialog-close-left,.sp-comments-dialog-handle{display:none!important}
.sp-comments-dialog-close{width:38px!important;height:38px!important;flex:0 0 38px!important;margin:0!important}
.sp-comments-dialog-body{min-height:0!important;flex:1 1 auto!important;overflow:hidden!important;background:#fff!important}
.sp-comments-dialog-body>.sp-dialog-layout{height:100%!important;min-height:0!important;overflow:hidden!important}

/* Text/shared posts: conversation-only; there is never a fake media canvas. */
.sp-comments-dialog.is-text-post{width:min(760px,calc(100vw - 32px))!important;height:min(86dvh,780px)!important;max-height:86dvh!important;background:#fff!important}
.sp-comments-dialog.is-text-post .sp-comments-dialog-body{background:#fff!important}
.sp-comments-dialog.is-text-post .sp-dialog-layout.no-media{display:block!important;width:100%!important;height:100%!important;max-width:none!important;margin:0!important;background:#fff!important}
.sp-comments-dialog.is-text-post .sp-dialog-layout.no-media>:not(.sp-dialog-side-pane){display:none!important}
.sp-comments-dialog.is-text-post .sp-dialog-side-pane{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;margin:0!important;border:0!important;background:#fff!important;overflow:hidden!important}
.sp-comments-dialog .sp-dialog-no-media,.sp-comments-dialog .sp-dialog-no-media-copy,.sp-comments-dialog .sp-post-public-title,.sp-comments-dialog .sp-shared-post-title{display:none!important}

/* Shared source is context, not the popup title. */
.sp-comments-dialog.is-text-post .sp-shared-post-card{flex:0 0 auto!important;margin:0!important;border-left:0!important;border-right:0!important;border-radius:0!important;max-height:265px!important;overflow:hidden!important}
.sp-comments-dialog.is-text-post .sp-shared-post-copy{max-height:62px!important;overflow:hidden!important}
.sp-comments-dialog.is-text-post .sp-shared-post-text{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;padding:4px 12px 9px!important}
.sp-comments-dialog.is-text-post .sp-shared-post-preview,.sp-comments-dialog.is-text-post .sp-shared-post-media,.sp-comments-dialog.is-text-post .sp-shared-post-video .sp-media-item{height:145px!important;max-height:145px!important;min-height:0!important}
.sp-comments-dialog.is-text-post .sp-shared-post-preview img,.sp-comments-dialog.is-text-post .sp-shared-post-video .sp-media-el{width:100%!important;height:100%!important;max-height:145px!important;object-fit:cover!important}
.sp-comments-dialog.is-text-post .sp-shared-post-footer{display:none!important}

/* Stable vertical conversation layout. */
.sp-comments-dialog .sp-dialog-side-pane{min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.sp-comments-dialog .sp-dialog-post-head{flex:0 0 auto!important}
.sp-comments-dialog .sp-dialog-post-text{flex:0 0 auto!important;max-height:110px!important;overflow-y:auto!important}
.sp-comments-dialog .sp-dialog-statline,.sp-comments-dialog .sp-dialog-actions,.sp-comments-dialog .sp-dialog-comments-head{flex:0 0 auto!important}
.sp-comments-dialog .sp-dialog-comments-scroll{flex:1 1 0!important;min-height:90px!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;padding-bottom:12px!important}
.sp-comments-dialog .sp-dialog-form-shell{display:block!important;visibility:visible!important;opacity:1!important;flex:0 0 auto!important;min-height:64px!important;padding:8px 12px max(8px,env(safe-area-inset-bottom))!important;background:#fff!important;border-top:1px solid #e4e6eb!important;position:relative!important;z-index:4!important}

/* Fix comment/profile avatars even when global img{height:auto} is active. */
.sp-comments-dialog .sp-dialog-comment-avatar{width:40px!important;height:40px!important;flex:0 0 40px!important;overflow:hidden!important;border-radius:50%!important;line-height:0!important}
.sp-comments-dialog .sp-dialog-comment-avatar>img.sp-avatar{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;max-width:40px!important;max-height:40px!important;aspect-ratio:1/1!important;object-fit:cover!important;border-radius:50%!important;display:block!important}
.sp-comments-dialog .sp-dialog-comment-input-row>img.sp-avatar{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;aspect-ratio:1/1!important;object-fit:cover!important;border-radius:50%!important;display:block!important;flex:0 0 36px!important}
.sp-comments-dialog .sp-shared-post-author-avatar{width:34px!important;height:34px!important;flex:0 0 34px!important;border-radius:50%!important;overflow:hidden!important}
.sp-comments-dialog .sp-shared-post-author-avatar img{width:34px!important;height:34px!important;object-fit:cover!important;border-radius:50%!important;display:block!important}

/* Thin modern scrollbar limited to popup scroll regions. */
.sp-comments-dialog .sp-dialog-comments-scroll,.sp-comments-dialog .sp-dialog-post-text{scrollbar-width:thin;scrollbar-color:#aeb7c4 transparent}
.sp-comments-dialog .sp-dialog-comments-scroll::-webkit-scrollbar,.sp-comments-dialog .sp-dialog-post-text::-webkit-scrollbar{width:5px}
.sp-comments-dialog .sp-dialog-comments-scroll::-webkit-scrollbar-track,.sp-comments-dialog .sp-dialog-post-text::-webkit-scrollbar-track{background:transparent}
.sp-comments-dialog .sp-dialog-comments-scroll::-webkit-scrollbar-thumb,.sp-comments-dialog .sp-dialog-post-text::-webkit-scrollbar-thumb{background:#aeb7c4;border-radius:999px}

@media(max-width:800px){
  .sp-comments-modal.is-open{align-items:flex-end!important}
  .sp-comments-dialog.is-text-post,.sp-comments-dialog.is-media-post{width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important}
  .sp-comments-dialog-head{height:48px!important;min-height:48px!important;flex-basis:48px!important}
  .sp-comments-dialog.is-text-post .sp-shared-post-card{max-height:220px!important}
  .sp-comments-dialog.is-text-post .sp-shared-post-preview,.sp-comments-dialog.is-text-post .sp-shared-post-media,.sp-comments-dialog.is-text-post .sp-shared-post-video .sp-media-item{height:120px!important;max-height:120px!important}
  .sp-comments-dialog.is-text-post .sp-shared-post-preview img,.sp-comments-dialog.is-text-post .sp-shared-post-video .sp-media-el{max-height:120px!important}
  .sp-comments-dialog .sp-dialog-post-text{max-height:82px!important}
  .sp-comments-dialog .sp-dialog-comments-scroll{min-height:80px!important;padding:6px 10px 10px!important}
  .sp-comments-dialog .sp-dialog-form-shell{min-height:62px!important;padding:7px 9px max(7px,env(safe-area-inset-bottom))!important}
}
