.p-wysiwyg_deluxe_toast {
  background: $bg;
  color: $fg;

  .c-button--focus-visible:focus,
  .c-link--focus-visible:focus,
  .focus-ring {
    box-shadow:
      0 0 0 1px $primary,
      0 0 0 5px $primaryT;
  }
}

.p-wysiwyg_deluxe_toast__close {
  background: $bg;
  color: $fg;

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

button:focus > .p-wysiwyg_deluxe_toast__close {
  color: $selectFg;
}

.c-wysiwyg_container {
  background: $contrast;

  &:focus-within .c-wysiwyg_container__footer {
    border-color: $borderLight;
  }

  &.p-message_input__input_container_unstyled.c-wysiwyg_container--composer_ia,
  &.p-message_input__input_container_unstyled--with_subject_expanded {
    .c-texty_input_unstyled__subject {
      border-bottom: 1px solid $hl;
    }
  }

  .c-wysiwyg_container__formatting + .c-texty_input_unstyled__container--multiline_overflow--top {
    box-shadow: inset 0 1px 0 $border;
  }

  .c-texty_input_unstyled__container--multiline_overflow--bottom + .c-wysiwyg_container__footer {
    box-shadow: 0 -1px 0 $border;

    &:focus-within {
      box-shadow: 0 -1px 0 $overlay;
    }
  }
}

.c-wysiwyg_container:focus-within .c-wysiwyg_container__footer {
  border-color: $borderLight;
}

.c-wysiwyg_container__button--emoji_highlighted .c-icon {
  background: $yellow; //yellow emoji
}

.sk-client-theme--dark .c-wysiwyg_container__button--emoji_highlighted .c-icon {
  color: $black; // emoji contour
}

.c-wysiwyg_container__button--with_badge {
  &:hover .c-icon:after {
    border-color: $borderLight;
  }

  .c-icon:after {
    border: 2px solid $borderLight;
    background: $red;
  }
}

.c-wysiwyg_container__button {
  &.c-wysiwyg_container__button--send,
  &.c-wysiwyg_container__button--send_options {
    background: $button;
    color: $fg;

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

    &[disabled] {
      color: $disabled;
    }
  }

  &.c-wysiwyg_container__button--send_options {
    background: $contrast;
    border-radius: 0;
  }

  &.c-wysiwyg_container__button--send.c-wysiwyg_container__button--disabled,
  &.c-wysiwyg_container__button--send_options.c-wysiwyg_container__button--disabled {
    color: $disabled;
  }

  &.c-wysiwyg_container__button--send_options.c-wysiwyg_container__button--disabled {
    background: $contrast !important;
  }

  &.c-wysiwyg_container__button--shortcuts {
    &:active,
    &:hover {
      background: $accent;
      color: $selectFg;
    }

    &:after {
      border-right: 1px solid $borderLight;
    }
  }

  &.c-wysiwyg_container__button--schedule_send[disabled],
  &.c-wysiwyg_container__button--send[disabled] {
    background: unset;
    color: $disabled;
  }

  &.c-wysiwyg_container__button--day1 {
    background: $button;
    color: $selectFg;

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

    &[disabled] {
      background: $button;
      color: $disabled;
    }

    &.c-wysiwyg_container__button--disabled {
      background: $button;
      color: $disabled;
    }
  }
}

.c-wysiwyg_container__send_button--with_options {
  .c-wysiwyg_container__button {
    &.c-wysiwyg_container__button--send.c-wysiwyg_container__button--disabled,
    &.c-wysiwyg_container__button--send_options.c-wysiwyg_container__button--disabled {
      background-color: $button;
      color: $disabled;
    }

    &.c-wysiwyg_container__button--send_options {
      background: $contrast;
    }

    &.c-wysiwyg_container__button--send {
      border-right: none;

      .c-icon {
        border-right: 1px solid hsla(0, 0%, 100%, 0.4);
      }

      &.c-wysiwyg_container__button--disabled .c-icon {
        border-right: 1px solid $border;
      }

      &.c-wysiwyg_container__button--disabled {
        border-right: none;
      }
    }

    .c-icon {
      border-right: none;
    }

    &.c-wysiwyg_container__button--disabled .c-icon {
      border-right: none;
    }
  }
}

.c-wysiwyg_container--day1-prog-disc {
  border-color: $primary;

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

.c-wysiwyg_container:focus-within .c-wysiwyg_container__button.c-icon_button.c-wysiwyg_container__button--composer {
  &.c-wysiwyg_container__button--active {
    background-color: $hl;
  }
}

.c-wysiwyg_container__button {
  background: $button;

  &.c-icon_button {
    &.c-wysiwyg_container__button--shortcuts {
      &:active,
      &:focus,
      &:hover {
        background: $accent;
        color: $selectFg;
      }

      &:after {
        border-right: 1px solid $bg2;
      }
    }

    &.c-wysiwyg_container__button--shortcuts_highlighted {
      color: $primary;

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

.c-wysiwyg_container--theme_light:focus-within .c-wysiwyg_container__footer--with_formatting {
  background-color: $bg2;
}

.c-wysiwyg_container__button--active {
  background-color: $hl;
}

.c-wysiwyg_container--theme_light_bordered {
  border-color: $borderLight;

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

.c-wysiwyg_container--theme_light {
  border-color: $borderLight;

  &:focus-within {
    border-color: $primary;

    .c-wysiwyg_container__footer--with_formatting {
      background-color: $bg;
    }
  }
}

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

  code {
    color: $fg;
  }

  .c-wysiwyg_container__button--with_badge {
    .c-icon:after {
      border-color: $button;
    }

    &:hover .c-icon:after {
      border-color: $hl;
    }
  }

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

.c-wysiwyg_container--theme_dark_bordered {
  border-color: $borderLight;

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

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

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

  &.c-wysiwyg_container--theme_dark {
    background: $contrast;
  }
}

.c-wysiwyg_container--theme_dark_bordered.c-wysiwyg_container--composer_ia {
  box-shadow: inset 0 1px 0 $border;
}

.c-wysiwyg_container--composer_ia {
  .c-wysiwyg_container__formatting {
    background: $bg2;
  }

  .c-wysiwyg_container__formatting + .c-texty_input_unstyled__container--multiline_overflow--top {
    box-shadow: inset 0 1px 0 $border;
  }

  .c-texty_input_unstyled__container--multiline_overflow--bottom + .c-wysiwyg_container__footer {
    box-shadow: 0 -1px 0 $border;

    &:focus-within {
      box-shadow: 0 -1px 0 $primaryT;
    }
  }

  .c-wysiwyg_container__footer {
    background-color: transparent;
    border-top: unset;
  }

  .c-texty_buttons {
    .c-wysiwyg_container__button.c-icon_button.c-wysiwyg_container__button--composer.c-wysiwyg_container__button--composer_active {
      color: $primary;
    }
  }

  .c-wysiwyg_container__footer_divider {
    background: $border;
  }
}

.c-wysiwyg_container__footer_divider {
  background: $border;
}

.c-wysiwyg_container--composer_ia.c-wysiwyg_container--theme_light_bordered {
  border-color: $border;

  &:focus-within {
    border-color: $primaryT;
  }
}

.c-wysiwyg_container__button--expand_toggle {
  color: $text;
}

.c-wysiwyg_container--composer_ia .c-wysiwyg_container__formatting {
  background-color: $contrast;
}

.c-wysiwyg_container__formatting {
  background: $bg2;
}

.c-wysiwyg_container--theme_dark .c-wysiwyg_container__button--with_badge:before,
.c-wysiwyg_container__button--with_badge:before {
  border: 2px solid $selectFg;
  background: $accent;
}

.c-wysiwyg_container--theme_dark .c-wysiwyg_container__button--with_badge:before {
  border-color: $selectFg;
}

.c-wysiwyg_container__button.c-wysiwyg_container__button--send,
.c-wysiwyg_container__button.c-wysiwyg_container__button--send_options {
  background: $accent;
  color: $selectFg;
}

.c-wysiwyg_container__button.c-wysiwyg_container__button--send:hover,
.c-wysiwyg_container__button.c-wysiwyg_container__button--send_options:hover {
  background: $accentT;
  color: $selectFg;
}

.c-wysiwyg_container__button.c-wysiwyg_container__button--send.c-wysiwyg_container__button--disabled,
.c-wysiwyg_container__button.c-wysiwyg_container__button--send_options.c-wysiwyg_container__button--disabled {
  color: $disabled;
}

.c-wysiwyg_container__send_button--with_options
  .c-wysiwyg_container__button.c-wysiwyg_container__button--send.c-wysiwyg_container__button--disabled,
.c-wysiwyg_container__send_button--with_options
  .c-wysiwyg_container__button.c-wysiwyg_container__button--send_options.c-wysiwyg_container__button--disabled {
  color: $fg;
}

.c-wysiwyg_container__send_button--with_options .c-wysiwyg_container__button.c-wysiwyg_container__button--send:after {
  background: $bg2;
}

.c-wysiwyg_container__send_button--with_options
  .c-wysiwyg_container__button.c-wysiwyg_container__button--send.c-wysiwyg_container__button--disabled:after {
  background: $excluded;
}

.c-wysiwyg_container__button--emoji,
.sk-client-theme--dark .c-wysiwyg_container__button--emoji {
  &:focus,
  &:hover {
    color: #1d1c1d;
  }
}
