/* НП Логистика — рабочий чат, оформление 13.11.2026.
   Два вида в одном окне: список (сотрудники с отметкой «в сети», группы) и одна переписка. */
.npl-chat-review{position:fixed;right:16px;bottom:16px;z-index:1000;font:15px/1.45 Inter,"Segoe UI",Arial,sans-serif;color:#102b43}
.npl-chat-review [hidden]{display:none!important}
.npl-chat-review button{font:inherit;cursor:pointer;margin:0}
.npl-chat-review p{margin:6px 0}

/* Кнопка внизу экрана */
.npl-chat-toggle{background:#102b43;color:#fff;border:0;border-radius:26px;padding:13px 20px;font-weight:650;box-shadow:0 6px 18px #102b4340}
.npl-chat-toggle.has-unread{background:#b58e49;color:#102b43}

/* Окно */
.npl-chat-panel{position:absolute;right:0;bottom:60px;width:min(400px,calc(100vw - 32px));height:min(640px,calc(100vh - 110px));display:flex;flex-direction:column;border:1px solid #d6dfe6;border-radius:16px;background:#f4f6f8;box-shadow:0 18px 48px #102b4338;overflow:hidden}
.npl-chat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#102b43;color:#fff}
.npl-chat-head strong{font-size:16px}
.npl-chat-close{background:transparent;border:1px solid #60788c;color:#fff;border-radius:8px;padding:5px 12px;font-size:13px}
.npl-chat-review .npl-chat-status{margin:0;padding:8px 16px;background:#fff4d9;border-bottom:1px solid #e5d3a3;font-size:13px}
.npl-chat-review .npl-chat-status:empty{display:none}

/* Список: сотрудники и группы */
.npl-chat-list{flex:1;min-height:0;overflow:auto;padding:12px 14px 16px}
.npl-chat-list h3{margin:16px 2px 8px;font-size:12px;letter-spacing:.8px;text-transform:uppercase;color:#516574}
.npl-chat-list h3:first-child{margin-top:2px}
.npl-chat-people,.npl-chat-rooms{display:grid;gap:6px}
.npl-chat-person,.npl-chat-roomitem{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;text-align:left;background:#fff;border:1px solid #d6dfe6;border-radius:10px;padding:9px 12px;color:inherit}
.npl-chat-person:hover,.npl-chat-roomitem:hover{border-color:#b58e49;background:#fffaf0}
.npl-chat-personname,.npl-chat-roomtitle{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.npl-chat-person small,.npl-chat-roomitem small{color:#516574;font-size:12px;white-space:nowrap}
.npl-chat-person small.is-online{color:#1f7a45;font-weight:600}
.npl-chat-dot{flex:0 0 10px;width:10px;height:10px;border-radius:50%;background:#fff;border:2px solid #b9c6d0}
.npl-chat-dot.is-online{background:#2e9d5b;border-color:#2e9d5b}
.npl-chat-unread{flex:0 0 auto;min-width:22px;padding:2px 7px;border-radius:11px;background:#b58e49;color:#102b43;font-size:12px;font-weight:700;text-align:center}
.npl-chat-review .npl-chat-empty,.npl-chat-review .npl-chat-note,.npl-chat-review .npl-chat-hint{margin:8px 2px;color:#516574;font-size:13px}
.npl-chat-review .npl-chat-note{margin-top:16px}
/* v.2.5: пометка об администрировании — в самом низу списка, справа, мелко; под именем сотрудника — его кабинет */
.npl-chat-list{display:flex;flex-direction:column}
.npl-chat-list>*{flex:none}
.npl-chat-review .npl-chat-note{margin:auto 2px 0;padding-top:18px;text-align:right;font-size:11px;line-height:1.3;color:#8a9aa4}
.npl-chat-personname{display:flex;flex-direction:column;white-space:normal}
.npl-chat-personname>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.npl-chat-role{font-style:normal;font-weight:400;font-size:12px;color:#516574}

/* Сворачиваемые блоки */
.npl-chat-review details{display:block;margin:0;padding:0;border:1px solid #d6dfe6;border-radius:10px;background:#fff}
.npl-chat-review summary{display:block;cursor:pointer;margin:0;padding:8px 12px;border:0;background:transparent;min-height:0;font-size:13px;font-weight:600;line-height:1.4;color:#315268;list-style:none}
.npl-chat-review summary::-webkit-details-marker{display:none}
.npl-chat-review summary::after{content:" ▾";color:#8496a3}
.npl-chat-review details[open]>summary{border-bottom:1px solid #d6dfe6;color:#102b43}
.npl-chat-review details[open]>summary::after{content:" ▴"}
.npl-chat-review details>:not(summary){margin:10px 12px}
.npl-chat-review details button{background:#fff;border:1px solid #b9c6d0;border-radius:8px;padding:7px 11px;margin:3px 6px 3px 0;font-size:13px;color:#102b43}
.npl-chat-review details h2{display:none}
.npl-chat-review details div>section{margin:0}
.npl-chat-review details p{font-size:13px;color:#516574;white-space:normal}
.npl-chat-review details [role=status]{color:#102b43;font-weight:600}
.npl-chat-review details input[type=file]{display:block;width:100%;margin:0 0 8px;font-size:13px}
.npl-chat-newgroup{margin-top:10px!important}
.npl-chat-newgroup input:not([type=checkbox]){display:block;width:calc(100% - 24px);box-sizing:border-box;border:1px solid #b9c6d0;border-radius:8px;padding:9px 11px;font:inherit;min-height:42px}
.npl-chat-members{display:grid;gap:2px;max-height:170px;overflow:auto}
.npl-chat-member{display:flex;align-items:center;gap:10px;padding:6px 2px;font-size:14px;cursor:pointer}
.npl-chat-member input{width:18px;height:18px;margin:0;flex:0 0 18px}

/* Основные кнопки */
.npl-chat-review .npl-chat-primary,.npl-chat-review details .npl-chat-primary{background:#102b43;color:#fff;border:0;border-radius:10px;padding:10px 16px;font-size:14px;font-weight:650;min-height:42px}

/* Переписка */
.npl-chat-room{flex:1;min-height:0;display:flex;flex-direction:column}
.npl-chat-roomhead{display:flex;align-items:center;gap:10px;padding:8px 14px;background:#fff;border-bottom:1px solid #d6dfe6}
.npl-chat-back{background:transparent;border:0;color:#315268;font-weight:600;font-size:14px;padding:8px 6px 8px 0;white-space:nowrap}
.npl-chat-roomname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.npl-chat-roomstate{font-size:12px;color:#516574;white-space:nowrap}
.npl-chat-roomstate.is-online{color:#1f7a45;font-weight:600}
.npl-chat-older,.npl-chat-latest{align-self:center;background:transparent;border:0;color:#516574;font-size:13px;text-decoration:underline;padding:6px 8px}
.npl-chat-older:disabled{display:none}
.npl-chat-messages{flex:1;min-height:90px;overflow:auto;list-style:none;margin:0;padding:12px 14px;display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}
.npl-chat-messages:empty::before{content:"Сообщений пока нет.";color:#516574;font-size:13px;margin:auto}
.npl-chat-messages li{max-width:86%;padding:8px 12px;border-radius:14px 14px 14px 4px;background:#fff;border:1px solid #d6dfe6;align-self:flex-start}
.npl-chat-messages li.is-own{align-self:flex-end;border-radius:14px 14px 4px 14px;background:#dfe9f2;border-color:#c3d3e1}
.npl-chat-meta{display:flex;gap:12px;align-items:baseline;justify-content:space-between;font-size:12px;color:#516574}
.npl-chat-meta strong{font-weight:650;color:#315268}
.npl-chat-messages p{margin:3px 0 0;white-space:pre-wrap;font-size:15px}
.npl-chat-messages li button{display:block;margin-top:6px;background:#fff;border:1px solid #b9c6d0;border-radius:8px;padding:6px 10px;font-size:13px;color:#102b43;text-align:left}
.npl-chat-messages audio{display:block;width:100%;min-width:220px;margin-top:6px}
.npl-chat-compose{display:flex;gap:8px;align-items:flex-end;padding:10px 14px;background:#fff;border-top:1px solid #d6dfe6}
.npl-chat-compose textarea{flex:1;min-width:0;box-sizing:border-box;resize:none;border:1px solid #b9c6d0;border-radius:10px;padding:9px 11px;font:inherit;min-height:44px;max-height:120px}
.npl-chat-retry{align-self:stretch;margin:0 14px 8px!important;background:#fff4d9;border:1px solid #e5d3a3;border-radius:8px;padding:8px 10px;font-size:13px;color:#102b43}
.npl-chat-tools{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 12px;background:#fff;max-height:48%;overflow:auto}
.npl-chat-fold{flex:0 0 auto}
.npl-chat-fold[open]{flex:1 0 100%;order:-1}
.npl-chat-fold.is-active>summary{background:#e4f3ea;color:#1f7a45;border-radius:10px}
.npl-chat-fold video{display:block;width:100%;margin-top:8px;border-radius:8px;background:#102b43}
.npl-chat-fold audio{display:block;width:100%;margin-top:8px}

/* Телефон: чат на весь экран */
@media(max-width:600px){
  .npl-chat-review{right:12px;bottom:12px;font-size:16px}
  .npl-chat-panel{position:fixed;inset:0;width:auto;height:auto;border:0;border-radius:0}
  .npl-chat-head{padding:14px 16px}
  .npl-chat-close{padding:8px 14px;font-size:14px}
  .npl-chat-compose textarea{font-size:16px}
  .npl-chat-person,.npl-chat-roomitem{min-height:50px}
}

/* v.4.2: «Помощник» — первая строка списка, свой вид, без отметки «в сети»; открывается в этом же окне */
.npl-chat-assistant{display:flex;align-items:center;gap:10px;width:100%;min-height:50px;text-align:left;background:#fffaf0;border:1px solid #e2cfa6;border-left:4px solid #b58e49;border-radius:10px;padding:9px 12px;color:inherit;margin:0 0 6px}
.npl-chat-assistant:hover{border-color:#b58e49;background:#fff4df}
.npl-chat-assistant-mark{flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:#102b43;color:#fff;display:grid;place-items:center;font-weight:700;font-size:15px}
.npl-chat-assistant-view,.npl-chat-assistant-host{flex:1;min-height:0;display:flex;flex-direction:column}
@media(max-width:600px){.npl-chat-assistant{min-height:54px}}
