/* Phase 11 — scoped chat layout and incoming source filters. */
/* Only the actual chat page is viewport-locked; dashboards keep normal scrolling. */
.workspace.crm-chat-open {
  display:flex!important;
  box-sizing:border-box;
  height:100dvh!important;
  max-height:100dvh!important;
  min-height:0!important;
  overflow:hidden!important;
}
.workspace.crm-chat-open>.conversation {
  display:flex!important;
  flex-direction:column!important;
  flex:1 1 0!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  max-height:100%!important;
}
.workspace.crm-chat-open>.conversation>.conversation-head {
  flex:0 0 auto!important;
  position:relative;
  z-index:2;
}
.workspace.crm-chat-open>.conversation>.conversation-body {
  flex:1 1 0!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
}
.workspace.crm-chat-open>.conversation>.crm-v8-compose-row {
  position:relative!important;
  bottom:auto!important;
  left:auto!important;
  right:auto!important;
  flex:0 0 auto!important;
  width:100%!important;
  min-height:68px;
  box-sizing:border-box;
  z-index:15!important;
  background:#f8fbff;
  box-shadow:0 -3px 18px #1732550a;
}
/* The clickable customer name remains the full profile trigger. */
.workspace.crm-chat-open .crm-v7-profile-trigger {cursor:pointer}
/* Compact, obvious source summaries with accessible touch targets. */
.crm-v11-source-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-top:23px;
}
.crm-v11-source-card {
  display:flex;
  flex-direction:column;
  gap:8px;
  text-decoration:none;
  min-width:0;
  min-height:83px;
  padding:13px 14px;
  border:1px solid #e4ebf5;
  border-radius:15px;
  background:#f8faff;
  color:#254362;
  transition:background .15s,border-color .15s;
}
.crm-v11-source-card:hover,.crm-v11-source-card:focus-visible {background:#edf5ff;border-color:#a4c9fa}
.crm-v11-source-card.is-active {background:#eaf2ff;border-color:#7ab0ff;box-shadow:inset 0 0 0 1px #bed8ff}
.crm-v11-source-name {font-size:11px;font-weight:740;color:#6c83a2;white-space:nowrap}
.crm-v11-source-card strong {font-size:26px;line-height:1;font-weight:780;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.crm-v11-source-card.is-active strong {color:#1768df}
.crm-v11-pool .crm-v10-pool-surface {max-width:1100px}
.crm-v11-pool .crm-v10-pool-rows {min-width:0}
@media (max-width:950px) {
  .crm-v11-source-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:680px) {
  .workspace.crm-chat-open {
    height:100dvh!important;
    max-height:100dvh!important;
    min-height:0!important;
    padding-top:calc(54px + env(safe-area-inset-top,0px))!important;
  }
  .workspace.crm-chat-open>.conversation {min-height:0!important;height:100%!important}
  .workspace.crm-chat-open>.conversation>.conversation-body {scrollbar-gutter:auto;padding-bottom:15px!important}
  .workspace.crm-chat-open>.conversation>.crm-v8-compose-row {
    padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px))!important;
    min-height:58px;
  }
  .crm-v11-source-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-v11-source-card {min-height:75px;padding:12px}
  .crm-v11-source-card strong {font-size:23px}
}
@media (max-width:360px) {
  .workspace.crm-chat-open>.conversation>.crm-v8-compose-row {padding-inline:6px!important;gap:6px!important}
}
