.chat-page-heading {
  margin-bottom: 16px;
}

.chat-page-heading .communication-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.fesin-chat-shell {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  min-height: 610px;
  height: calc(100vh - 235px);
  overflow: hidden;
  background: #fff;
}

.fesin-chat-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.fesin-chat-search,
.fesin-chat-modal-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f7fa;
  color: #7d8998;
}

.fesin-chat-search input,
.fesin-chat-modal-search input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.3333px;
}

.fesin-chat-conversations {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.fesin-chat-conversation {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 70px;
  padding: 10px 13px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
}

.fesin-chat-conversation:hover {
  background: #f7f9fc;
}

.fesin-chat-conversation.active {
  background: #eaf1fb;
  box-shadow: inset 3px 0 #3767d6;
}

.fesin-chat-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: #dce7f7;
  color: #294a76;
  font-size: 13.3333px;
  font-weight: 800;
}

.fesin-chat-avatar.group {
  background: #e7e1f5;
  color: #644894;
}

.fesin-chat-avatar.announcements {
  background: #fff0d7;
  color: #98611e;
}

.fesin-chat-conversation-body,
.fesin-chat-conversation-top,
.fesin-chat-preview {
  display: flex;
  min-width: 0;
}

.fesin-chat-conversation-body {
  flex-direction: column;
  gap: 5px;
}

.fesin-chat-conversation-top {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fesin-chat-conversation-top strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.3333px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesin-chat-conversation-top time {
  flex: none;
  color: #8b97a7;
  font-size: 9.33333px;
}

.fesin-chat-preview {
  align-items: center;
  gap: 7px;
  color: #778596;
  font-size: 10.3333px;
}

.fesin-chat-preview > span {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesin-chat-preview b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #168463;
  color: #fff;
  font-size: 9.33333px;
}

.fesin-chat-thread {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #eef1f4;
}

.fesin-chat-thread-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.fesin-chat-thread-header > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.fesin-chat-thread-header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14.3333px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesin-chat-thread-header span {
  overflow: hidden;
  margin-top: 3px;
  color: #7a8798;
  font-size: 10.3333px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesin-chat-group-edit {
  flex: none;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4a5b72;
  font-size: 10.3333px;
  font-weight: 700;
}

.fesin-chat-back {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 27px;
}

.fesin-chat-message-area {
  flex: 1;
  min-height: 0;
  padding: 20px 24px;
  overflow-y: auto;
  background-color: #eef1f4;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(17, 27, 46, .025) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 65%, rgba(17, 27, 46, .025) 0 1px, transparent 1px);
  background-size: 28px 28px, 34px 34px;
}

.fesin-chat-day {
  width: fit-content;
  margin: 3px auto 14px;
  padding: 5px 10px;
  border-radius: 12px;
  background: #fff;
  color: #6f7d8f;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
  font-size: 9.33333px;
  font-weight: 700;
}

.fesin-chat-line {
  display: flex;
  margin: 4px 0;
}

.fesin-chat-line.incoming {
  justify-content: flex-start;
}

.fesin-chat-line.outgoing {
  justify-content: flex-end;
}

.fesin-chat-bubble {
  position: relative;
  min-width: 88px;
  max-width: min(70%, 720px);
  padding: 9px 11px 7px;
  border-radius: 10px;
  background: #fff;
  color: #243247;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .1);
}

.fesin-chat-line.outgoing .fesin-chat-bubble {
  background: #dff2e9;
}

.fesin-chat-bubble p {
  margin: 0;
  font-size: 12.3333px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fesin-chat-bubble.recalled {
  color: #7d8998;
}

.fesin-chat-bubble.recalled em {
  font-size: 11.3333px;
}

.fesin-chat-sender {
  display: block;
  margin-bottom: 4px;
  color: #3767a5;
  font-size: 10.3333px;
}

.fesin-chat-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-height: 13px;
  margin-top: 3px;
  color: #7d8998;
  font-size: 8.33333px;
}

.fesin-chat-meta b {
  color: #7d8998;
  font-size: 11px;
  letter-spacing: -3px;
}

.fesin-chat-meta b.read {
  color: #2874c6;
}

.fesin-chat-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(100, 116, 139, .16);
}

.fesin-chat-message-actions button {
  color: #52657b;
  font-size: 8.33333px;
  font-weight: 700;
}

.fesin-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.fesin-chat-composer textarea {
  min-height: 41px;
  max-height: 120px;
  flex: 1;
  resize: vertical;
  border: 1px solid #dce2e9;
  border-radius: 20px;
  outline: 0;
  padding: 10px 15px;
  color: var(--ink);
  font: inherit;
  font-size: 12.3333px;
  line-height: 1.45;
}

.fesin-chat-composer textarea:focus {
  border-color: #8ca4c7;
  box-shadow: 0 0 0 3px rgba(55, 103, 214, .1);
}

.fesin-chat-composer button {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  flex: none;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
}

.fesin-chat-composer button:disabled {
  opacity: .45;
}

.fesin-chat-readonly {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #748195;
  text-align: center;
  font-size: 10.3333px;
}

.fesin-chat-welcome,
.fesin-chat-no-messages,
.fesin-chat-empty-list,
.fesin-chat-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  height: 100%;
  min-height: 160px;
  padding: 24px;
  color: #8491a1;
  text-align: center;
}

