/* Комментарии — общие для ленты (окно комментариев) и стены профиля.
   Поля ввода оформлены на своих страницах: home_page.css и profile_page.css. */

.pb-comment-list,.home-comments-list,.profile-comments-list{display:flex;flex-direction:column;min-width:0}
.pb-comment-thread,.home-comment-thread,.profile-comment-thread{position:relative;min-width:0}
.pb-comment-thread[hidden],.profile-comment-thread[hidden]{display:none}
.pb-comment-thread+.pb-comment-thread,.home-comment-thread+.home-comment-thread,.profile-comment-thread+.profile-comment-thread{border-top:1px solid var(--pb-color-border-subtle)}
.pb-comment-replies,.home-comment-replies,.profile-comment-replies{min-width:0;margin-left:44px;padding-left:12px;border-left:1px solid var(--pb-color-border-subtle)}
.pb-comment-item,.home-comment-item,.profile-comment-item{display:grid;grid-template-columns:32px minmax(0,1fr);align-items:start;gap:10px;min-width:0;padding:10px 0}
.pb-comment-avatar-link,.profile-comment-avatar-link{display:block;width:32px;height:32px}
.pb-comment-avatar,.home-comment-avatar,.profile-comment-avatar{display:block;width:32px;height:32px;object-fit:cover;clip-path:var(--pb-notch-4);background:var(--pb-color-surface-2)}
.pb-comment-card,.home-comment-card,.profile-comment-body{min-width:0}
.pb-comment-head,.home-comment-head,.profile-comment-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
.pb-comment-head img,.pb-comment-head video{width:14px;height:14px;object-fit:contain}
.pb-comment-name,.home-comment-name,.profile-comment-name{min-width:0;max-width:min(46vw,300px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pb-color-text-primary);font:700 14px/1.3 var(--pb-font-ui);text-decoration:none}
.pb-comment-name:hover,.profile-comment-name:hover{text-decoration:underline}
.pb-comment-time,.home-comment-time,.profile-comment-time{color:var(--pb-color-text-muted);font:500 12px/1.3 var(--pb-font-ui);white-space:nowrap}
.pb-comment-author-badge,.home-comment-author-badge{padding:2px 6px;border-radius:var(--pb-radius-xs);background:var(--pb-color-accent-soft);color:var(--pb-color-accent-foreground);font:700 12px/1.2 var(--pb-font-ui)}
.pb-comment-mention,.home-comment-mention,.profile-comment-mention{margin-top:2px;color:var(--pb-color-text-muted);font:500 13px/1.4 var(--pb-font-ui)}
.pb-comment-mention span,.home-comment-mention span,.profile-comment-mention span{color:var(--pb-color-info);font-weight:600}
.pb-comment-text,.home-comment-text,.profile-comment-text{margin-top:3px;color:var(--pb-color-text-primary);font:400 15px/1.5 var(--pb-font-ui);overflow-wrap:anywhere}
.pb-comment-text a,.home-comment-text a,.profile-comment-text a{color:var(--pb-color-info)}
.pb-comment-actions,.home-comment-actions,.profile-comment-actions{display:flex;flex-wrap:wrap;align-items:center;gap:2px;margin:4px 0 0 -8px}
.pb-comment-action,.home-comment-like-btn,.home-comment-reply-btn,.home-comment-delete-btn,.profile-comment-action{appearance:none;min-height:36px;padding:0 8px;display:inline-flex;align-items:center;gap:6px;border:0;border-radius:var(--pb-radius-sm);background:transparent;color:var(--pb-color-text-muted);font:600 13px/1 var(--pb-font-ui);cursor:pointer}
.pb-comment-action:hover,.home-comment-like-btn:hover,.home-comment-reply-btn:hover,.home-comment-delete-btn:hover,.profile-comment-action:hover{background:var(--pb-color-surface-2);color:var(--pb-color-text-primary)}
.pb-comment-action.is-liked,.home-comment-like-btn.is-liked,.profile-comment-action.is-liked{color:var(--pb-color-danger)}
.pb-comment-action.is-liked svg,.home-comment-like-btn.is-liked svg,.profile-comment-action.is-liked svg{fill:currentColor}
.pb-comment-action.is-danger:hover,.home-comment-delete-btn:hover,.profile-comment-action.is-delete-action:hover{color:var(--pb-color-danger)}
.pb-comment-action svg,.home-comment-like-btn svg,.home-comment-reply-btn svg,.home-comment-delete-btn svg,.profile-comment-action svg,.pb-comment-action .pb-ico,.profile-comment-action .pb-lucide-inline-icon{width:16px;height:16px;flex:none}
.pb-comment-media,.home-comment-gif,.home-comment-attachment,.profile-comment-gif{appearance:none;display:inline-block;max-width:min(280px,72vw);margin-top:8px;padding:0;border:0;overflow:hidden;clip-path:var(--pb-notch-4);background:var(--pb-color-surface-2);cursor:zoom-in;vertical-align:top}
.pb-comment-media img,.home-comment-gif img,.home-comment-attachment img,.profile-comment-gif img{display:block;max-width:100%;height:auto;max-height:260px;object-fit:contain}
.pb-comments-empty,.home-comments-empty{padding:32px 12px;text-align:center;color:var(--pb-color-text-muted);font:500 14px/1.5 var(--pb-font-ui)}

@media (min-width:768px){
  .pb-comment-item,.home-comment-item,.profile-comment-item{grid-template-columns:36px minmax(0,1fr)}
  .pb-comment-avatar-link,.profile-comment-avatar-link,.pb-comment-avatar,.home-comment-avatar,.profile-comment-avatar{width:36px;height:36px}
  .pb-comment-replies,.home-comment-replies,.profile-comment-replies{margin-left:48px}
}

