/* Buchee 3. aşama — yalnızca Mesajlar ekranı.
   Sohbet kayıtlarına, erişim kurallarına veya mesaj işlemlerine müdahale etmez. */
html[data-pati-view="messages"] #main-content>.pati-dm-top{
 background:#fff!important;color:#191c23!important;
 box-shadow:none!important;border-bottom:1px solid #f0f1f4!important;
 box-sizing:border-box!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-title{
 display:flex!important;align-items:center!important;gap:7px!important;
 min-width:0!important;max-width:100%!important;white-space:nowrap!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-title strong{
 font-size:clamp(17px,4.7vw,20px)!important;font-weight:780!important;
 letter-spacing:-.45px!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .buchee-dm-unread-total{
 display:inline-grid;place-items:center;flex:0 0 auto;min-width:22px;height:22px;
 padding:0 6px;border-radius:999px;box-sizing:border-box;
 background:#eee5f8;color:#612e9a;font:750 11px/1 system-ui,-apple-system,sans-serif;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-inbox-back,
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-top-actions>button{
 box-sizing:border-box!important;display:inline-grid!important;place-items:center!important;
 width:44px!important;min-width:44px!important;max-width:44px!important;
 height:44px!important;min-height:44px!important;max-height:44px!important;
 flex:0 0 44px!important;border:0!important;border-radius:11px!important;
 background:transparent!important;color:#242631!important;box-shadow:none!important;
 margin:0!important;padding:9px!important;cursor:pointer;touch-action:manipulation;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-top-actions{
 display:flex!important;align-items:center!important;justify-content:flex-end!important;
 flex-wrap:nowrap!important;gap:0!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-top-actions>button svg{
 display:block;width:22px!important;height:22px!important;stroke:currentColor!important;
}
html[data-pati-view="messages"] #main-content :is(.pati-dm-inbox-back,.pati-dm-top-actions>button,.buchee-dm-bulk-toolbar button,.pati-dm-searchbar input,.chat-person,.pati-dm-row-actions>summary,.chat-window button,.chat-form input):focus-visible{
 outline:2px solid #7444ad!important;outline-offset:2px!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-searchbar{
 box-sizing:border-box!important;display:flex!important;align-items:center!important;
 width:100%!important;max-width:100%!important;margin:0!important;
 padding:8px 13px 10px!important;border:0!important;background:#fff!important;
}
html[data-pati-view="messages"] #main-content>.pati-dm-searchbar input{
 box-sizing:border-box!important;min-width:0!important;width:100%!important;
 min-height:44px!important;border-radius:13px!important;
 background:#f3f4f7!important;border:1px solid #eef0f3!important;
 color:#20222a!important;font:500 16px/1.3 system-ui,-apple-system,sans-serif!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-list .chat-people{
 width:100%!important;min-width:0!important;overflow-y:auto!important;overflow-x:hidden!important;
 background:#fff!important;
 padding:1px 5px max(80px,env(safe-area-inset-bottom,0px))!important;
 overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .pati-dm-list-row{
 box-sizing:border-box!important;min-width:0!important;width:100%!important;
 background:#fff!important;border-bottom:1px solid #f0f1f4!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-list .pati-dm-list-row{
 padding:2px 6px!important;min-height:72px!important;align-items:center!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-list .pati-dm-list-row>.chat-person{
 display:flex!important;align-items:center!important;flex:1 1 auto!important;
 min-width:0!important;width:100%!important;min-height:68px!important;
 padding:7px 4px!important;margin:0!important;border-radius:10px!important;
 background:#fff!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-person-info{
 display:flex!important;flex:1 1 auto!important;flex-direction:column!important;
 min-width:0!important;gap:4px!important;overflow:hidden!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-person-info strong{
 display:block!important;font-size:14px!important;font-weight:750!important;
 color:#1b1e26!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-person-info small{
 display:block!important;font-size:12px!important;line-height:1.4!important;
 color:#6b7280!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-person-meta{
 display:flex!important;flex-direction:column!important;align-items:flex-end!important;
 justify-content:center!important;gap:7px!important;flex:0 0 auto!important;
 min-width:0!important;max-width:60px!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-person-meta>small{
 color:#848995!important;font-size:11px!important;white-space:nowrap!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .chat-unread{
 display:inline-grid!important;place-items:center!important;
 min-width:19px!important;height:19px!important;border-radius:999px!important;
 padding:0 5px!important;background:#7548ab!important;color:#fff!important;
 font:750 11px/1 system-ui,-apple-system,sans-serif!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .pati-dm-row-actions{
 flex:0 0 40px!important;width:40px!important;min-width:40px!important;
 margin:0!important;
}
html[data-pati-view="messages"] #main-content .pati-dm-layout .pati-dm-row-actions>summary{
 box-sizing:border-box!important;display:grid!important;place-items:center!important;
 width:40px!important;height:44px!important;min-height:44px!important;
 margin:0!important;padding:8px!important;border-radius:10px!important;
 touch-action:manipulation;
}
html[data-pati-view="messages"] #main-content .buchee-dm-empty{
 display:flex;flex-direction:column;align-items:center;justify-content:center;
 gap:13px;text-align:center;color:#727987;line-height:1.5;
 font-size:13px;margin:18px auto!important;padding:25px 18px!important;
 max-width:340px;
}
html[data-pati-view="messages"] #main-content .buchee-dm-empty>button{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:44px;padding:10px 16px;border:0;border-radius:11px;
 background:#292632;color:#fff;font-weight:650;touch-action:manipulation;
}
html[data-pati-view="messages"] #main-content>.buchee-dm-bulk-toolbar{
 display:flex!important;align-items:center!important;flex-wrap:wrap!important;
 gap:8px!important;padding:9px 12px!important;
 box-sizing:border-box!important;background:#f9f8fc!important;
 border-bottom:1px solid #ece7f3!important;
}
html[data-pati-view="messages"] #main-content>.buchee-dm-bulk-toolbar>span{
 flex:1 1 120px;font-size:12px;font-weight:700;color:#292633;
}
html[data-pati-view="messages"] #main-content>.buchee-dm-bulk-toolbar>button{
 min-height:44px!important;padding:9px 11px!important;
 font-size:12px;font-weight:700;white-space:nowrap;touch-action:manipulation;
}
html[data-pati-view="messages"] #main-content>.buchee-dm-bulk-toolbar>small{
 display:block;flex:1 1 100%;font-size:11px;line-height:1.4;color:#6d6578;
}
html[data-pati-view="messages"] #main-content .buchee-dm-selecting .pati-group-thread-row{
 opacity:.55!important;pointer-events:none!important;
}
html[data-pati-view="messages"] #main-content .buchee-dm-selecting .pati-dm-list-row[data-chat-peer]{
 padding-left:43px!important;
}
html[data-pati-view="messages"] #main-content .buchee-dm-selecting .buchee-dm-checkbox{
 accent-color:#7045a6;min-height:26px;min-width:26px;
}
@media(max-width:740px){
 html[data-pati-view="messages"] #app-root:not(.hidden) #main-content:has(.pati-dm-layout.mobile-chat-list)>.pati-dm-top{
  display:grid!important;grid-template-columns:44px minmax(0,1fr) 132px!important;
  grid-template-rows:48px!important;column-gap:6px!important;row-gap:0!important;
  align-items:center!important;min-width:0!important;min-height:62px!important;
  padding:7px 9px!important;margin:0!important;overflow:visible!important;
 }
 html[data-pati-view="messages"] #main-content>.pati-dm-top>.pati-dm-inbox-back{
  grid-column:1!important;grid-row:1!important;
 }
 html[data-pati-view="messages"] #main-content>.pati-dm-top>.pati-dm-title{
  grid-column:2!important;grid-row:1!important;justify-self:start!important;
 }
 html[data-pati-view="messages"] #main-content>.pati-dm-top>.pati-dm-top-actions{
  grid-column:3!important;grid-row:1!important;
  box-sizing:border-box!important;width:132px!important;max-width:132px!important;
  min-width:132px!important;padding:0!important;margin:0!important;
 }
 html[data-pati-view="messages"] #main-content>.pati-dm-top>.pati-dm-top-actions>button{
  width:44px!important;min-width:44px!important;max-width:44px!important;flex:0 0 44px!important;
 }
 html[data-pati-view="messages"] #main-content:has(.pati-dm-layout.mobile-chat-open)>.pati-dm-top,
 html[data-pati-view="messages"] #main-content:has(.pati-dm-layout.mobile-chat-open)>.pati-dm-searchbar{
  display:none!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open{
  min-height:0!important;max-height:100%!important;overflow:hidden!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-window{
  display:flex!important;flex-direction:column!important;
  min-width:0!important;min-height:0!important;overflow:hidden!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-window>header{
  flex:0 0 auto!important;min-height:56px!important;
  padding:7px 10px!important;gap:8px!important;
  background:#fff!important;border-bottom:1px solid #edf0f3!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .mobile-chat-back{
  display:grid!important;place-items:center!important;
  flex:0 0 44px!important;min-width:44px!important;min-height:44px!important;
  border-radius:10px!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-history{
  flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;
  overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-form{
  box-sizing:border-box!important;position:relative!important;bottom:auto!important;
  display:flex!important;align-items:center!important;min-width:0!important;width:100%!important;
  flex:0 0 auto!important;gap:5px!important;
  padding:7px 8px max(8px,env(safe-area-inset-bottom,0px))!important;
  border-top:1px solid #eceef2!important;background:#fff!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-form input[name="body"]{
  flex:1 1 auto!important;min-width:0!important;width:1px!important;
  font-size:16px!important;min-height:44px!important;
 }
 html[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-form :is(.primary-btn,.pati-dm-mic,.pati-dm-attach>summary){
  flex:0 0 42px!important;min-width:42px!important;
  width:42px!important;height:44px!important;min-height:44px!important;
 }
 html.pati-keyboard-open[data-pati-view="messages"] #main-content .pati-dm-layout.mobile-chat-open .chat-form{
  padding-bottom:7px!important;
 }
}
@media(max-width:360px){
 html[data-pati-view="messages"] #app-root:not(.hidden) #main-content:has(.pati-dm-layout.mobile-chat-list)>.pati-dm-top{
  grid-template-columns:40px minmax(0,1fr) 132px!important;column-gap:4px!important;padding:6px 7px!important;
 }
 html[data-pati-view="messages"] #main-content>.pati-dm-top .pati-dm-title strong{font-size:17px!important}
 html[data-pati-view="messages"] #main-content>.pati-dm-top .buchee-dm-unread-total{min-width:19px;height:19px;padding:0 4px;font-size:10px}
}

/* 2026-11-04: Inbox selection geometry — never overlap avatars or story rings. */
@media (max-width:740px){
  /* Keep the destructive action bar compact and readable on narrow iPhones. */
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting>.buchee-dm-bulk-toolbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    align-items:center!important;
    justify-content:stretch!important;
    box-sizing:border-box!important;
    min-height:58px!important;
    width:100%!important;
    margin:0!important;
    padding:7px 12px!important;
    gap:7px!important;
    flex-wrap:nowrap!important;
    background:#f8f6fa!important;
    border-bottom:1px solid #eeeaf2!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting>.buchee-dm-bulk-toolbar>span{
    display:block!important;min-width:0!important;flex:none!important;
    color:#302b38!important;font-size:13px!important;
    line-height:1.25!important;font-weight:750!important;
    white-space:nowrap!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting>.buchee-dm-bulk-toolbar>button{
    box-sizing:border-box!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    min-height:42px!important;height:42px!important;
    width:auto!important;min-width:0!important;max-width:none!important;
    margin:0!important;padding:7px 10px!important;
    border-radius:11px!important;
    border:1px solid #e6e2ea!important;
    background:#fff!important;color:#28242f!important;
    box-shadow:none!important;
    font-size:12px!important;font-weight:750!important;
    white-space:nowrap!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting>.buchee-dm-bulk-toolbar>button.buchee-dm-remove{
    background:#b82445!important;color:#fff!important;border-color:#b82445!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting>.buchee-dm-bulk-toolbar>button.buchee-dm-remove:disabled{
    background:#eadfe5!important;color:#977b88!important;border-color:#eadfe5!important;
    opacity:1!important;
  }

  /* A dedicated left gutter contains the checkbox. No overlay on either
     an ordinary avatar or the absolutely positioned story-ring avatar. */
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]{
    position:relative!important;
    display:flex!important;align-items:center!important;
    box-sizing:border-box!important;
    min-height:76px!important;width:100%!important;
    padding:3px 6px 3px 51px!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.buchee-dm-checkbox{
    -webkit-appearance:none!important;appearance:none!important;
    display:block!important;position:absolute!important;
    left:11px!important;top:50%!important;right:auto!important;bottom:auto!important;
    transform:translateY(-50%)!important;
    box-sizing:border-box!important;
    width:26px!important;height:26px!important;
    min-width:26px!important;min-height:26px!important;
    margin:0!important;padding:0!important;
    border:2px solid #b5b2be!important;border-radius:8px!important;
    background:#fff!important;color:#fff!important;
    box-shadow:0 1px 2px rgba(26,20,38,.05)!important;
    cursor:pointer!important;z-index:7!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.buchee-dm-checkbox:checked{
    border-color:#6c399c!important;
    background:#6c399c!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.buchee-dm-checkbox:checked::after{
    content:""!important;display:block!important;
    position:absolute!important;
    width:6px!important;height:12px!important;
    left:8px!important;top:3px!important;
    border:solid #fff!important;border-width:0 2px 2px 0!important;
    transform:rotate(45deg)!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.buchee-dm-checkbox:focus-visible{
    outline:3px solid #b491d7!important;outline-offset:3px!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.chat-person{
    flex:1 1 auto!important;min-width:0!important;
    width:auto!important;max-width:100%!important;
    padding:7px 4px!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer][data-has-story="true"]>.pati-dm-story-trigger{
    left:57px!important;
    z-index:4!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer][data-has-story="true"]>.chat-person{
    padding-left:64px!important;
  }
  /* Hide the per-row three-dot menu while selection mode owns row taps. */
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row[data-chat-peer]>.pati-dm-row-actions{
    display:none!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row.buchee-dm-row-picked{
    background:#f7f3fc!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-dm-list-row.buchee-dm-row-picked>.chat-person{
    background:#f7f3fc!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-top-actions>.buchee-dm-bulk-trigger{
    background:#f2eaf8!important;color:#693c92!important;
  }
  html[data-pati-view="messages"] #main-content.buchee-dm-selecting .pati-dm-layout.mobile-chat-list .pati-group-thread-row{
    opacity:.55!important;
    pointer-events:none!important;
  }
}
