/* R188.5.5.6.80 — Social & Communication Window Flow */

/* Сообщество остаётся рабочей поверхностью. Детали — крупные окна, а не вложенные страницы. */
.k-community-page{display:grid;gap:16px}
.k-community-page .k-community-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0}
.k-community-page .k-community-head p{max-width:760px}
.k-community-page .k-community-native-section,
.k-community-page .k-community-groups,
.k-community-page .k-community-feed-tools{margin:0}
.k-community-page .k-community-card{box-shadow:none;border-color:var(--k-border,#e5e7eb)}
.k-community-page .k-community-card>header,
.k-community-page .k-community-card>footer{background:transparent}
.k-community-page .k-community-body{cursor:pointer}

/* Локальный social dialog используется только для обычной публикации/новости/группы. */
dialog.k-community-dialog{width:min(1080px,calc(100vw - 32px));max-width:none;height:min(86dvh,920px);max-height:none;margin:auto;border:0;border-radius:28px;padding:0;overflow:auto;background:var(--k-surface,#fff);box-shadow:0 28px 90px rgba(15,23,42,.28)}
dialog.k-community-dialog::backdrop{background:rgba(15,23,42,.52);backdrop-filter:blur(6px)}
dialog.k-community-dialog>[data-community-close],
dialog.k-community-dialog>[data-community-filter-close]{position:sticky;top:14px;float:right;z-index:5;width:44px;height:44px;margin:14px 14px -58px 0;border:0;border-radius:50%;background:rgba(248,250,252,.96);font-size:28px;line-height:1;cursor:pointer;box-shadow:0 8px 24px rgba(15,23,42,.12)}
dialog.k-community-dialog [data-community-dialog-body],
dialog.k-community-dialog [data-community-filter-body]{min-height:100%;padding:26px}
.k-community-dialog-post{max-width:880px;margin:0 auto;display:grid;gap:18px}
.k-community-dialog-post>header{display:flex;align-items:center;gap:12px;padding-right:56px}
.k-community-dialog-post>header>div{display:grid;gap:3px}
.k-community-dialog-post>img,.k-community-dialog-video{width:100%;max-height:58dvh;object-fit:contain;border-radius:22px;background:#f1f5f9}
.k-community-dialog-post>h2{margin:0;font-size:clamp(26px,4vw,40px)}
.k-community-dialog-post>p{margin:0;white-space:pre-wrap;line-height:1.65;color:var(--k-muted,#667085)}
.k-community-dialog-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-block:4px;border-block:1px solid var(--k-border,#e5e7eb)}
.k-community-dialog-actions button{display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:0 12px;border:0;border-radius:12px;background:transparent;font:inherit;font-weight:700;cursor:pointer}
.k-community-dialog-actions button:hover,.k-community-dialog-actions button.is-active{background:var(--k-surface-2,#f5f6f8)}
.k-community-comments{display:grid;gap:12px;padding-top:8px}
.k-community-comments>header{display:flex;align-items:center;justify-content:space-between}
.k-community-comment{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;padding:12px 0;border-bottom:1px solid var(--k-border,#e5e7eb)}
.k-community-comment:last-child{border-bottom:0}
.k-community-comment p{margin:5px 0;white-space:pre-wrap}
.k-community-comment time{font-size:12px;color:var(--k-muted,#667085)}
.k-community-comments form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;position:sticky;bottom:0;padding-top:12px;background:linear-gradient(180deg,rgba(255,255,255,0),var(--k-surface,#fff) 24%)}
.k-community-comments form input{min-height:48px;border:1px solid var(--k-border,#d0d5dd);border-radius:14px;padding:0 14px;font:inherit;background:var(--k-surface,#fff)}
.k-community-comments form button{min-width:120px;border:0;border-radius:14px;background:#111827;color:#fff;font-weight:800;padding:0 18px}

/* Выполненная работа внутри общего Entity Window. */
.k-entity-window [data-work-detail-root]{width:100%;max-width:1040px;margin:0 auto;padding:0}
.k-entity-window [data-work-detail-root]>.k-social-post{border:0;border-radius:0;box-shadow:none}
.k-entity-window .k-social-detail .k-social-card__body{padding-inline:0}
.k-entity-window .k-work-detail-story-grid{gap:1px;border:1px solid var(--k-border,#e5e7eb);border-radius:20px;overflow:hidden;background:var(--k-border,#e5e7eb)}
.k-entity-window .k-work-detail-story{border:0;border-radius:0}
.k-entity-window .k-work-detail-facts{border-block:1px solid var(--k-border,#e5e7eb);padding-block:10px}
.k-entity-window .k-comments-page{margin-top:18px;border-top:1px solid var(--k-border,#e5e7eb);padding-top:18px}

/* Чаты — самостоятельное рабочее пространство; новый диалог — настоящий native dialog. */
.k-chat-page .k-chat-layout{box-shadow:none}
dialog.k-chat-contact-dialog{width:min(760px,calc(100vw - 32px));max-width:none;max-height:min(86dvh,820px);margin:auto;border:0;border-radius:28px;padding:0;overflow:hidden;background:transparent}
dialog.k-chat-contact-dialog::backdrop{background:rgba(15,23,42,.52);backdrop-filter:blur(6px)}
dialog.k-chat-contact-dialog .k-chat-contact-sheet{width:100%;max-height:min(86dvh,820px);border-radius:28px;box-shadow:0 28px 90px rgba(15,23,42,.28)}
.k-chat-head-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.k-chat-head-actions a,.k-chat-head-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 11px;border:1px solid var(--k-border,#e5e7eb);border-radius:12px;background:var(--k-surface,#fff);color:var(--k-text,#111827);font:inherit;font-size:13px;font-weight:800;text-decoration:none;cursor:pointer}
.k-chat-head-actions a:hover,.k-chat-head-actions button:hover{background:var(--k-surface-2,#f5f6f8)}

@media(max-width:760px){
  .k-community-page{gap:12px}
  .k-community-page .k-community-head{align-items:flex-start}
  dialog.k-community-dialog,dialog.k-chat-contact-dialog{width:100vw;height:100dvh;max-height:none;border-radius:0;margin:0}
  dialog.k-community-dialog [data-community-dialog-body],dialog.k-community-dialog [data-community-filter-body]{padding:18px 14px 110px}
  dialog.k-community-dialog>[data-community-close],dialog.k-community-dialog>[data-community-filter-close]{top:8px;margin:8px 8px -52px 0}
  .k-community-dialog-post>header{padding-right:48px}
  .k-community-comments form{grid-template-columns:1fr;padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .k-community-comments form button{min-height:46px}
  dialog.k-chat-contact-dialog .k-chat-contact-sheet{width:100%;height:100%;max-height:none;border-radius:0;padding-bottom:max(0px,env(safe-area-inset-bottom))}
  .k-chat-head-actions{gap:5px}.k-chat-head-actions a{padding-inline:8px;font-size:12px}
}
.k-community-author-link{color:inherit;text-decoration:none}.k-community-author-link:hover{text-decoration:underline;text-underline-offset:3px}
.k-work-detail-related-actions{display:flex;gap:8px;flex-wrap:wrap;padding:16px 0 4px;border-top:1px solid var(--k-border,#e5e7eb)}
