/* Dealer portal Messages (dealer-messages.js): the conversation list beside the open conversation. */
.dm-layout{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:24px;align-items:start}
.dm-list h2{display:flex;align-items:center;gap:8px;margin:0 0 12px}
.dm-list ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.dm-item{display:grid;grid-template-columns:1fr auto;gap:2px 8px;width:100%;text-align:left;background:none;border:1px solid transparent;border-radius:4px;padding:10px 12px;font:inherit;cursor:pointer;color:inherit}
.dm-item:hover{background:#f1f6f2}.dm-item.active{border-color:#c9dccd;background:#e7efe8}
.dm-item strong{grid-column:1;font-size:14px;overflow-wrap:anywhere}.dm-item small{grid-column:1;color:var(--dp-muted,#5c625f);font-size:12px}
.dm-item .dp-count{grid-column:2;grid-row:1}.dm-unread strong{font-weight:700}
.dm-hint{font-size:13px;color:var(--dp-muted,#5c625f);margin-top:12px}
.dm-main{min-width:0;display:flex;flex-direction:column;gap:12px}
.dm-head h3{margin:2px 0 0;font-size:18px}
.dm-crown-toggle{display:inline-flex;gap:8px;align-items:center;margin-top:8px;font-size:14px}
.dm-thread{display:flex;flex-direction:column;gap:10px;max-height:55vh;overflow:auto;padding:4px 2px}
.dm-msg{border:1px solid var(--dp-border,#e2dfd7);border-radius:4px;padding:10px 12px;background:#fff}
.dm-msg{display:block}.dm-msg header{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;font-size:13px}.dm-msg header span{color:var(--dp-muted,#5c625f);font-size:12px}
.dm-msg p{margin:6px 0 0;overflow-wrap:anywhere}
.dm-mine{background:#f1f6f2;border-color:#c9dccd}.dm-msg.dm-crown{border-left:3px solid #2f5d3a}.dm-msg.dm-system{background:#f6f5f1;border-style:dashed}
.dm-compose{display:flex;flex-direction:column;gap:8px}.dm-compose label{font-weight:600;font-size:14px}
.dm-compose textarea{width:100%;box-sizing:border-box;font:inherit;padding:10px;border:1px solid #8a857a;border-radius:3px;resize:vertical}
.dm-compose div{display:flex;justify-content:flex-end}
.dm-empty{color:var(--dp-muted,#5c625f)}
.dm-back{display:none;align-self:flex-start}
@media(max-width:760px){.dm-layout{grid-template-columns:1fr}.dm-layout.dm-open .dm-list{display:none}.dm-back{display:inline-flex}.dm-thread{max-height:none}}
.dm-compose .dm-compose-row{gap:8px;flex-wrap:wrap;align-items:center}
.dm-compose .mk-pick{margin-right:auto;min-height:40px;padding:8px 14px;border:1px solid #8a857a;border-radius:3px;background:#fff;color:inherit;font:inherit;cursor:pointer}
/* Search, replies, reactions, pins and mute (everyday chat polish). */
.dm-search{display:flex;gap:6px;margin:0 0 12px}
.dm-search input{flex:1;min-width:0;font:inherit;font-size:14px;padding:8px 10px;border:1px solid #8a857a;border-radius:3px}
.dm-search-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 8px;font-size:13px;color:var(--dp-muted,#5c625f)}
.dm-hit-text{grid-column:1;font-size:13px;overflow-wrap:anywhere}
.dm-hit-text mark{background:#fff7e8;color:inherit;font-weight:600;padding:0 1px;border-radius:2px}
.dm-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.dm-muted-note{margin:0}
#dm-pins:empty{display:none}
.dm-foot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px}
.dm-foot:empty{display:none}
.dm-foot .mk-reacts{margin:0}
.dm-actions{display:inline-flex;gap:6px}
.dm-actions button{font:inherit;font-size:12px;padding:3px 9px;border:1px solid var(--dp-border,#d9d5cc);border-radius:3px;background:#fff;color:inherit;cursor:pointer}
.dm-msg .mk-pinned-flag{margin-left:auto}
.dm-new{display:flex;align-items:center;gap:8px;margin:0;color:#2f5d3a;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.dm-new::before,.dm-new::after{content:"";flex:1;border-top:1px solid currentColor;opacity:.4}
.dm-older{align-self:center}
.dm-compose .mk-replying{justify-content:flex-start}
@media(hover:hover){
  .dm-msg{position:relative}
  .dm-foot:not(:has(.mk-react)){position:absolute;top:6px;right:8px;margin:0;padding:3px;border:1px solid var(--dp-border,#e2dfd7);border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.08)}
  .dm-msg:not(:hover):not(:focus-within) .dm-foot:not(:has(.mk-react)),
  .dm-msg:not(:hover):not(:focus-within) .dm-actions,.dm-msg:not(:hover):not(:focus-within) .mk-react-add{opacity:0}
}
