/* XSIZE CRM V19 — fullscreen deal card + compact omnichannel composer.
   UI ONLY. Telegram/WhatsApp/MAX transports are not changed here. */
#dealModal.modal{
  padding:0!important;
  place-items:stretch!important;
}
#dealModal .full-deal-card{
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:100vh!important;
  border-radius:0!important;
}
#dealModal .deal-card-header{padding:9px 14px!important}
#dealModal .deal-workspace{
  grid-template-columns:minmax(410px,31%) minmax(0,1fr)!important;
}
#dealModal .deal-details-pane{min-width:0!important}
#dealModal .activity-pane{min-width:0!important}

/* amoCRM-like compact identity chips in the card header. */
.deal-header-route-v19{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:5px;
}
.deal-header-route-v19 .route-chip-v19{
  display:inline-flex;align-items:center;min-height:22px;padding:3px 8px;
  border:1px solid #dfe5ee;border-radius:6px;background:#f8fafc;
  color:#475569;font-size:10px;font-weight:800;line-height:1;
}
.deal-header-route-v19 .route-chip-v19.deal-no{color:#64748b;background:#fff}
.deal-header-route-v19 .route-chip-v19.source{color:#334155;background:#f1f5f9}
.deal-header-route-v19 .route-chip-v19.workspace{color:#4338ca;background:#eef2ff;border-color:#c7d2fe}

/* Make the client phone/email row flatter so the left pane spends less height. */
#dealTabMain .client-contact-inline-v19{
  grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr)!important;
  gap:8px!important;
}
#dealTabMain .client-contact-inline-v19 label{margin-bottom:8px!important}
#dealTabMain .client-contact-inline-v19 input{height:35px!important;padding:7px 9px!important}
#dealTabMain .client-contact-inline-v19 .copy-field button{height:35px!important;margin-top:5px!important}

/* Channel chips live on the same row as Quick Reply. The old channel select stays
   in DOM as an internal state holder but is intentionally invisible to the operator. */
#dealCommunications .deal-send-toolbar-v5{display:none!important}
#dealCommunications .quick-message-tools.deal-tools-v19{
  display:flex!important;align-items:center!important;gap:6px!important;
  flex-wrap:nowrap!important;margin:0!important;padding:6px 10px!important;
  background:#fff!important;border-top:1px solid #eef2f7!important;
  overflow-x:auto!important;scrollbar-width:thin;
}
#dealCommunications .quick-message-tools.deal-tools-v19 .deal-quick-channels{
  display:flex!important;align-items:center!important;gap:5px!important;
  flex:0 0 auto!important;margin:0 2px 0 0!important;width:auto!important;
}
#dealCommunications .quick-message-tools.deal-tools-v19 #dealQuickTemplate{
  min-width:170px!important;max-width:260px!important;height:32px!important;
  margin:0!important;padding:4px 8px!important;font-size:10px!important;
}
#dealCommunications .quick-message-tools.deal-tools-v19 .btn{
  height:32px!important;min-height:32px!important;margin:0!important;white-space:nowrap!important;
}
#dealCommunications .deal-channel-quick{
  min-height:28px!important;padding:4px 8px!important;font-size:9px!important;
}

/* More room for conversation, smaller composer. */
#dealCommunications.deal-communications-compact .deal-comms-items{
  height:clamp(310px,49vh,560px)!important;min-height:250px!important;
}
#dealCommunications .compact-compose{
  grid-template-columns:34px minmax(0,1fr) 94px!important;
  gap:7px!important;padding:5px 10px 7px!important;align-items:center!important;
  position:relative!important;
}
#dealCommunications .compact-compose textarea{
  height:36px!important;min-height:36px!important;max-height:74px!important;
  padding:8px 38px 8px 10px!important;margin:0!important;resize:vertical!important;
}
#dealCommunications .compact-compose .deal-attach-compact{
  width:34px!important;height:36px!important;min-height:36px!important;
}
#dealCommunications .compact-compose .btn.success{
  width:94px!important;height:36px!important;min-height:36px!important;padding:0 9px!important;
}
/* emoji_picker.js appends the emoji button to .compact-compose; keep it INSIDE
   the text area zone, immediately before Send, never over the Send button. */
#dealCommunications .compact-compose.emoji-field-wrap>.emoji-open-btn{
  right:111px!important;bottom:10px!important;top:auto!important;
  width:27px!important;height:27px!important;padding:0!important;
  display:grid!important;place-items:center!important;box-shadow:none!important;
  border:1px solid #e2e8f0!important;background:#fff!important;
}

/* Comment section should not steal chat space until needed. */
#dealModal .activity-comment-box{padding:7px 10px 9px!important}
#dealModal .activity-comment-box textarea{min-height:52px!important;max-height:90px!important}

@media(max-width:1200px){
  #dealModal .deal-workspace{grid-template-columns:minmax(390px,36%) minmax(0,1fr)!important}
  #dealCommunications.deal-communications-compact .deal-comms-items{height:clamp(280px,43vh,470px)!important}
}
@media(max-width:900px){
  #dealModal .full-deal-card{width:100vw!important;height:100vh!important}
  #dealModal .deal-workspace{grid-template-columns:1fr!important}
  #dealCommunications .quick-message-tools.deal-tools-v19{flex-wrap:wrap!important}
  #dealCommunications .quick-message-tools.deal-tools-v19 .deal-quick-channels{width:100%!important}
}
