.p-message_pane {
  .c-message_list {
    &.c-virtual_list--scrollbar > .c-scrollbar__hider,
    &.c-virtual_list--scrollbar > .c-scrollbar2__hider,
    &:not(.c-virtual_list--scrollbar) {
      background: $bg;
      color: $fg;
    }

    &.c-virtual_list--scrollbar > .c-scrollbar__hider:before,
    &.c-virtual_list--scrollbar > .c-scrollbar2__hider:before,
    &:not(.c-virtual_list--scrollbar):before {
      background: $bg;
      box-shadow: 0 32px $bg;
      height: 0;
    }
  }
}

.p-message_pane {
  .p-message_pane__top_banners {
    &:not(:empty) + div .c-message_list {
      &.c-virtual_list--scrollbar > .c-scrollbar__hider:before,
      &.c-virtual_list--scrollbar > .c-scrollbar2__hider:before,
      &:not(.c-virtual_list--scrollbar):before {
        border-bottom: 1px solid $borderLight;
        background: $bg2;
        box-shadow: 0 32px $bg !important;
      }
    }
  }
}

.c-message__sender {
  color: $fg;

  .c-message__sender_button,
  a {
    color: $fg;
  }
}

.c-message__sender--postfix {
  color: $fg;
}

.c-message__body,
.c-message--light .c-message__sender .c-message__sender_button {
  color: $fg;
}

.c-message--light {
  .c-message__sender .c-message__sender_link {
    color: $selectFg;
  }
}

.c-message--dense {
  .c-message__content_header .c-custom_status {
    border: 1px solid $borderLight;
  }
}

.c-message--focus-within:not(
    .c-message--highlight,
    .c-message--standalone,
    .c-message--pinned,
    .c-message--ephemeral,
    .c-message--custom_response,
    .c-message--starred
  ),
.c-message--hover:not(
    .c-message--highlight,
    .c-message--standalone,
    .c-message--pinned,
    .c-message--ephemeral,
    .c-message--custom_response,
    .c-message--starred
  ),
.c-message:hover:not(
    .c-message--highlight,
    .c-message--standalone,
    .c-message--pinned,
    .c-message--ephemeral,
    .c-message--custom_response,
    .c-message--starred
  ) {
  background-color: $bg2;
}

@keyframes fade-background-highlight {
  0% {
    background: $hl;
  }
  to {
    background: transparent;
  }
}

.c-message--pinned,
.c-message--sli_highlight:not(.c-message--sli_highlight_negative),
.c-message--starred {
  background: $active;
}

.c-message--ephemeral,
.c-message--sli_highlight_negative {
  background: $bg2;
}

.c-message--highlight,
.c-message--highlight_yellow_bg {
  background: $selectBg;
}

.c-message--custom_response {
  background: $bg2;
}

.c-message__label {
  color: $text;
}

.c-message--pinned .c-message__label__icon {
  color: $accent2;
}

.c-message--custom_response .c-message__label__icon,
.c-message--sli_highlight .c-message__label__icon {
  color: $primary;
}

.c-message--starred .c-message__label__icon {
  color: $accent2;

  &.c-icon--bookmark-filled {
    color: $accent2;
  }
}

.c-message--sli_highlight .c-message__label {
  .c-mrkdwn__channel.internal_channel_link,
  .c-mrkdwn__member--link {
    color: $text;
  }
}

.c-message--sli_highlight_negative .c-message__label {
  background-color: $bg2;
}

.c-message__label__highlight_title {
  color: $primary;
}

.c-message__label__highlight_negative,
.c-message__label__highlight_positive {
  color: $disabled;
}

.c-message__label__highlight_negative--active,
.c-message__label__highlight_positive--active {
  color: $primary;
}

.c-message__sender .c-emoji__text_mode_icon {
  color: $text;
}

.c-emoji__emoji-tooltip {
  .c-emoji__large {
    background-color: transparent;
  }
}

.c-message__body--unknown {
  background: $bg2;
}

.c-message__body--automated {
  color: $disabled;
}

.c-message--unprocessed .c-message__body,
.c-message__body--tombstone {
  color: $disabled;
}

@keyframes c-message--to-grey {
  0% {
    color: inherit;
  }
  to {
    color: $disabled;
  }
}

.c-message--resend .c-message__body {
  color: $disabled;
}

.c-message__resend_controls {
  color: $disabled;
}

.c-message__resend_column {
  background-color: $bg2;
}

.c-message__cancel,
.c-message__resend {
  color: $primary;
}

.c-message__edited_label {
  color: $text;
}

.c-message__tombstone_icon {
  background: $bg2;
  color: $text;
}

.c-message__editor__emoji_menu {
  &:hover {
    .c-message__editor__emoji_circle_icon {
      color: $yellow;
    }

    .c-message__editor__emoji_happy_icon {
      color: $yellow;
    }
  }
}

