.customer-public-pool-lifecycle-slot[hidden],
.customer-channel-history-context[hidden] {
  display: none !important;
}

.customer-public-pool-lifecycle {
  align-items: center;
  border-radius: 10px;
  display: grid;
  gap: 8px 11px;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
  margin: 0;
  padding: 10px 13px;
}

.customer-public-pool-lifecycle-pending {
  background: #fff7e8;
  border: 1px solid #e6ce98;
  color: #654d1c;
}

.customer-public-pool-lifecycle-complete {
  background: #edf8f2;
  border: 1px solid #badfc9;
  color: #245d3c;
  grid-template-columns: auto minmax(0, 1fr);
}

.customer-public-pool-lifecycle-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.customer-public-pool-lifecycle-copy,
.customer-public-pool-lifecycle-complete > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.customer-public-pool-lifecycle strong {
  color: inherit;
  font-size: 13px;
  font-weight: 750;
}

.customer-public-pool-lifecycle span,
.customer-public-pool-lifecycle small,
.customer-public-pool-lifecycle p {
  color: inherit;
  font-size: 11.5px;
  line-height: 1.45;
}

.customer-public-pool-lifecycle p {
  margin: 0;
  max-width: 62ch;
}

.customer-whatsapp-history-shell {
  min-height: 420px;
  min-width: 0;
}

.customer-whatsapp-history-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.8fr);
  height: min(66vh, 650px);
  min-height: 430px;
  min-width: 0;
}

.customer-whatsapp-history-channels {
  background: #f6f8f8;
  border: 1px solid #e0e8ea;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding: 8px;
}

