/* hf-dm.css — پیام‌های خصوصی */
body:has(#dmLog) .card:has(#conversationList){height:calc(100vh - 140px)!important;border-radius:22px!important;overflow:hidden!important;padding:0!important;display:flex!important;background:var(--bn-tile,#fff)!important;border:1px solid rgba(120,130,160,.18)!important;box-shadow:0 18px 50px -30px rgba(30,20,80,.45)!important}
html[data-theme="dark"] body:has(#dmLog) .card:has(#conversationList){background:#161a24!important}
/* ستون گفت‌وگوها */
.hfdm-side{width:320px;flex:0 0 320px;display:flex;flex-direction:column;min-height:0;border-inline-start:1px solid rgba(120,130,160,.16);background:linear-gradient(180deg,rgba(76,31,208,.05),rgba(14,165,233,.03))}
html[data-theme="dark"] .hfdm-side{background:#1a1e2a}
.hfdm-side-h{padding:18px 16px 10px;display:flex;flex-direction:column;gap:12px}
.hfdm-side-h b{font-size:17px;font-weight:900}
.hfdm-search{display:flex;align-items:center;gap:8px;height:42px;padding:0 12px;border-radius:13px;background:var(--bn-tile,#fff);border:1px solid rgba(120,130,160,.2)}
html[data-theme="dark"] .hfdm-search{background:#232838}
.hfdm-search:focus-within{border-color:#4C1FD0;box-shadow:0 0 0 4px rgba(76,31,208,.12)}
.hfdm-search svg{color:#4C1FD0;flex:0 0 18px}
.hfdm-search input{flex:1;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;font:inherit;font-size:13.5px;min-width:0;padding:0!important;height:auto!important}
body:has(#dmLog) #conversationList{width:auto!important;flex:1 1 auto!important;border:0!important;padding:4px 10px 12px!important;background:none!important;overflow-y:auto}
body:has(#dmLog) #conversationList .conv-row{position:relative;gap:12px!important;padding:11px 12px!important;margin:0 0 4px!important;border-radius:16px!important;border:1px solid transparent!important;background:transparent!important;transition:background .15s,border-color .15s!important}
body:has(#dmLog) #conversationList .conv-row:hover{background:rgba(76,31,208,.07)!important}
body:has(#dmLog) #conversationList .conv-row.hfdm-on{background:var(--bn-tile,#fff)!important;border-color:rgba(76,31,208,.22)!important;box-shadow:0 10px 24px -16px rgba(76,31,208,.6)}
html[data-theme="dark"] body:has(#dmLog) #conversationList .conv-row.hfdm-on{background:rgba(167,139,250,.13)!important}
body:has(#dmLog) #conversationList .conv-row.hfdm-on:before{content:"";position:absolute;right:-1px;top:12px;bottom:12px;width:3px;border-radius:3px;background:#4C1FD0}
body:has(#dmLog) #conversationList .avatar{width:46px!important;height:46px!important;border-radius:15px!important;font-size:16px!important;font-weight:800!important;flex:0 0 46px!important}
body:has(#dmLog) #conversationList .conv-row>div>div:first-child{font-size:14px!important;font-weight:800!important}
body:has(#dmLog) #conversationList .conv-row>div>div:nth-child(2){font-size:12px!important;opacity:.7;margin-top:3px}
body:has(#dmLog) #conversationList .pill{min-width:22px;height:22px;padding:0 7px!important;border-radius:11px!important;display:inline-grid!important;place-items:center;background:#e11d48!important;color:#fff!important;font-size:11px!important;font-weight:800!important;border:0!important}
.hfdm-hide{display:none!important}
/* ستون گفتگو */
body:has(#dmLog) .chat-wrap{flex:1 1 auto!important;min-width:0!important;display:flex!important;flex-direction:column!important;padding:0!important;height:auto!important;background:radial-gradient(circle at 20% 0%,rgba(76,31,208,.06),transparent 45%),radial-gradient(circle at 90% 100%,rgba(14,165,233,.06),transparent 40%)!important}
.hfdm-head{display:flex;align-items:center;gap:12px;padding:14px 20px;border-bottom:1px solid rgba(120,130,160,.16);background:rgba(255,255,255,.75);backdrop-filter:blur(10px)}
html[data-theme="dark"] .hfdm-head{background:rgba(22,26,36,.8)}
.hfdm-head .av{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;color:#fff;font-weight:800;font-size:16px}
.hfdm-head b{display:block;font-size:15px;font-weight:900}.hfdm-head small{font-size:12px;opacity:.65}
.hfdm-back{display:none;width:38px;height:38px;border-radius:12px;border:1px solid rgba(120,130,160,.2);background:transparent;color:inherit;font-size:18px;cursor:pointer}
body:has(#dmLog) #noConversationSelected{margin:auto!important;border:0!important;background:none!important;max-width:340px;text-align:center}
body:has(#dmLog) #noConversationSelected:before{content:"";display:block;width:84px;height:84px;margin:0 auto 14px;border-radius:26px;background:linear-gradient(135deg,#4C1FD0,#7c5cff) center/40px no-repeat;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H8l-4 4z'/%3E%3C/svg%3E"),linear-gradient(135deg,#4C1FD0,#7c5cff);box-shadow:0 18px 40px -16px rgba(76,31,208,.7)}
body:has(#dmLog) .chat-log{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:22px 26px!important;gap:6px!important}
body:has(#dmLog) .chat-msg{max-width:min(620px,78%)!important;gap:8px!important;margin-top:8px}
body:has(#dmLog) .chat-msg+.chat-msg.is-me,body:has(#dmLog) .chat-msg:not(.is-me)+.chat-msg:not(.is-me){margin-top:2px}
body:has(#dmLog) .chat-msg .avatar{width:30px!important;height:30px!important;border-radius:10px!important;font-size:12px!important}
body:has(#dmLog) .chat-msg.is-me .avatar{display:none!important}
body:has(#dmLog) .chat-bubble{padding:10px 15px!important;border-radius:20px!important;font-size:14.5px!important;line-height:1.85!important}
body:has(#dmLog) .chat-msg.is-me .chat-bubble{background:linear-gradient(135deg,#4C1FD0,#7c5cff)!important;color:#fff!important;border-bottom-right-radius:6px!important;box-shadow:0 10px 22px -14px rgba(76,31,208,.8)!important}
body:has(#dmLog) .chat-msg:not(.is-me) .chat-bubble{background:var(--bn-tile,#fff)!important;color:inherit!important;border:1px solid rgba(120,130,160,.16)!important;border-bottom-left-radius:6px!important;box-shadow:0 6px 16px -12px rgba(0,0,0,.25)!important}
html[data-theme="dark"] body:has(#dmLog) .chat-msg:not(.is-me) .chat-bubble{background:#232838!important}
body:has(#dmLog) .chat-when{font-size:10.5px!important;opacity:.55;margin:3px 8px 0!important}
body:has(#dmLog) .chat-sender{display:none!important}
/* کادر نوشتن */
body:has(#dmLog) .chat-input-row{margin:0 16px 16px!important;padding:8px!important;gap:8px!important;border-radius:26px!important;border:1px solid rgba(120,130,160,.2)!important;background:var(--bn-tile,#fff)!important;box-shadow:0 12px 30px -20px rgba(30,20,80,.5)!important;align-items:flex-end!important}
html[data-theme="dark"] body:has(#dmLog) .chat-input-row{background:#232838!important}
body:has(#dmLog) .chat-input-row textarea{border:0!important;background:transparent!important;box-shadow:none!important;padding:11px 12px!important;min-height:44px!important;height:44px;max-height:150px;border-radius:18px!important;font-size:14.5px!important;resize:none!important}
body:has(#dmLog) .chat-input-row .btn-primary{height:44px!important;min-width:44px!important;border-radius:22px!important;padding:0 20px!important}
body:has(#dmLog) .chat-input-row>button:not(.btn-primary){width:44px!important;height:44px!important;border-radius:50%!important;padding:0!important;background:rgba(76,31,208,.08)!important;border:0!important;color:#4C1FD0!important}
@media (max-width:760px){
  body:has(#dmLog) .card:has(#conversationList){height:calc(100vh - 120px)!important;border-radius:18px!important}
  .hfdm-side{width:100%;flex-basis:100%;border:0}
  body.hfdm-open .hfdm-side{display:none}
  body:not(.hfdm-open) .chat-wrap{display:none!important}
  .hfdm-back{display:grid;place-items:center}
  body:has(#dmLog) .chat-log{padding:14px!important}
  body:has(#dmLog) .chat-msg{max-width:88%!important}
  body:has(#dmLog) .chat-input-row{margin:0 8px 8px!important}
  body:has(#dmLog) .chat-input-row textarea{font-size:16px!important}
}