.fesin-chat-welcome h3,
.fesin-chat-no-messages strong,
.fesin-chat-empty-list strong {
  margin: 0;
  color: #415169;
  font-size: 14.3333px;
}

.fesin-chat-welcome p,
.fesin-chat-no-messages span,
.fesin-chat-empty-list span {
  max-width: 390px;
  margin: 0;
  font-size: 10.3333px;
  line-height: 1.5;
}

.fesin-chat-picker-modal,
.fesin-chat-group-modal {
  width: min(620px, calc(100vw - 28px));
}

.fesin-chat-modal-search {
  margin: 0 22px 12px;
}

.fesin-chat-people,
.fesin-chat-member-list {
  max-height: 390px;
  margin: 0 22px 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.fesin-chat-people > button,
.fesin-chat-member-list > label {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 11px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
}

.fesin-chat-people > button:last-child,
.fesin-chat-member-list > label:last-child {
  border-bottom: 0;
}

.fesin-chat-people > button:hover,
.fesin-chat-member-list > label:hover {
  background: #f7f9fc;
}

.fesin-chat-people .fesin-chat-avatar,
.fesin-chat-member-list .fesin-chat-avatar,
.fesin-chat-address-list .fesin-chat-avatar {
  width: 38px;
  height: 38px;
  font-size: 11.3333px;
}

.fesin-chat-people span,
.fesin-chat-member-list span,
.fesin-chat-address-list span {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.fesin-chat-people strong,
.fesin-chat-member-list strong,
.fesin-chat-address-list strong {
  color: var(--ink);
  font-size: 11.3333px;
}

.fesin-chat-people small,
.fesin-chat-member-list small,
.fesin-chat-address-list small {
  overflow: hidden;
  margin-top: 3px;
  color: #7d8998;
  font-size: 9.33333px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fesin-chat-member-list input[type="checkbox"] {
  width: 17px;
  height: 17px;
}

.fesin-chat-selection-title {
  display: flex;
  justify-content: space-between;
  margin: 0 22px 8px;
  color: #566579;
  font-size: 10.3333px;
}

.fesin-chat-group-modal form > label {
  display: grid;
  gap: 7px;
  margin: 0 22px 13px;
  color: #536176;
  font-size: 10.3333px;
  font-weight: 700;
}

.fesin-chat-group-modal form > label input {
  height: 41px;
  border: 1px solid #dce2e9;
  border-radius: 8px;
  padding: 0 11px;
  outline: 0;
}

.fesin-chat-address-list {
  display: grid;
  gap: 1px;
  max-height: 240px;
  margin: 0 22px 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.fesin-chat-address-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.fesin-chat-address-list code {
  color: #52657b;
  font-weight: 700;
}

.fesin-chat-address-form {
  display: grid;
  grid-template-columns: 110px 1fr 1fr auto;
  gap: 8px;
  margin: 0 22px 22px;
}

.fesin-chat-address-form h4 {
  grid-column: 1 / -1;
  margin: 0 0 3px;
}

.fesin-chat-address-form input {
  min-width: 0;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
}

.fesin-chat-address-form .primary {
  height: 39px;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .fesin-chat-shell {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .fesin-chat-bubble {
    max-width: 78%;
  }
}

@media (max-width: 760px) {
  .chat-page-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .chat-page-heading .communication-heading-actions {
    justify-content: flex-start;
  }

  .fesin-chat-shell {
    display: block;
    height: calc(100vh - 270px);
    min-height: 520px;
  }

  .fesin-chat-sidebar,
  .fesin-chat-thread {
    width: 100%;
    height: 100%;
  }

  .fesin-chat-shell.has-thread .fesin-chat-sidebar {
    display: none;
  }

  .fesin-chat-shell:not(.has-thread) .fesin-chat-thread {
    display: none;
  }

  .fesin-chat-back {
    display: grid;
    place-items: center;
  }

  .fesin-chat-message-area {
    padding: 16px 10px;
  }

  .fesin-chat-bubble {
    max-width: 88%;
  }

  .fesin-chat-address-form {
    grid-template-columns: 1fr;
  }
}
