#threads-panel {
  height: 70vh;
  width: 100%;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.threads-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.load-more-threads-btn {
  flex-shrink: 0;
  margin-top: 8px;
}

.external-messages-tabs {
  display: flex;
  margin-bottom: 0.75em;
  border-bottom: solid #f5f5f5 1px;
  padding-bottom: 0.75em;
}

.external-messages-tabs > li {
  flex: 1;
  text-align: center;
}

#selected-thread-container {
  margin-bottom: 0.75em;
  border-bottom: solid #f5f5f5 1px;
  padding-bottom: 0.75em;
}

.thread-link {
  background-color: #f5f5f5;
  border-radius: 12px;
  padding: 0.5em 0.8em;
  margin-top: 3px;
  margin-bottom: 3px;
  color: black;
}

.thread-link-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.thread-link-header-right {
  display: flex;
  align-items: center;
}

.thread-link-header small {
  font-size: 11px;
}

.thread-link h4 {
  font-size: 15px;
  line-height: 1.2;
  margin: 2px 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-link .participants-overflow {
  font-size: 11px;
  color: #777;
  margin-left: 4px;
}

.thread-link-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.thread-link-body .thread-unit-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.thread-link-body .thread-dates {
  flex: 0 0 auto;
  font-size: 12px;
  color: #777;
  white-space: nowrap;
}

.thread-link-body .thread-preview {
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread h4 {
  font-weight: bold;
}

.thread-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #fff;
  white-space: nowrap;
  flex: 0 0 auto;
}

.thread-status-cancelled       { background-color: #d9534f; }
.thread-status-starting_today  { background-color: #e67e22; }
.thread-status-ending_today    { background-color: #3498db; }
.thread-status-current_hosting { background-color: #27ae60; }
.thread-status-confirmed       { background-color: #5bc0de; }
.thread-status-past            { background-color: #999;    }

.current-thread {
  background-color: #d9edf7;
}

.external-messages-tabs > li.active > a,
.external-messages-tabs > li.active > a:hover,
.external-messages-tabs > li.active > a:focus {
  background-color: #2196F3;
}

@media (max-width: 991px) {
  #threads-panel {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .threads-list {
    overflow-y: visible;
  }

  .thread-link {
    padding: 0.6em 0.8em;
  }
}