.c-message__editor__emoji_circle_icon,
.c-message__editor__emoji_happy_icon,
.c-message__editor__emoji_smile_icon {
  color: $bg;
}

.c-message__editor__input--legacy {
  background: $contrast;
  border: 1px solid $borderLight;
  color: $fg;
}

.c-message__editor__input--legacy.focus {
  border-color: $primary;
  box-shadow: 0 0 7px $primaryT;
}

.c-message__editor__input {
  background: $contrast;
  border-color: $borderLight;

  &.focus {
    border-color: $primary;
  }

  &.ql-disabled {
    background: $bg2 !important;

    .ql-composer-sticky {
      background: $bg2 !important;
    }
  }
}

.c-message__editor__warning {
  color: $red;
}

.c-message__reply_bar--focus-within,
.c-message__reply_bar:hover {
  background-color: $contrast;
  border-color: $primaryT;
}

.c-message__reply_bar--focus-within .c-message__reply_bar_arrow,
.c-message__reply_bar:hover .c-message__reply_bar_arrow {
  color: $text;
}

.c-message__reply_bar--focus-within .c-message__reply_bar_view_thread,
.c-message__reply_bar:hover .c-message__reply_bar_view_thread {
  background-color: $contrast;
}

.c-message__reply_bar--progressive-disclosure-tip-wrapper,
.c-message__reply_bar {
  &.c-message__reply_bar--focus-within,
  &:hover {
    border-color: $accent;
  }

  &:hover .c-message__reply_bar_view_thread {
    background-color: $contrast;
  }

  &.c-message__reply_bar--focus-within .c-message__reply_bar_progressive_disclosure_flag:before,
  &:hover .c-message__reply_bar_progressive_disclosure_flag:before {
    background-color: $bg;
  }

  .c-message__reply_bar_prog_disc_flag,
  .c-message__reply_bar_progressive_disclosure_flag {
    color: $fg;
    background: $contrast;

    &:before {
      background: $contrast;
    }
  }
}

.c-message_kit__background--hovered .c-message__reply_bar_progressive_disclosure_flag:before {
  background: $contrast;
}

.c-message__reply_bar_description {
  color: $text;
}

.c-message__broadcast_preamble,
.c-message__broadcast_preamble_outer {
  color: $text;
}

.c-message__file_meta {
  color: $text;
}

.c-message__file_meta.c-message__file_meta--file_threads {
  color: $text;

  .c-message__file_meta_seperator {
    color: $border;
  }
}

.c-message__comment {
  &:before {
    color: $text;
  }
}

.c-message__file_remove_icon {
  color: $text;

  &:hover {
    color: $fg;
  }
}

.c-message__image_container {
  background: $bg2;
}

.c-message--deleting {
  background: $red;
}

.c-message__call_attachment {
  border: 1px solid $borderLight;
  background: $bg;
}

.c-message__call_icon {
  color: $green;
}

.c-message__call--ended .c-message__call_icon {
  color: $text;
}

.c-message__call_info {
  color: $fg;
}

a.c-message__call_name--linked {
  color: $fg;
}

.c-message__call_name + .c-message__call_description {
  &:before {
    color: $text;
  }
}

.c-message__call_sub {
  color: $text;
}

.c-message--standalone {
  border: 1px solid $borderLight;
}

.c-message_kit__background {
  background: $bg;
}

.c-message_kit__background--hovered {
  background: $excluded;
}

.c-message_kit__background--labels {
  background: $excluded;
}

.c-message_kit__background--labels--ephemeral {
  background: $excluded;
}

.c-message_kit__background--labels--sli_highlight {
  background: $button;
}

.c-message_kit__background--labels--custom_response {
  background: $notif;
}

.c-message_kit__background--labels--saved_for_later {
  background: $button;
}

.c-message_kit__background--labels--later {
  background: $button;
}

.c-message_kit__background--labels--linked_workflow {
  background: $button;

  .c-message_kit__labels__link {
    color: $accent2;

    &:focus,
    &:hover {
      color: $selectFg;
    }
  }
}

.c-message_kit__background--labels--file_annotation {
  background: $bg;

  &.c-message_kit__background--hovered {
    background: $hl;
  }
}

.c-message_kit__background--labels--is_auto_send {
  background: none;

  &.c-message_kit__background--hovered {
    background: $bg2;
  }
}

.p-ia4_client--theming .c-message_kit__background--huddle,
.c-message_kit__background--huddle {
  background: $bg2;
}

.c-message_kit__background--editing {
  background: $hl;
}

.c-message_kit__background--highlight {
  animation: highlight 3s forwards;
}

@keyframes highlight {
  20% {
    background: $hl;
  }
  60% {
    background: $bg2;
  }
}

.c-message_kit__background--deleting {
  background: $red;
}

