.message-nav-item {
  position: relative;
}

#messageNavCount {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: 9px;
  padding: 0 5px;
  place-items: center;
  color: #fff;
  background: #b75546;
  font-size: 11px;
  line-height: 1;
}

#messageNavCount[hidden] {
  display: none;
}

.message-panel {
  display: none;
  width: min(1120px, 100%);
  margin: 0 auto 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(25, 47, 40, .06);
}

body[data-view="messages"] .workspace > :not(.topbar):not(.message-panel) {
  display: none !important;
}

body[data-view="messages"] .message-panel {
  display: block;
  animation: viewFade .16s ease;
}

.message-page-head {
  margin-bottom: 14px;
}

.message-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dbe6e2;
}

.message-box-tab,
.message-read-all {
  min-height: 40px;
  border: 0;
  padding: 0 14px;
  color: #60716c;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.message-box-tab {
  border-bottom: 2px solid transparent;
}

.message-box-tab.active {
  color: #246a5d;
  border-bottom-color: #3c8a7b;
}

.message-box-tab span {
  margin-left: 3px;
  color: #87938f;
  font-size: 12px;
}

.message-read-all {
  margin-left: auto;
  color: #316e63;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dce6e2;
  border-left: 3px solid #a9c7bf;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.message-item.is-unread {
  border-left-color: #347f71;
  background: #f7fbfa;
}

.message-item-main {
  min-width: 0;
}

.message-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 5px;
  color: #72817d;
  font-size: 12px;
}

.message-item-meta .message-unread-dot {
  color: #b04e40;
}

.message-item h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #263b36;
  font-size: 16px;
  line-height: 1.5;
}

.message-item p {
  margin: 5px 0 0;
  color: #5f716c;
  font-size: 14px;
  line-height: 1.65;
}

.message-open-event {
  min-width: 88px;
}

.detail-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-heading-row .detail-kicker {
  flex: 1;
  min-width: 0;
}

.detail-forward-btn {
  flex: none;
  min-height: 34px;
  padding: 0 13px;
}

.forward-modal[hidden] {
  display: none;
}

.forward-modal {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  padding: 20px;
}

.forward-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 35, 31, .42);
}

.forward-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid #d8e4e0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(20, 43, 37, .22);
}

.forward-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e1e9e6;
  padding: 16px 18px;
}

.forward-dialog-head h2,
.forward-dialog-head p {
  margin: 0;
}

.forward-dialog-content {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.forward-source {
  display: grid;
  gap: 4px;
  border-left: 3px solid #7fb5a8;
  padding-left: 10px;
}

.forward-source span {
  color: #71807c;
  font-size: 12px;
}

.forward-source strong {
  color: #263b36;
  font-size: 15px;
  line-height: 1.5;
}

.forward-field {
  display: grid;
  gap: 7px;
  color: #52635e;
  font-size: 13px;
}

.forward-field input[type="search"],
.forward-field select,
.forward-field textarea {
  width: 100%;
  border: 1px solid #cedbd7;
  border-radius: 6px;
  padding: 10px 11px;
  color: #273b36;
  background: #fff;
  font: inherit;
  line-height: 1.55;
}

.forward-field textarea {
  resize: vertical;
}

.forward-recipient-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.forward-recipient-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid #d5e1dd;
  border-radius: 7px;
  padding: 9px;
  text-align: left;
  color: #2c403a;
  background: #fff;
  cursor: pointer;
}

.forward-recipient-option:hover,
.forward-recipient-option.active {
  border-color: #6fa99c;
  background: #f2f8f6;
}

.forward-recipient-option[hidden],
#forwardRecipientEmpty[hidden] {
  display: none;
}

.forward-recipient-option .forward-recipient-organization {
  white-space: normal;
  overflow-wrap: anywhere;
}

.forward-recipient-option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.forward-recipient-option strong,
.forward-recipient-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-recipient-option small {
  color: #71817c;
  font-size: 11px;
}

.forward-recipient-avatar,
.forward-recipient-avatar img,
.forward-recipient-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.forward-recipient-avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #dcece7;
}

.forward-recipient-avatar img {
  position: absolute;
  inset: 0;
  display: block;
  object-fit: cover;
}

.forward-recipient-initial {
  display: grid;
  place-items: center;
  color: #285f55;
  font-size: 15px;
}

.forward-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 860px) {
  .message-panel {
    padding: 14px;
  }

  .message-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-open-event {
    width: 100%;
  }

  .forward-modal {
    align-items: end;
    padding: 10px;
  }

  .forward-recipient-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
