/* css/master-chat-v2.css — premium чат мастера; только #panel-chats #sec-chat (master-dashboard-v2.html). */
/* ═══ MASTER #panel-chats #sec-chat — premium workspace (chat-v2) ═══ */

#panel-chats #sec-chat .chat-workspace.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
}

/* Premium hero — спокойная компактная карточка «Мои чаты» */
#panel-chats #sec-chat .chat-m-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 18px 14px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: #fff;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}

#panel-chats #sec-chat .chat-m-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

#panel-chats #sec-chat .chat-m-hero-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(148, 163, 184, 0.08));
  color: #64748b;
  font-size: 18px;
}

#panel-chats #sec-chat .chat-m-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

#panel-chats #sec-chat .chat-m-title {
  margin: 0 0 4px;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.2;
}

#panel-chats #sec-chat .chat-m-hero-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
}

#panel-chats #sec-chat .chat-m-hero-row2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-top: 2px;
}

#panel-chats #sec-chat .chat-m-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

#panel-chats #sec-chat .chat-m-user-pill i {
  font-size: 14px;
  color: #94a3b8;
}

#panel-chats #sec-chat .chat-m-unread {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 220px);
  box-sizing: border-box;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #5b6470;
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-chats #sec-chat #chatHeroStat.chat-m-hero-meta {
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(241, 245, 249, 0.98);
  display: block;
  text-align: left;
}

#panel-chats #sec-chat .chat-m-hero-meta-text {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

#panel-chats #sec-chat #chatHeroCount {
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* Toolbar spacing */
#panel-chats #sec-chat .chat-m-toolbar {
  margin-bottom: 16px;
}

/* Premium tabs */
#panel-chats #sec-chat .chat-tabs-premium .chat-tab-btn {
  gap: 8px;
}

/* Split layout sizing parity with aggregator */
@media (min-width: 769px) {
  #panel-chats #sec-chat #chatSplit.chat-split {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    min-height: min(640px, 74vh);
    max-height: 78vh;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    overflow: hidden;
    background: var(--card, #fff);
  }

  #panel-chats #sec-chat .chat-split-sidebar {
    width: auto !important;
    min-width: 0;
    max-height: none;
    border-right: 1px solid var(--border, #e5e7eb);
    background: var(--bg, #f8fafc);
  }

  #panel-chats #sec-chat .chat-split-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: var(--card, #fff);
  }
}

/* Имя + статус в одной строке; кнопка звонка */
#panel-chats #sec-chat .chat-conv-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#panel-chats #sec-chat .chat-conv-name-row .chat-conv-name {
  flex: 1 1 auto;
  min-width: 0;
}

#panel-chats #sec-chat .chat-conv-call-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(22, 163, 74, 0.35);
  border: 1px solid rgba(21, 128, 61, 0.35);
  box-sizing: border-box;
}

#panel-chats #sec-chat .chat-conv-call-btn[aria-hidden="true"] {
  display: none !important;
}

#panel-chats #sec-chat .chat-qa-chip--call {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

/* Conversation */
#panel-chats #sec-chat #chatMessages.chat-messages,
#panel-chats #sec-chat #supportMessages.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
}

/* Sticky composer: только при открытом заказном треде (этап 1 — не «протекать» в empty state) */
body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-input-row.chat-composer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border, #e5e7eb);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), var(--card, #fff));
}

body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-input-row.chat-composer input {
  min-height: 44px;
}

body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-input-row.chat-composer .chat-send-btn {
  min-width: 48px;
  min-height: 44px;
}

/* Empty state polish */
#panel-chats #sec-chat #chatEmptyState.chat-empty-state {
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}

