/* DPD Messenger: completely independent from BuddyPress legacy UI */
.kdf-messenger,#kdf-messenger,#kdf-message-modal,.bp-messages-wrap,#send_message_form{display:none!important}
.dpdm-overlay{position:fixed;inset:0;background:rgba(15,23,42,.28);z-index:99990;opacity:0;pointer-events:none;transition:.2s}.dpdm-overlay.is-open{opacity:1;pointer-events:auto}
.dpdm-app{position:fixed;z-index:99991;top:82px;right:20px;bottom:20px;width:min(820px,calc(100vw - 40px));background:#fff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 24px 70px rgba(15,23,42,.22);overflow:hidden;transform:translateX(calc(100% + 40px));opacity:0;transition:.25s ease;font-family:inherit}.dpdm-app.is-open{transform:none;opacity:1}.dpdm-head{height:66px;display:flex;align-items:center;padding:0 16px;border-bottom:1px solid #edf0f4;background:#fff}.dpdm-head-title{display:flex;flex-direction:column;flex:1}.dpdm-head-title b{font-size:19px}.dpdm-head-title span{font-size:12px;color:#7c8798}.dpdm-icon{border:0;background:transparent;font-size:26px;cursor:pointer;width:42px;height:42px;border-radius:50%}.dpdm-icon:hover{background:#f1f5f9}.dpdm-back{display:none}.dpdm-body{display:grid;grid-template-columns:330px 1fr;height:calc(100% - 66px)}.dpdm-list-pane{border-right:1px solid #edf0f4;min-width:0}.dpdm-search{padding:12px}.dpdm-search input{width:100%;border:0!important;background:#f1f3f6!important;border-radius:12px!important;padding:11px 14px!important;box-shadow:none!important}.dpdm-threads{overflow:auto;height:calc(100% - 62px)}.dpdm-thread{width:100%;display:flex;align-items:center;gap:11px;border:0;background:#fff;padding:10px 12px;text-align:left;cursor:pointer}.dpdm-thread:hover,.dpdm-thread.active{background:#f5f7fa}.dpdm-thread img{width:48px;height:48px;border-radius:50%;object-fit:cover}.dpdm-thread-main{min-width:0;flex:1;display:flex;flex-direction:column}.dpdm-thread-main b{font-size:14px;color:#172033}.dpdm-thread-main em{font-style:normal;color:#7b8798;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dpdm-thread-meta{display:flex;align-items:flex-end;flex-direction:column;gap:5px}.dpdm-thread-meta time{font-size:11px;color:#9aa4b2}.dpdm-thread-meta i{font-style:normal;background:#2d81e0;color:#fff;min-width:20px;height:20px;border-radius:10px;text-align:center;font-size:11px;line-height:20px}.dpdm-chat-pane{min-width:0;position:relative;background:#f4f6f8}.dpdm-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#7d8795;gap:6px}.dpdm-empty-icon{font-size:44px}.dpdm-chat{height:100%;display:grid;grid-template-rows:62px 1fr auto auto}.dpdm-chat-user{position:relative;display:flex;align-items:center;gap:10px;background:#fff;border-bottom:1px solid #e9edf2;padding:8px 12px}.dpdm-chat-user img{width:42px;height:42px;border-radius:50%;object-fit:cover}.dpdm-chat-user>div:nth-child(2){display:flex;flex:1;flex-direction:column}.dpdm-chat-user span{font-size:11px;color:#8b95a5}.dpdm-menu{position:absolute;right:12px;top:54px;background:#fff;border:1px solid #e4e8ee;border-radius:12px;box-shadow:0 10px 30px rgba(15,23,42,.16);padding:6px;z-index:5}.dpdm-menu button{display:block;width:210px;border:0;background:#fff;text-align:left;padding:10px;border-radius:8px;cursor:pointer}.dpdm-menu button:hover{background:#f2f5f8}.dpdm-messages{overflow:auto;padding:18px}.dpdm-msg{display:flex;margin:7px 0}.dpdm-msg.mine{justify-content:flex-end}.dpdm-msg>div{max-width:78%;padding:9px 12px;border-radius:16px;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dpdm-msg.mine>div{background:#ddecff}.dpdm-msg p{margin:0 0 3px!important;font-size:14px;line-height:1.4}.dpdm-msg time{display:block;text-align:right;font-size:10px;color:#8792a2}.dpdm-msg-image,.dpdm-msg-video{display:block;max-width:280px;max-height:300px;border-radius:10px;margin:4px 0}.dpdm-msg-file{display:block;padding:8px 0}.dpdm-compose-row{display:flex;align-items:flex-end;gap:8px;background:#fff;border-top:1px solid #e6ebf0;padding:10px}.dpdm-compose-row textarea{flex:1;resize:none;max-height:110px;border:1px solid #dce2e8!important;border-radius:18px!important;padding:9px 12px!important;box-shadow:none!important}.dpdm-attach,.dpdm-send{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;border:0;background:#edf2f7;cursor:pointer;font-size:22px}.dpdm-send{background:#2d81e0;color:#fff}.dpdm-file-preview{padding:6px 12px;background:#fff;font-size:12px;color:#637083}.dpdm-loading,.dpdm-empty-list,.dpdm-no-msg{text-align:center;color:#8a95a5;padding:30px 12px}.dpdm-compose-modal{position:fixed;inset:0;z-index:100000;background:rgba(15,23,42,.38);display:none;align-items:center;justify-content:center;padding:16px}.dpdm-compose-modal.is-open{display:flex}.dpdm-compose-card{width:min(480px,100%);background:#fff;border-radius:18px;padding:18px;box-shadow:0 25px 70px rgba(0,0,0,.25);position:relative}.dpdm-compose-x{position:absolute;right:10px;top:8px;border:0;background:transparent;font-size:28px;cursor:pointer}.dpdm-compose-person{display:flex;align-items:center;gap:10px;margin-bottom:14px}.dpdm-compose-person img{width:46px;height:46px;border-radius:50%;object-fit:cover}.dpdm-compose-person div{display:flex;flex-direction:column}.dpdm-compose-person small{color:#8a95a5}.dpdm-compose-card textarea{width:100%;border:1px solid #dce2e8!important;border-radius:12px!important;padding:12px!important;resize:vertical;box-shadow:none!important}.dpdm-compose-actions{display:flex;align-items:center;justify-content:space-between;margin-top:12px}.dpdm-file-label{cursor:pointer;color:#536273}.dpdm-compose-actions button{border:0;background:#2d81e0;color:#fff;border-radius:10px;padding:10px 18px;cursor:pointer}
@media(max-width:900px){body.dpdm-open{overflow:hidden!important}.dpdm-overlay{display:none}.dpdm-app{inset:0;width:100%;height:100dvh;border:0;border-radius:0;transform:translateY(100%)}.dpdm-app.is-open{transform:none}.dpdm-head{height:58px}.dpdm-back{display:block}.dpdm-body{display:block;height:calc(100% - 58px)}.dpdm-list-pane,.dpdm-chat-pane{position:absolute;inset:58px 0 0 0;background:#fff}.dpdm-chat-pane{display:none}.dpdm-app.chat-open .dpdm-list-pane{display:none}.dpdm-app.chat-open .dpdm-chat-pane{display:block;top:58px}.dpdm-chat{height:100%}.dpdm-msg>div{max-width:86%}.dpdm-msg-image,.dpdm-msg-video{max-width:72vw}.dpdm-close{display:block}.dpdm-compose-modal{align-items:flex-end;padding:0}.dpdm-compose-card{width:100%;border-radius:18px 18px 0 0;padding-bottom:max(18px,env(safe-area-inset-bottom))}}

/* 1.0.1 — compose actions must always be visible */
#dpdm-compose-modal .dpdm-compose-card{display:flex!important;flex-direction:column!important;max-height:min(88vh,680px)!important;overflow:auto!important}
#dpdm-compose-modal .dpdm-compose-actions{display:flex!important;visibility:visible!important;opacity:1!important;min-height:52px!important;flex:0 0 auto!important;gap:12px!important;padding-top:12px!important;margin-top:0!important}
#dpdm-compose-modal #dpdm-compose-send{display:inline-flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;min-width:130px!important;min-height:44px!important;background:#2d81e0!important;color:#fff!important;border:0!important;border-radius:11px!important;padding:10px 20px!important;font-weight:700!important;font-size:15px!important;cursor:pointer!important}
#dpdm-compose-modal .dpdm-file-label{display:inline-flex!important;visibility:visible!important;align-items:center!important;min-height:44px!important;padding:8px 4px!important}
#dpdm-compose-modal #dpdm-compose-text{flex:0 0 auto!important;min-height:120px!important}
@media(max-width:600px){#dpdm-compose-modal .dpdm-compose-actions{display:grid!important;grid-template-columns:1fr 1fr!important}#dpdm-compose-modal #dpdm-compose-send{width:100%!important;min-width:0!important}}

/* 1.0.2: persistent profile chat on desktop; a full screen conversation on phones. */
#dpdm-compose-modal[hidden],#dpdm-chat[hidden],#dpdm-menu[hidden],#dpdm-file-preview[hidden],#dpdm-compose-preview[hidden]{display:none!important}
#dpdm-compose-modal.is-open{z-index:2147483000!important}
#dpdm-compose-modal .dpdm-compose-card{overflow:visible!important;padding:20px!important}
#dpdm-compose-modal .dpdm-compose-actions{position:relative!important;display:flex!important;justify-content:flex-end!important;align-items:center!important;flex-wrap:wrap!important;min-height:60px!important;margin-top:12px!important;z-index:2!important}
#dpdm-compose-modal #dpdm-compose-send{position:relative!important;display:inline-flex!important;min-height:46px!important;opacity:1!important;visibility:visible!important;flex:none!important}
#dpdm-compose-modal #dpdm-compose-send:disabled{opacity:.6!important}
@media(min-width:901px){body.bp-user .dpdm-overlay{display:none!important}body.bp-user .dpdm-app{top:calc(var(--kdf-header-height,82px) + var(--wp-admin--admin-bar--height,0px) + 12px)!important;right:16px!important;bottom:16px!important;width:350px!important;border-radius:16px!important;transform:none!important;opacity:1!important;visibility:visible!important;box-shadow:0 12px 36px rgba(15,23,42,.14)!important}body.bp-user .dpdm-body{display:block!important;position:relative!important}body.bp-user .dpdm-list-pane,body.bp-user .dpdm-chat-pane{position:absolute!important;inset:0!important}body.bp-user .dpdm-chat-pane{display:none!important}body.bp-user .dpdm-app.chat-open .dpdm-list-pane{display:none!important}body.bp-user .dpdm-app.chat-open .dpdm-chat-pane{display:block!important}body.bp-user .dpdm-back{display:block!important}body.bp-user .dpdm-close{display:none!important}body.bp-user .dpdm-chat{height:100%!important}body.bp-user .dpdm-thread{min-height:68px!important}body.bp-user .dpdm-threads{height:calc(100% - 65px)!important}}
@media(max-width:900px){#dpdm-compose-modal .dpdm-compose-card{max-height:min(85dvh,720px)!important;overflow:auto!important;border-radius:18px 18px 0 0!important}#dpdm-compose-modal .dpdm-compose-actions{justify-content:space-between!important}#dpdm-compose-modal #dpdm-compose-send{min-width:130px!important}}

/* Profile chat is flush with the content edge and starts below the header. */
@media(min-width:901px){body.bp-user .dpdm-app{right:0!important;width:370px!important;border-radius:16px 0 0 16px!important}body.bp-user .dpdm-chat-pane{background:#f4f6f8!important}body.bp-user .dpdm-messages{background:#f4f6f8!important}body.bp-user .dpdm-list-pane,body.bp-user .dpdm-threads{background:#f4f6f8!important}}

/* 1.0.4: avatar and name open the participant profile. */
.dpdm-thread .dpdm-profile-link,.dpdm-chat-user .dpdm-profile-link{display:inline-flex;align-items:center;color:#172033;text-decoration:none!important;cursor:pointer}
.dpdm-thread .dpdm-profile-link:hover,.dpdm-chat-user .dpdm-profile-link:hover{color:#2d81e0;text-decoration:underline!important}
.dpdm-thread .dpdm-profile-link:focus-visible,.dpdm-chat-user .dpdm-profile-link:focus-visible{outline:2px solid #2d81e0;outline-offset:2px;border-radius:6px}
.dpdm-thread .dpdm-profile-link img{flex:none}
.dpdm-chat-user .dpdm-profile-link img{display:block}

/* 1.0.8: put the exit controls below the Android status bar. */
@media(max-width:900px){#dpdm-app.dpdm-app{top:max(24px,env(safe-area-inset-top,0px))!important;bottom:0!important;left:0!important;right:0!important;height:auto!important;max-height:none!important;padding:0!important}#dpdm-app .dpdm-head{position:relative!important;z-index:3!important}#dpdm-app .dpdm-back,#dpdm-app .dpdm-close{display:grid!important;place-items:center!important;min-width:42px!important;min-height:42px!important;color:#172033!important;background:#edf2f7!important}#dpdm-app .dpdm-close::after{content:' Закрыть';font-size:13px;font-weight:700}#dpdm-app .dpdm-close{width:auto!important;padding:0 10px!important;white-space:nowrap!important}#dpdm-app .dpdm-list-pane,#dpdm-app .dpdm-chat-pane{top:58px!important}}
