/* A customer reply moves the same lead into the conversation lane. */
.lead-story .story-crm-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "card";
  align-items: stretch;
}
.lead-story .story-crm-target > .story-crm-card,
.lead-story .story-crm-target > .story-crm-board { grid-area: card; min-width: 0; }
.lead-story .story-crm-target[data-story-detail-hidden="true"] > .story-crm-card,
.lead-story .story-crm-card[data-story-detail-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}
.lead-story .story-crm-board {
  position: relative;
  z-index: 1;
  background: var(--story-module, #dfcff3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}
.lead-story .story-crm-board[hidden] {
  display: grid !important;
  visibility: hidden;
  pointer-events: none;
}
.lead-story .story-board-lane {
  min-width: 0;
  min-height: 250px;
  padding: 14px 10px;
  border: 1px solid #d5c8e4;
  border-radius: 12px;
  background: #f1ebf8;
}
.lead-story .story-board-conversation { border-color: #d2dfc4; background: #e9f0e1; }
.lead-story .story-board-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 16px;
}
.lead-story .story-board-heading h4 {
  margin: 0;
  color: #303428;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -.02em;
}
.lead-story .story-board-heading > span { color: #6a725f; font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.lead-story .story-board-slot { position: relative; min-height: 200px; min-width: 0; }
:is(.lead-story,.story-board-transfer) .story-board-card {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid #dedee0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px #28213207;
}
:is(.lead-story,.story-board-transfer) .story-board-card .story-person {
  display: block;
}
:is(.lead-story,.story-board-transfer) .story-board-card .story-avatar { margin-bottom: 12px; }
:is(.lead-story,.story-board-transfer) .story-board-card .story-person h4 {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
:is(.lead-story,.story-board-transfer) .story-board-card .story-crm-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-top: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eee8f5;
  color: #62546f;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: anywhere;
}
:is(.lead-story,.story-board-transfer) .story-board-state {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e8ebe1;
  color: #5a6a4a;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
/* The flight itself is the compact card, not an outer wrapper. */
.story-transfer.story-board-transfer {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid #dedee0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px #28213218;
}
.story-transfer.story-board-transfer .story-person { display: block; }
.story-transfer.story-board-transfer .story-avatar { margin-bottom: 12px; }
.story-transfer.story-board-transfer .story-person h4 { font-size: 17px; line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; }
.story-transfer.story-board-transfer .story-crm-tag {
  display: inline-flex;
  max-width: 100%;
  margin-top: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eee8f5;
  color: #62546f;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.story-transfer.story-board-transfer .story-board-state { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #e8ebe1; color: #5a6a4a; font-size: 14px; line-height: 1.45; }
.lead-story .story-reply-slot {
  position: relative;
  align-self: flex-start;
  width: 100%;
  margin-top: 4px;
}
.lead-story .story-reply {
  align-self: flex-start;
  max-width: 96%;
  padding: 18px;
  border: 1px solid #d9e3e9;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
}
.lead-story .story-reply > p {
  margin: 0;
  color: #273944;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.lead-story .story-reply[aria-hidden="true"] { visibility: hidden; opacity: 0; }
.lead-story .story-customer-typing {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 38px;
  padding: 4px 15px 10px;
  border: 1px solid #d9e3e9;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  color: #627b8c;
  font-size: 25px;
  line-height: 1;
}
.lead-story .story-customer-typing[aria-hidden="true"] { visibility: hidden; opacity: 0; }
.lead-story.story-ready:is([data-story-phase="await-reply"],[data-story-phase="reply"],[data-story-phase="board"],[data-story-phase="conversation-transfer"],[data-story-phase="conversation"]) .story-message {
  visibility: visible;
  opacity: 1;
}
.lead-story.story-ready:is([data-story-phase="await-reply"],[data-story-phase="reply"],[data-story-phase="board"],[data-story-phase="conversation-transfer"],[data-story-phase="conversation"]) .story-delivery { visibility: visible; }
.lead-story.story-ready:is([data-story-phase="board"],[data-story-phase="conversation-transfer"],[data-story-phase="conversation"]) .story-crm-pane > .story-crm-target { opacity: 1; transition: none; }
.lead-story[data-story-board-moving="true"] [data-story-board-card] { opacity: 0; }
.lead-story.story-ready .story-chat-pane[data-story-pane-state="done"] > .story-chat { opacity: .4; }
@media (max-width: 600px) {
  .lead-story .story-crm-board { gap: 8px; }
  .lead-story .story-board-lane { padding: 12px 8px; border-radius: 10px; }
  .lead-story .story-board-heading { flex-wrap: wrap; }
  .lead-story .story-board-heading h4 { font-size: 15px; }
  :is(.lead-story,.story-board-transfer) .story-board-card,
  .story-transfer.story-board-transfer { padding: 13px 9px; }
  :is(.lead-story,.story-board-transfer) .story-board-card .story-person h4,
  .story-transfer.story-board-transfer .story-person h4 { font-size: 17px; }
  .lead-story .story-reply { max-width: 100%; padding: 16px; }
  .lead-story .story-reply > p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .lead-story .story-reply,
  .story-transfer.story-board-transfer { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .lead-story .story-board-lane,
  .lead-story .story-reply,
  .lead-story .story-customer-typing { border-color: CanvasText; }
}