/* Компактная иерархия: имя с бейджами → дата → адресат ответа → текст. */
.pb-comment-item .pb-comment-head{gap:4px 10px;align-items:center;line-height:1.5}
.pb-comment-identity{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;min-width:0;max-width:100%}
.pb-comment-item .pb-comment-name{max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
.pb-comment-identity img,.pb-comment-identity video,.pb-comment-identity .pb-ico{flex:none}
.pb-comment-item .pb-comment-time{font:400 15px/1.35 var(--pb-font-compact);flex:none;white-space:nowrap}
.pb-comment-item .pb-comment-author-badge{font:400 14px/1.3 var(--pb-font-compact);padding:2px 5px}
.pb-comment-item .pb-comment-mention{margin:5px 0 6px;font:400 15px/1.4 var(--pb-font-compact);overflow-wrap:anywhere}
.pb-comment-item .pb-comment-mention span{font-weight:400}
.pb-comment-item .pb-comment-text{margin-top:6px;line-height:1.65}
.pb-comment-item .pb-comment-actions{display:flex;flex-wrap:nowrap;gap:6px;margin:6px 0 0;align-items:center}
.pb-comment-item .pb-comment-actions>button{min-width:36px;height:36px;min-height:36px;padding:0 8px;justify-content:center;flex:none;gap:5px}
.pb-comment-item .pb-comment-actions>button .pb-ico,.pb-comment-item .pb-comment-actions>button svg{display:block;width:18px;height:18px}
.pb-comment-item .pb-comment-actions>button [data-profile-comment-like-count],.pb-comment-item .pb-comment-actions>button [data-comment-like-count]{font:400 13px/1 var(--pb-font-pixel)}
@media(max-width:767px){.pb-comment-replies,.profile-comment-replies,.home-comment-replies{margin-left:16px;padding-left:10px}.pb-comment-item{column-gap:8px}}

/* Draft attachments stay compact and aligned with the comment field. */
.home-comment-form :is(.home-comment-photo-preview,.home-comment-gif-preview){max-width:360px;margin:0 0 10px 48px;min-width:0}
.home-comment-form :is(.home-comment-photo-preview,.home-comment-gif-preview)[hidden]{display:none!important}
.home-comment-form .home-comment-gif-preview{position:relative;display:inline-flex;width:auto;max-width:min(240px,calc(100% - 48px));padding:6px;border:1px solid var(--pb-color-border-default);border-radius:var(--pb-radius-md);background:var(--pb-color-surface-2)}
.home-comment-form .home-comment-gif-preview>img{display:block;width:auto;max-width:100%;height:104px;object-fit:contain;border-radius:var(--pb-radius-sm)}
.home-comment-form .home-comment-gif-preview>button{appearance:none;position:absolute;right:8px;top:8px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid var(--pb-color-border-default);border-radius:var(--pb-radius-sm);background:var(--pb-color-surface-1);color:var(--pb-color-text-primary);cursor:pointer}
.home-comment-form .home-comment-gif-preview>button:hover{color:var(--pb-color-danger);background:var(--pb-color-surface-hover)}
.home-comment-form .home-comment-gif-preview>button>span{display:block;width:16px;height:16px;mask:var(--pb-lucide-url) center/contain no-repeat;-webkit-mask:var(--pb-lucide-url) center/contain no-repeat;background:currentColor}
.home-comment-form .home-comment-photo-preview .pbu-item{display:grid;grid-template-columns:52px minmax(0,1fr) 36px;gap:10px;align-items:center;padding:6px;border:1px solid var(--pb-color-border-default);border-radius:var(--pb-radius-md);background:var(--pb-color-surface-2)}
.home-comment-form .home-comment-photo-preview .pbu-preview{width:52px;height:52px;min-width:0}
.home-comment-form .home-comment-photo-preview .pbu-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 14px/1.4 var(--pb-font-compact);color:var(--pb-color-text-primary)}
.home-comment-form .home-comment-photo-preview .pbu-meta{font:400 13px/1.3 var(--pb-font-compact)}
.home-comment-form .home-comment-photo-preview .pbu-status{display:none}
.home-comment-form .home-comment-photo-preview .pbu-action{width:36px;height:36px}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview){position:relative;display:inline-flex;max-width:min(240px,100%);padding:6px;border:1px solid var(--pb-color-border-default);border-radius:var(--pb-radius-md);background:var(--pb-color-surface-2)}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview)[hidden]{display:none!important}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview)>img{display:block;width:auto;max-width:100%;height:104px;object-fit:contain;border-radius:var(--pb-radius-sm);clip-path:none}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview)>button{appearance:none;position:absolute;right:8px;top:8px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid var(--pb-color-border-default);border-radius:var(--pb-radius-sm);background:var(--pb-color-surface-1);color:var(--pb-color-text-primary);cursor:pointer}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview)>button:hover{color:var(--pb-color-danger)}
.pb-comment-form :is(.profile-comment-gif-preview,.profile-comment-photo-preview)>button>.pb-lucide-inline-icon{display:block;width:16px;height:16px;mask:var(--pb-lucide-url) center/contain no-repeat;-webkit-mask:var(--pb-lucide-url) center/contain no-repeat;background:currentColor}
@media(max-width:479px){.home-comment-form :is(.home-comment-photo-preview,.home-comment-gif-preview){margin-left:0;max-width:100%}.home-comment-form .home-comment-photo-preview{width:100%}}
