/* Scoped additions; preserve existing inbox, marketplace, and safety layouts. */
#dmModal .dm-sheet{position:relative}
.dm-attach{display:grid;place-items:center;flex:none;width:38px;height:38px;border:0;border-radius:50%;background:#f3f0fb;color:#7255d6;font-size:28px;line-height:1;cursor:pointer}
.dm-attach:disabled{color:#bcb7c8;background:#f7f6f9;cursor:default}
.dm-photo-drafts{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.dm-photo-drafts:not(:empty){padding:4px 4px 12px}
.dm-photo-draft{position:relative;width:68px;height:68px}
.dm-photo-draft img{width:100%;height:100%;object-fit:cover;border-radius:12px;border:1px solid #e6e1ef}
.dm-photo-draft button{position:absolute;right:-6px;top:-6px;width:28px;height:28px;border:2px solid white;border-radius:50%;background:#383344;color:white;font-size:20px;line-height:20px;cursor:pointer}
.dm-photo-note{font-size:11px;color:#867f94;flex-basis:100%}
.dm-message-tools{display:flex;align-items:center;gap:3px;min-height:28px;margin:2px 0}
.dm-mine .dm-message-tools{justify-content:flex-end}
.dm-message-menu{border:0;background:transparent;color:#9991a7;font-size:21px;line-height:24px;min-width:36px;min-height:32px;border-radius:14px;cursor:pointer}
.dm-message-menu:hover,.dm-message-menu:focus-visible{background:#eee9fc;color:#6645c7}
.dm-reactions{display:flex;flex-wrap:wrap;gap:4px}
.dm-reaction{display:flex;align-items:center;gap:4px;min-height:30px;padding:3px 9px;border:1px solid #e5e1ed;border-radius:16px;background:#faf9fc;color:#655e72;font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;cursor:pointer}
.dm-reaction.is-mine{border-color:#b4a0f2;background:#f0eafb;color:#6747bb}
.dm-sent-photos{display:flex;flex-direction:column;gap:4px;width:min(260px,62vw);margin-bottom:4px}
.dm-sent-photo{display:grid;place-items:center;width:100%;min-height:140px;overflow:hidden;border:1px solid #e9e5ee;border-radius:16px;background:#f4f1f8;color:#837b91;font-size:12px;padding:0;cursor:pointer;aspect-ratio:4/3}
.dm-sent-photo img{display:block;width:100%;height:100%;object-fit:cover}
.dm-action-backdrop,.dm-photo-viewer{position:absolute;inset:0;z-index:3;display:flex;align-items:flex-end;background:#21153552}
.dm-action-sheet{width:100%;padding:18px 18px max(22px,env(safe-area-inset-bottom));border-radius:24px 24px 0 0;background:#fff;box-shadow:0 -8px 32px #241b2710;box-sizing:border-box}
.dm-action-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;color:#3e354d;font-size:15px}
.dm-action-heading button{width:36px;height:36px;border:0;background:#f5f3f8;border-radius:50%;font-size:25px;color:#8c829b;cursor:pointer}
.dm-emoji-choices{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.dm-emoji-choices button{min-height:48px;border:1px solid transparent;border-radius:16px;background:#f7f5fa;font-size:27px;cursor:pointer;padding:5px 0}
.dm-emoji-choices button[aria-pressed=true]{border-color:#a68de9;background:#eee5ff}
.dm-emoji-choices button:disabled{opacity:.45;cursor:default}
.dm-action-hint{font-size:11px;color:#9b93a6;margin:10px 0 18px;text-align:center}
.dm-report-action{width:100%;min-height:46px;text-align:left;padding:10px 12px;border:1px solid #eee9ef;border-radius:12px;color:#9c5365;background:white;font-size:13px;cursor:pointer}
.dm-photo-viewer{z-index:4;background:#130c21eb;align-items:center;justify-content:center}
.dm-photo-viewer section{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:auto}
.dm-photo-viewer img{max-width:100%;max-height:85%;object-fit:contain}
.dm-photo-viewer button{position:absolute;top:max(16px,env(safe-area-inset-top));right:16px;z-index:1;width:44px;height:44px;border:1px solid #ffffff35;border-radius:50%;background:#ffffff15;color:white;font-size:30px;cursor:pointer}
@media(max-width:360px){.dm-emoji-choices{gap:2px}.dm-emoji-choices button{font-size:24px}.dm-action-sheet{padding-left:12px;padding-right:12px}}

/* Fit the conversation above the software keyboard, including in landscape. */
#dmModal .dm-form textarea{box-sizing:border-box;min-height:38px;height:38px;max-height:var(--dm-composer-max-height,120px);overflow-y:auto}
#dmModal .dm-safety-state:empty{display:none}
@media(max-width:600px), (max-width:900px) and (pointer:coarse){
  #dmModal{padding:0;top:var(--dm-top,0px);bottom:auto;height:var(--dm-height,100dvh);align-items:stretch;backdrop-filter:none}
  #dmModal .dm-sheet{width:100%;height:100%;max-height:100%;border:0;border-radius:0;box-shadow:none}
  #dmModal .dm-header{min-height:60px;padding:8px 12px;padding-top:max(8px,calc(env(safe-area-inset-top) - var(--dm-top,0px)))}
  #dmModal .dm-safety-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;padding:6px 12px}
  #dmModal .dm-safety-top{display:contents}
  #dmModal .dm-safety-top strong{display:none}
  #dmModal .dm-safety-top button{grid-area:1 / 2;align-self:start;z-index:1;min-height:36px}
  #dmModal .dm-safety-bar details{grid-area:1 / 1 / auto / -1;margin:0;min-width:0}
  #dmModal .dm-safety-bar summary{min-height:36px;padding:8px 88px 8px 0;line-height:20px;font-size:12px}
  #dmModal .dm-safety-state{grid-column:1 / -1}
  #dmModal .dm-composer{gap:6px;min-height:48px;padding:4px 6px;border-radius:24px}
  #dmModal .dm-attach,#dmModal .dm-send{width:36px;height:36px}
  #dmModal .dm-form{padding:8px 10px max(10px,env(safe-area-inset-bottom))}
  #dmModal.dm-keyboard-open .dm-header{min-height:52px;padding:4px 8px;padding-top:max(4px,calc(env(safe-area-inset-top) - var(--dm-top,0px)))}
  #dmModal.dm-keyboard-open .dm-header-avatar{width:32px;height:32px;font-size:14px}
  #dmModal.dm-keyboard-open .dm-heading strong{font-size:16px}
  #dmModal.dm-keyboard-open #dmSubtitle{display:none}
  #dmModal.dm-keyboard-open .dm-icon{width:40px;height:40px}
  #dmModal.dm-keyboard-open .dm-safety-bar{padding-top:2px;padding-bottom:2px}
  #dmModal.dm-keyboard-open .dm-form{padding:6px 10px}
  #dmModal.dm-keyboard-open .dm-messages{padding-top:4px;padding-bottom:8px}
  #dmModal.dm-keyboard-open .dm-date{margin:10px 0}
  #dmModal.dm-keyboard-open .dm-thread-intro{padding:16px 12px}
  #dmModal.dm-keyboard-open .dm-thread-intro .dm-avatar{width:40px;height:40px;font-size:18px}
  #dmModal.dm-keyboard-open .dm-thread-intro h3{margin:10px 0 4px;font-size:16px}
  #dmModal.dm-keyboard-open .dm-quick-questions{display:none}
  #dmModal.dm-keyboard-open .dm-market-context .dm-product-card{padding:6px 10px}
  #dmModal.dm-keyboard-open .dm-market-context .dm-product-card small,#dmModal.dm-keyboard-open .dm-market-context .dm-product-card em{display:none}
  #dmModal.dm-keyboard-open .dm-market-context .dm-product-card img,#dmModal.dm-keyboard-open .dm-market-context .dm-product-symbol{width:28px;height:28px;min-width:28px}
  #dmModal.dm-keyboard-open .dm-photo-draft{width:48px;height:48px}
  #dmModal.dm-keyboard-open .dm-photo-drafts:not(:empty){padding-bottom:6px;flex-wrap:nowrap}
  #dmModal.dm-keyboard-open .dm-photo-note{display:none}
}