/* Small-screen tweaks */
@media (max-width: 768px) {
  /* Перебиваем mobile-profi-style (.chat-m-hero flex row + агрессивный unread) */
  #panel-chats #sec-chat .chat-m-hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 14px 14px 12px !important;
    border-radius: 16px !important;
    margin-bottom: 12px !important;
  }

  #panel-chats #sec-chat .chat-m-hero-top {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  #panel-chats #sec-chat .chat-m-hero-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 13px !important;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(148, 163, 184, 0.08)) !important;
    color: #64748b !important;
    font-size: 17px !important;
    box-shadow: none !important;
  }

  #panel-chats #sec-chat .chat-m-title {
    display: block !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    gap: 0 !important;
  }

  #panel-chats #sec-chat .chat-m-unread {
    background: rgba(241, 245, 249, 0.98) !important;
    color: #5b6470 !important;
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 4px 9px !important;
  }

  #panel-chats #sec-chat .chat-m-hero-row2 {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  #panel-chats #sec-chat #chatHeroStat.chat-m-hero-meta {
    padding-top: 6px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile «режим переписки» (master-dashboard-v2): не ломаем mobile-profi-style
   (.chat-split.conv-open .chat-split-main { position:fixed; inset:0 }) — без своих height.
   ═══════════════════════════════════════════════════════════════════════════ */

body.master-suite-v2 #panel-chats #sec-chat .chat-msg {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: min(72%, calc(100vw - 48px));
  box-sizing: border-box;
}

body.master-suite-v2 #panel-chats .master-chat-root {
  min-height: 0;
}

@media (max-width: 767.98px) {
  body.master-suite-v2 #panel-chats .master-chat-root {
    min-height: auto;
  }

  /* Нижняя навигация: все варианты (master не использует .mobile-bottom-nav) */
  body.master-suite-v2.chat-conv-open .master-bottom-nav,
  body.master-suite-v2.chat-conv-open #masterBottomNav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.master-suite-v2.chat-conv-open.profi-mobile-ready .app-main {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Toast «Тех. работы» (main.js #maint-badge): не перекрывает composer в чате */
  body.master-suite-v2.chat-conv-open #maint-badge {
    bottom: auto !important;
    top: max(12px, env(safe-area-inset-top, 0px)) !important;
    right: 10px !important;
    left: auto !important;
    z-index: 260 !important;
    max-width: min(200px, calc(100vw - 24px));
  }

  /* Premium карточка шапки: sticky-блок над лентой сообщений */
  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-premium-card.chat-conv-premium-card {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 8px 10px 6px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.95);
    overflow: hidden;
    flex-shrink: 0;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-header.chat-conv-header--premium {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    padding: 10px 10px 8px !important;
    gap: 8px !important;
    min-height: 0 !important;
    border-bottom: 1px solid rgba(241, 245, 249, 0.95);
    background: transparent !important;
    box-shadow: none !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-header .chat-conv-head-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-premium-meta.chat-conv-premium-meta {
    margin-left: 8px !important;
    margin-right: 8px !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-sub {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.35 !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #chat-conv-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Предупреждение над composer — одна компактная строка */
  body.master-suite-v2.chat-conv-open #panel-chats #chat-conversation .chat-conv-disclaimer {
    padding: 4px 10px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
  }

  /* Только при открытом диалоге: иначе !important перебивает inline display:none у #chat-conversation */
  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat #chat-conversation {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat #chatMessages.chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-input-row.chat-composer {
    position: relative !important;
    bottom: auto !important;
    flex-shrink: 0 !important;
    z-index: 4;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }

  body.master-suite-v2 #panel-chats #support-conversation.support-conv-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.master-suite-v2 #panel-chats #supportMessages.chat-messages {
    flex: 1 1 auto !important;
    min-height: 120px !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
}