.c-message_kit__pillow {
  background: $bg;
  border: 1px solid $border;

  &:hover {
    border-color: $borderLight;
  }
}

.p-message_pane__search_tip_banner_content {
  background-color: $bg;
  border: none;
}

.p-message_pane__top_banners > .p-message_pane__search_tip_banner {
  background: $notif;
  box-shadow:
    0 0 0 1px $borderLight,
    0 4px 12px 0 $tree;
}

.p-message_pane__search_tip_banner_action {
  color: $text;

  &:focus,
  &:hover {
    background: $accent;
  }
}

.c-message_kit__thread-message--new_reply {
  background: $hl;
}

.p-channel_details__external_orgs_section .p-channel_details_section__icon {
  color: $accent;
}

@keyframes highlight-row {
  0% {
    background: transparent;
  }
  10% {
    background: $tree;
  }
  to {
    background: transparent;
  }
}

.p-message_types__context {
  background-color: $excluded;
}

.c-message_kit__labels--reminder .c-message_kit__labels__icon,
.c-message_kit__labels--message_type .c-message_kit__labels__icon {
  color: $accent;
}

.p-message_field_card {
  background: $bg;
  color: $fg;
}

.p-message_field_card__channel_footer .p-message_field_card__file_entity {
  color: $text;

  .c-icon--filetype-tiny:before {
    color: $text;
  }
}

.p-message_field_card__actions {
  background: $bg;
  box-shadow:
    0 0 0 1px $border,
    0 1px 3px 0 #00000014;
}

.loadingBox__LnQPn {
  background-color: $overlay;
}

.nonInteractiveContainer__hVbV0 {
  background-color: $bg;
  box-shadow:
    0 0 0 1px $border,
    0 1px 3px 0 #00000014;
}

.defaultContainerColors__Sg-cX {
  background: $bg2;
}

.previewContainer__WSecM {
  border-top: 1px solid $border;
}

.subtext__OgdF6 {
  color: $text;
}

.listThumbnail__AhgKW {
  background: $bg2;
  color: $selectFg;
}

.listRecordThumbnail__Ss7Vk {
  background: $bg2;
}

.listThumbnail__zlJRV {
  background: $bg2;
  color: $selectFg;
}

.listRecordThumbnail__cEaHq {
  background: $bg2;
}

.fieldLabel__BQCQy {
  color: $text;
}

.c-message_kit__labels--saved_for_later .c-message_kit__labels__icon {
  color: $accent;
}

.c-message_kit__labels--file_annotation,
.c-message_kit__labels--later {
  color: $accent;
}

.p-message_pane__setup_calendar_banner {
  background-color: $notif;
  border: 1px solid $border;

  .c-select_button__placeholder {
    color: $fg;
  }
}

.p-message_pane__setup_calendar_banner_container {
  background-color: $bg;
}

.p-message_pane__setup_calendar_banner__time1 {
  background-color: $bg2;
  border-bottom: 1px solid $borderLight;
  color: $disabled;
}

.p-message_pane__setup_calendar_banner__time2 {
  .p-message_pane__setup_calendar_banner__time2_spacer {
    background-color: $bg2;
  }

  .p-message_pane__setup_calendar_banner__time2_meeting {
    background-color: $bg2;
  }

  .p-message_pane__setup_calendar_banner__time2_meeting_spacer {
    background-color: $accent;
  }

  .p-message_pane__setup_calendar_banner__time2_meeting_text_time {
    color: $disabled;
  }
}

.p-message_pane__setup_calendar_banner__time3 {
  color: $disabled;
  background-color: $bg2;

  .p-message_pane__setup_calendar_banner__time3_text {
    border-bottom: 1px solid $borderLight;
  }
}

.sk-client-theme--dark {
  .p-message_pane__setup_calendar_banner {
    background-color: $notif;
  }

  .p-message_pane__setup_calendar_banner__time1,
  .p-message_pane__setup_calendar_banner__time3_text {
    border-color: $borderLight;
  }
}

.p-message_pane__foreword__coachmark--blue {
  background-color: $accent;
  color: $selectFg;

  &.c-coachmark--bottom {
    &:after,
    &:before {
      border-bottom-color: $accent;
    }
  }

  .c-coachmark__close {
    &.c-icon_button--default,
    &.c-icon_button--light {
      color: $selectFg;

      &:hover {
        color: $selectFg;
      }
    }
  }
}

.sk-client-theme--dark .p-message_pane__foreword__coachmark--blue {
  background-color: $accent;
  color: $selectFg;

  &.c-coachmark--bottom {
    &:after,
    &:before {
      border-bottom-color: $selectFg;
    }
  }

  .c-coachmark__close {
    &.c-icon_button--default,
    &.c-icon_button--light {
      color: $selectFg;

      &:hover {
        color: $selectFg;
      }
    }
  }
}