.customer-whatsapp-history-channel {
  background: #fff;
  border: 1px solid #d8e3e5;
  border-radius: 9px;
  color: #304542;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 3px;
  min-height: 96px;
  padding: 9px 10px;
  text-align: left;
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.customer-whatsapp-history-channel:hover,
.customer-whatsapp-history-channel.is-selected {
  background: #edf6f4;
  border-color: #74aaa4;
}

.customer-whatsapp-history-channel:focus-visible,
.customer-whatsapp-history-load-earlier:focus-visible,
.customer-whatsapp-history-conversation-head button:focus-visible,
.customer-whatsapp-history-empty button:focus-visible {
  outline: 3px solid rgba(31, 122, 122, 0.24);
  outline-offset: 2px;
}

.customer-whatsapp-history-channel-state {
  color: #17635d;
  font-size: 10px;
  font-weight: 750;
}

.customer-whatsapp-history-channel strong {
  color: #203c3a;
  font-size: 12.5px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.customer-whatsapp-history-channel small {
  color: #5b6d69;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.customer-whatsapp-history-channel-meta {
  color: #6b5a34;
  font-size: 10.5px;
  font-weight: 650;
}

.customer-whatsapp-history-conversation {
  background: #f3eee8;
  border: 1px solid #dfd8cf;
  border-radius: 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.customer-whatsapp-history-conversation-head {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e0e8ea;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 9px 12px;
}

.customer-whatsapp-history-conversation-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.customer-whatsapp-history-conversation-head strong {
  color: #213c39;
  font-size: 13px;
}

.customer-whatsapp-history-conversation-head span {
  color: #61726e;
  font-size: 11px;
}

.customer-whatsapp-history-conversation-head button,
.customer-whatsapp-history-empty button {
  background: #176363;
  border: 1px solid #176363;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  min-height: 34px;
  padding: 6px 10px;
}

.customer-whatsapp-history-readonly {
  background: #f1f3f4;
  border-radius: 999px;
  color: #52645f !important;
  font-size: 11px !important;
  font-weight: 750;
  padding: 4px 9px;
  white-space: nowrap;
}

.customer-whatsapp-history-message-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.customer-whatsapp-history-load-earlier {
  align-self: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d2dad8;
  border-radius: 999px;
  color: #315c58;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  min-height: 30px;
  padding: 4px 12px;
}

.customer-whatsapp-history-load-earlier:disabled {
  cursor: wait;
  opacity: 0.62;
}

.customer-whatsapp-history-message {
  display: flex;
  max-width: min(76%, 560px);
}

.customer-whatsapp-history-message.is-inbound {
  align-self: flex-start;
}

.customer-whatsapp-history-message.is-outbound {
  align-self: flex-end;
}

.customer-whatsapp-history-bubble {
  background: #fff;
  border-radius: 9px;
  color: #223a3a;
  display: grid;
  gap: 5px;
  min-width: 76px;
  padding: 8px 10px 6px;
}

.customer-whatsapp-history-message.is-outbound .customer-whatsapp-history-bubble {
  background: #dff2df;
}

.customer-whatsapp-history-bubble p {
  font-size: 12.5px;
  line-height: 1.52;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.customer-whatsapp-history-bubble > span {
  color: #65756f;
  font-size: 9.5px;
  justify-self: end;
}

.customer-whatsapp-history-media {
  background: rgba(247, 249, 249, 0.9);
  border: 1px solid #d9e1e1;
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: min(260px, 100%);
  padding: 9px 10px;
}

.customer-whatsapp-history-media strong {
  color: #324b49;
  font-size: 12px;
}

.customer-whatsapp-history-media span {
  color: #6b7b76;
  font-size: 10.5px;
}

.customer-whatsapp-history-empty,
.customer-whatsapp-history-loading {
  align-items: center;
  background: #f8faf9;
  border: 1px solid #e0e8e7;
  border-radius: 10px;
  color: #5f706b;
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
  text-align: center;
}

.customer-whatsapp-history-empty strong {
  color: #354e4b;
  font-size: 13px;
}

.customer-whatsapp-history-loading span {
  animation: customer-whatsapp-history-pulse 1.2s ease-in-out infinite;
  background: #e4ebea;
  border-radius: 6px;
  display: block;
  height: 38px;
  width: min(420px, 86%);
}

.customer-whatsapp-history-loading span:nth-child(2) {
  width: min(330px, 68%);
}

.customer-whatsapp-history-loading span:nth-child(3) {
  width: min(250px, 52%);
}

.customer-channel-history-context {
  background: #fff6df;
  border-bottom: 1px solid #e5ce9b;
  color: #684e19;
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 14px;
  text-align: center;
}

.customer-channel-history-context[aria-busy="true"] {
  background: #f5f7f7;
  border-bottom-color: #dfe6e5;
  color: #566965;
}

.customer-profile-modal[data-detail-tab="whatsapp-history"] .customer-profile-modal-card {
  width: min(1060px, calc(100vw - 120px));
}

.customer-profile-modal[data-detail-tab="whatsapp-history"] .customer-profile-modal-body {
  padding: 12px;
}

.customer-profile-modal[data-detail-tab="whatsapp-history"] .cpm-t-whatsapp-history {
  display: inline;
}

@keyframes customer-whatsapp-history-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 1024px) {
  .customer-whatsapp-history-layout {
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.55fr);
  }

  .customer-profile-modal[data-detail-tab="whatsapp-history"] .customer-profile-modal-card {
    width: min(920px, calc(100vw - 72px));
  }
}

@media (max-width: 767px) {
  .customer-public-pool-lifecycle {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px 10px;
  }

  .customer-public-pool-lifecycle p {
    grid-column: 1 / -1;
  }

  .customer-whatsapp-history-shell {
    min-height: 0;
  }

  .customer-whatsapp-history-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .customer-whatsapp-history-channels {
    flex: none;
    max-height: 260px;
    overflow-y: auto;
  }

  .customer-whatsapp-history-channel {
    min-height: 86px;
  }

  .customer-whatsapp-history-conversation {
    height: min(58dvh, 520px);
    min-height: min(58dvh, 520px);
  }

  .customer-whatsapp-history-conversation-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .customer-whatsapp-history-conversation-head button {
    min-height: 40px;
  }

  .customer-whatsapp-history-message-list {
    min-height: 360px;
  }

  .customer-whatsapp-history-message {
    max-width: 88%;
  }

  .customer-channel-history-context {
    font-size: 11.5px;
    padding: 7px 10px;
  }
}

@media (max-width: 390px) {
  .customer-whatsapp-history-message {
    max-width: 92%;
  }

  .customer-whatsapp-history-conversation-head button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-whatsapp-history-channel {
    transition: none;
  }

  .customer-whatsapp-history-loading span {
    animation: none;
  }
}
