/* Mobile master-detail for dialogs / clients (phones). */

.mobile-list-bar { display: none; }
.mobile-list-head { display: none; }

@media (max-width: 760px) {
  .mobile-list-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid #eaecf0;
    background: #ffffff;
    color: #2D7FF9;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    box-sizing: border-box;
    cursor: pointer;
  }

  .conversation-page,
  .clients-page {
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
  }

  .chat-header,
  .profile-header {
    min-height: 60px;
    padding: 8px 12px;
  }

  .messages { padding: 12px; }

  .message-wrap { max-width: 88%; }

  .message-bubble {
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.45;
  }

  body.mobile-list-open { overflow: hidden; }

  body.mobile-list-open .conversation-sidebar,
  body.mobile-list-open .clients-list-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border: 0;
    border-radius: 0;
    background: #ffffff;
  }

  body.mobile-list-open .mobile-list-head {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid #eaecf0;
    background: #ffffff;
  }

  .mobile-list-head strong {
    font-size: 17px;
    color: #101828;
  }

  .mobile-list-close {
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: #2D7FF9;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
}

/* Dialogs: collapsed AI Auditor context on phones. */
@media (max-width: 760px) {
  .auditor-context { padding: 8px 12px; }

  .auditor-context-title {
    margin: 0;
    cursor: pointer;
  }

  .auditor-context-title strong {
    font-size: 12px;
    line-height: 1.3;
  }

  .auditor-context-title::after {
    content: "\25BE";
    color: #c94b3d;
    font-size: 14px;
  }

  .auditor-context.mobile-collapsed .auditor-case-mini { display: none; }

  .auditor-context:not(.mobile-collapsed) .auditor-context-title::after {
    content: "\25B4";
  }
}

/* Dialogs: client conversation tabs as one scrollable row on phones. */
@media (max-width: 760px) {
  .topic-bar {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 18px;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topic-bar::-webkit-scrollbar { display: none; }

  .topic-bar-label { display: none; }

  .topic-tab {
    flex: 0 0 auto;
    padding: 8px 2px;
    white-space: nowrap;
  }

  .topic-tab-date,
  .topic-tab-meta { font-size: 13px; }
}