/* Desktop: колонка переписки заполняет сетку без «пустоты», скролл только в сообщениях */
@media (min-width: 769px) {
  body.master-suite-v2 #panel-chats #sec-chat #chatSplit.chat-split {
    min-height: min(560px, 72vh);
    max-height: min(720px, 78vh);
  }

  body.master-suite-v2 #panel-chats #sec-chat .chat-split-main {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat #chat-conversation {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat #chatMessages.chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  /* Десктоп: дублирующая строка быстрых кнопок скрыта; «⋯» раскрывает панель как раньше по смыслу */
  body.master-suite-v2 #panel-chats #chat-conv-quick-actions {
    display: none !important;
  }

  body.master-suite-v2 #panel-chats #chat-conv-header.chat-conv-header--premium .chat-head-actions-more > summary {
    display: none;
  }

  body.master-suite-v2 #panel-chats #chat-conv-header.chat-conv-header--premium .chat-head-actions-more .chat-head-actions-more__panel {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}

/* ═══ Premium meta + «⋯» + быстрые кнопки (mobile; десктоп — см. блок выше) ═══ */
#panel-chats #sec-chat #chat-conv-premium-meta.chat-conv-premium-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px 10px;
  margin: 0 10px 8px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

#panel-chats #sec-chat #chat-conv-premium-meta[hidden] {
  display: none !important;
}

#panel-chats #sec-chat .chat-conv-premium-meta__cell {
  min-width: 0;
  text-align: center;
}

#panel-chats #sec-chat .chat-conv-premium-meta__lbl {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
  margin-bottom: 2px;
}

#panel-chats #sec-chat .chat-conv-premium-meta__val {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-chats #sec-chat .chat-conv-quick-actions {
  display: none;
  gap: 8px;
  padding: 0 10px 10px;
  box-sizing: border-box;
}

#panel-chats #sec-chat .chat-qa-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 15px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text, #0f172a);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
  min-width: 0;
}

#panel-chats #sec-chat .chat-qa-chip i {
  font-size: 14px;
  opacity: 0.9;
}

#panel-chats #sec-chat .chat-qa-chip--primary {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.1));
  color: #4f46e5;
}

#panel-chats #sec-chat .chat-qa-chip--ghost {
  background: rgba(248, 250, 252, 0.95);
  color: var(--muted, #64748b);
}

#panel-chats #sec-chat .chat-qa-chip--danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

#panel-chats #sec-chat .chat-head-actions-more {
  position: relative;
  flex-shrink: 0;
}

#panel-chats #sec-chat .chat-head-actions-more__summary {
  list-style: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

#panel-chats #sec-chat .chat-head-actions-more__summary::-webkit-details-marker {
  display: none;
}

#panel-chats #sec-chat .chat-head-actions-more__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  min-width: 168px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.14);
}

#panel-chats #sec-chat .chat-head-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.9);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text, #0f172a);
}

#panel-chats #sec-chat .chat-head-chip--primary {
  border-color: rgba(99, 102, 241, 0.35);
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
}

#panel-chats #sec-chat .chat-head-chip--ghost {
  color: var(--muted, #64748b);
}

@media (max-width: 767.98px) {
  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-conv-quick-actions--master {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px !important;
    padding: 0 8px 10px !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-conv-quick-actions--master .chat-qa-chip {
    flex-direction: column !important;
    gap: 4px !important;
    min-height: 56px !important;
    padding: 8px 4px !important;
    font-size: 10px !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat .chat-conv-quick-actions--master .chat-qa-chip i {
    font-size: 15px !important;
  }
}

/* Курилка: скрыть заказный #chat-conversation (иначе CSS с display:flex !important перебивает inline display:none) */
body.master-suite-v2.global-chat-open #panel-chats #sec-chat #chat-conversation,
body.master-suite-v2.global-chat-open #panel-chats #chat-conversation {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  flex: 0 0 0 !important;
  pointer-events: none !important;
}

/* Курилка (#gcConversation) — flex-колонка в .chat-split-main */
#gcConversation.gc-conv-root {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  position: relative;
  background: var(--card, #fff);
}

#gcConversation .gc-conv-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 3px 16px rgba(15, 23, 42, 0.06);
}

