.chat-active-box {
  text-align: left;
  object-fit: fill;
  max-height: none;
  margin-bottom: 20px;
  display: none;
  overflow: auto;
}

@media screen and (max-width: 767px) {
    .chat-active-box {
    margin-top: 16px;
  }
}

.chat-topics-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--ghost-white);
  padding: 20px 24px 16px 24px;
}

.chat-topics-header-title {
  color: var(--align-black-text);
  font-size: 1rem;
  font-weight: 600;
}

@media screen and (max-width: 991px) {
  .chat-topics-header-title {
    font-size: 1.125rem;
  }
}

.chat-active-thread {
  display: flex;
  gap: 16px;
  cursor: pointer;
  align-items: flex-start;
  padding: 12px 24px 12px 24px;
}

.chat-active-thread:hover {
  background-color: var(--align-very-light-grey);
}

@media screen and (max-width: 767px) {
  .chat-active-thread:hover {
    background-color: transparent;
  }
}

/* This class is used to highlight the opening topic in the list when a mobile user clicks on it. */
.chat-active-thread.opening {
  background-color: var(--align-very-light-grey);
}

.chat-topic-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

@media screen and (max-width: 767px) {
  .chat-topic-item-content {
    gap: 4px;
  }
}

.chat-topic-item-subtitle-text {
  color: var(--align-dark-grey);
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 20px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  max-width: 260px;
}

@media screen and (max-width: 767px) {
  .chat-topic-item-subtitle-text {
    font-size: 1rem;  
    max-width: calc(100vw - 24px * 2 - 16px * 2 - 22px - 60px);
  }
}

.chat-topic-item-title-text {
  color: var(--align-dark-grey);
  -webkit-text-stroke-width: 0px;
  text-transform: none;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 20px;
}

@media screen and (max-width: 767px) {
  .chat-topic-item-title-text {
    font-size: 1rem;
  }
}

.chat-topic-item-message-preview {
  font-size: 0.825rem;
  color: var(--align-dark-grey);
  overflow: hidden;
  word-break: break-all; /* We break the text at any character to prevent horizontal overflow + keep preview boundaries predictable within single-line constraint. Otherwise the text block will take more space than needed leading to bad UX */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

@media screen and (max-width: 767px) {
  .chat-topic-item-message-preview {
    font-size: 0.95rem;
  }
}

.chat-topic-item-message-preview.read-message {
  font-weight: 400;
  opacity: 0.7;
}

.chat-topic-item-message-preview.unread-message {
  font-weight: 600;
  opacity: 1;
}

.chat-topic-notification {
  flex-basis: 20px;  /* We apply a fixed with to make sure that the notification bubbles are always vertically aligned */
  flex-shrink: 0;    /* Never let it get smaller than 20px */
  border: 2px none var(--line2);
  background-color: var(--align-transparent);
  text-align: center;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  min-width: 22px;
  min-height: 22px;
  font-size: 0.875rem;
  line-height: 12px;
  display: flex;
}

.chat-topic-notification.mentioned {
  background-color: var(--align-purple);
  color: var(--align-white);
}

.chat-topic-notification.hideme {
  display: none;
}

.chat-topic-notification.unread-messages {
  background-color: var(--align-light-gray);
}

.chat-topic-item-timestamp {
  flex-basis: 60px;  /* Fixed width for timestamp to make sure that they're perfectly aligned vertically */
  flex-shrink: 0;    /* Prevent shrinking */
  font-size: 0.7rem;
  color: var(--align-dark-grey);
  white-space: nowrap;
  text-align: right;
}

@media screen and (max-width: 767px) {
  .chat-topic-item-timestamp {
    font-size: 0.75rem;
  }
}