#gcConversation #gcMessages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

#gcConversation #gcInputRow {
  flex-shrink: 0;
}

/* Этап 1: заказный тред скрыт, пока нет body.chat-conv-open (согласовано с агрегатором). */
body.master-suite-v2:not(.chat-conv-open) #panel-chats #sec-chat #chat-conversation {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat V3 — этап 2.2 (заметный premium workspace; только scoped, без JS)
   Scope: body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface
   ═══════════════════════════════════════════════════════════════════════════ */

body.master-suite-v2 #panel-chats #masterChatRoot.master-chat-root {
  background: linear-gradient(165deg, #eef2ff 0%, #f8fafc 42%, #e8edf5 100%);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface {
  box-sizing: border-box;
  margin: 0;
  padding: 18px 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(199, 210, 254, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 55%, #eef2ff 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 22px 48px rgba(79, 70, 229, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-m-hero {
  margin-bottom: 8px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(238, 242, 255, 0.55) 48%,
    rgba(248, 250, 252, 0.98) 100%
  );
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-m-toolbar {
  margin-bottom: 0;
  padding: 14px 14px 12px;
  border-radius: 16px 16px 0 0;
  border: 1px solid rgba(226, 232, 240, 0.98);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.92) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-tabs.chat-tabs-premium {
  margin-top: 4px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-tab-orders {
  margin-top: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-tab-orders .chat-split#chatSplit {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-tab-news,
body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-tab-support {
  margin-top: 0;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-top: none;
  background: var(--card, #fff);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-split#chatSplit {
  border-radius: 0 0 18px 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.07);
  background: var(--card, #fff);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-sidebar-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.55) 100%);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-order-list.chat-order-list {
  padding: 12px 12px 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.35) 0%, rgba(255, 255, 255, 0.2) 100%);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item {
  margin-bottom: 10px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.98);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.active {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow:
    inset 4px 0 0 0 #6366f1,
    0 0 0 1px rgba(99, 102, 241, 0.12),
    0 8px 26px rgba(99, 102, 241, 0.14);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.22) 0%,
    rgba(255, 255, 255, 0.88) 42%,
    rgba(240, 253, 244, 0.95) 100%
  );
  border-color: rgba(22, 163, 74, 0.85);
  box-shadow:
    inset 6px 0 0 0 rgba(21, 128, 61, 0.95),
    0 3px 18px rgba(34, 197, 94, 0.22),
    0 0 0 1px rgba(22, 163, 74, 0.28);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread:hover {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.28) 0%,
    rgba(255, 255, 255, 0.9) 40%,
    rgba(220, 252, 231, 0.98) 100%
  );
  border-color: rgba(21, 128, 61, 0.92);
  box-shadow:
    inset 6px 0 0 0 rgba(21, 128, 61, 1),
    0 6px 26px rgba(34, 197, 94, 0.28),
    0 0 0 1px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-av-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes vp-master-chat-unread-dot-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.98),
      0 2px 10px rgba(22, 163, 74, 0.5);
  }
  50% {
    opacity: 0.9;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.98),
      0 2px 14px rgba(22, 163, 74, 0.62);
  }
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread .chat-order-unread-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 2px 10px rgba(22, 163, 74, 0.55);
  z-index: 2;
  pointer-events: none;
  animation: vp-master-chat-unread-dot-pulse 2.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread .chat-order-unread-dot {
    animation: none;
  }
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread .chat-order-last-at {
  color: #15803d !important;
  font-weight: 800;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread .chat-order-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(145deg, #16a34a 0%, #15803d 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 2px 10px rgba(22, 163, 74, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-split-main#chatMain {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.75) 0%, rgba(255, 255, 255, 0.95) 45%, #f8fafc 100%);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chatMain .chat-empty-state,
body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-state {
  box-sizing: border-box;
  width: min(100% - 28px, 26rem);
  max-width: 26rem;
  min-width: min(100%, 320px);
  margin: auto;
  min-height: min(52vh, 460px);
  padding: 40px 32px;
  gap: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #eef2ff 100%);
  box-shadow:
    0 14px 40px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.14) 0%, rgba(129, 140, 248, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #4f46e5;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-sub {
  max-width: 22rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #64748b;
}

@media (min-width: 769px) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chatSplit.chat-split {
    grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
    min-height: min(600px, 74vh);
    max-height: min(780px, 80vh);
  }
}

@media (max-width: 768px) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface {
    padding: 12px 10px 14px !important;
    border-radius: 18px !important;
    border-color: rgba(199, 210, 254, 0.45) !important;
    box-shadow:
      0 10px 28px rgba(15, 23, 42, 0.07),
      0 0 0 1px rgba(255, 255, 255, 0.65) inset !important;
  }

  body.master-suite-v2.chat-conv-open #panel-chats #sec-chat.chat-v3-surface {
    padding: 8px 6px 10px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-m-toolbar {
    border-radius: 14px 14px 0 0 !important;
    padding: 12px 10px 10px !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item {
    margin-bottom: 10px !important;
    padding: 14px 12px 14px 14px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.98) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.active {
    box-shadow:
      inset 4px 0 0 0 #6366f1,
      0 4px 14px rgba(99, 102, 241, 0.12) !important;
  }

  /* mobile-profi-style.css loads after this file and sets .chat-order-unread-badge with !important;
     keep unread pill green only inside unread rows (does not affect neutral badges). */
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-order-item.chat-unread .chat-order-unread-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 22px !important;
    padding: 3px 8px !important;
    height: auto !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.2 !important;
    color: #fff !important;
    background: linear-gradient(145deg, #16a34a 0%, #15803d 100%) !important;
    border: 1px solid rgba(34, 197, 94, 0.55) !important;
    box-shadow:
      0 2px 10px rgba(22, 163, 74, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chatMain .chat-empty-state,
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-state {
    width: min(100% - 20px, 26rem) !important;
    max-width: none !important;
    min-width: min(100%, 280px) !important;
    min-height: min(46vh, 380px) !important;
    padding: 32px 20px !important;
    margin: 12px auto !important;
    border-radius: 18px !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07) !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-icon {
    width: 88px !important;
    height: 88px !important;
    font-size: 32px !important;
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-title {
    font-size: 1.15rem !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat V3 polish — Phase 1 (CSS-only). Scoped to #sec-chat.chat-v3-surface.
   ═══════════════════════════════════════════════════════════════════════════ */

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chatMessages.chat-messages {
  gap: 10px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg {
  padding: 11px 15px 10px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 14px;
  border: 1px solid transparent;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.055);
  transition: box-shadow 0.18s ease, transform 0.14s ease, border-color 0.18s ease;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.incoming {
  align-self: flex-start;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text, #0f172a);
  border-color: rgba(226, 232, 240, 0.92);
  border-bottom-left-radius: 6px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.outgoing {
  align-self: flex-end;
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 48%, #6d28d9 100%);
  color: #fff;
  border-color: rgba(79, 70, 229, 0.38);
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.2);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.incoming .chat-msg-time {
  color: var(--muted, #64748b);
  opacity: 0.9;
  font-weight: 600;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.outgoing .chat-msg-time {
  color: rgba(255, 255, 255, 0.88);
  opacity: 1;
  font-weight: 600;
}

@media (hover: hover) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.incoming:hover {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.075);
  }

  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.outgoing:hover {
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.26);
  }
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg:active {
  transform: scale(0.992);
}

@media (min-width: 769px) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg {
    max-width: min(560px, 76%);
  }
}

@media (max-width: 768px) {
  body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg {
    max-width: min(86%, calc(100% - 22px));
    padding: 10px 13px 9px;
  }
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-input-row.chat-composer input {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.98);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-input-row.chat-composer input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-input-row.chat-composer .chat-send-btn {
  border-radius: 14px;
  border: 1px solid rgba(67, 56, 202, 0.45);
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.32);
  transition: box-shadow 0.18s ease, transform 0.12s ease, filter 0.15s ease;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-input-row.chat-composer .chat-send-btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.36);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-input-row.chat-composer .chat-send-btn:active {
  transform: scale(0.97);
  filter: brightness(0.97);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-conv-quick-actions {
  gap: 10px;
}

#panel-chats #sec-chat .chat-qa-chip {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background 0.16s ease;
}

@media (hover: hover) {
  #panel-chats #sec-chat .chat-qa-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
  }
}

#panel-chats #sec-chat .chat-qa-chip:active {
  transform: translateY(0) scale(0.98);
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-icon {
  line-height: 1;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-title {
  text-wrap: balance;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-empty-sub {
  text-wrap: balance;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat V3 — Phase 2 (classed templates). Scoped to #sec-chat.chat-v3-surface.
   ═══════════════════════════════════════════════════════════════════════════ */

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-date-sep {
  text-align: center;
  margin: 14px 0 8px;
  flex-shrink: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-date-sep__pill {
  display: inline-block;
  background: var(--bg-alt, #f1f5f9);
  color: var(--muted, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  word-break: break-word;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg-system.chat-msg-system--order-info {
  margin: 12px auto;
  max-width: min(340px, calc(100% - 16px));
  box-sizing: border-box;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1.5px solid #a5b4fc;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  flex-shrink: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg-system__title {
  font-size: 10px;
  font-weight: 800;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg-system__line {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg-system--order-info > .chat-msg-system__line:last-of-type {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 6px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty {
  padding: 20px 16px 8px;
  box-sizing: border-box;
  max-width: 100%;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card {
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  border: 1.5px solid #c7d2fe;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card > .chat-thread-empty__sub:first-of-type {
  font-size: 11px;
  font-weight: 700;
  color: #6366f1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__icon {
  margin-right: 6px;
  opacity: 0.95;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.35;
  word-break: break-word;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card > .chat-thread-empty__sub:not(:first-of-type):not(:last-of-type) {
  font-size: 12px;
  color: #475569;
  margin-bottom: 3px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card > .chat-thread-empty__sub:not(:first-of-type) .fa-map-marker-alt {
  color: #6366f1;
  margin-right: 4px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card > .chat-thread-empty__sub:not(:first-of-type) .fa-circle {
  color: #10b981;
  font-size: 7px;
  vertical-align: middle;
  margin-right: 5px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty__card > .chat-thread-empty__sub:last-of-type {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty > .chat-thread-empty__sub:last-child {
  color: var(--muted, #64748b);
  text-align: center;
  font-size: 13px;
  padding: 8px 0 16px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-thread-empty > .chat-thread-empty__sub:last-child .fa-lock-open {
  margin-right: 5px;
  opacity: 0.4;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg-sender {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary, #6366f1);
  margin-bottom: 2px;
  line-height: 1.25;
  word-break: break-word;
}

/* Chat V3 — Phase 2b: stacked message groups (same sender / day / side). */
body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chatMessages.chat-messages .chat-msg.chat-msg--continued {
  margin-top: -6px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface .chat-msg.chat-msg--continued .chat-msg-sender {
  display: none;
}

/* Master dialog header: typography/layout moved from inline (IDs unchanged). */
body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-conv-av#chat-conv-avatar {
  flex-shrink: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-conv-head-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation #chat-conv-name.chat-conv-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation #chat-conv-sub.chat-conv-sub {
  font-size: 11px;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-conv-status-slot#chat-conv-status-pill {
  flex-shrink: 0;
}

body.master-suite-v2 #panel-chats #sec-chat.chat-v3-surface #chat-conversation .chat-conv-presence#chat-conv-presence {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
