.root {
  --more-channel-background: #d8d8d8;
  --more-channel-background-dark: #8f8f8f;
  --more-channel-badge: #8f8f8f;
  --more-channel-badge-overlay: #00000033;

  position: relative;
  max-width: 45rem;
  margin-top: 0.625rem;
}

.notch {
  display: flex;
  justify-content: center;
  margin-top: 0.1875rem;
}

.notch-path {
  fill: var(--color-background);
}

.header {
  position: sticky;
  top: 0;
  left: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.375rem 0.375rem 0 0.75rem;
}

.title {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.5rem;
}

.close {
  width: auto;
  height: auto;
  padding: 0.125rem;
  border-radius: 50%;

  font-size: 1.25rem;

  > .icon {
    margin-left: 0.0625rem;
  }
}

.skeleton {
  height: 8.5rem;
  margin-top: 0.625rem;
  border-radius: 0.9375rem;
}

.inner {
  border-radius: 0.9375rem;
  background: var(--color-background);
}

.is-appearing {
  animation: 0.15s ease-out channels-appear forwards;
}

.is-hiding {
  animation: 0.15s ease-out channels-disappear forwards;
}

@keyframes channels-appear {
  from {
    transform: scale(0) translateY(-50%);
    /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
    height: 0;
    opacity: 0;
  }

  to {
    transform: none;
    /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
    height: 8.9375rem;
    opacity: 1;
  }
}

@keyframes channels-disappear {
  from {
    transform: none;
    /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
    height: 8.9375rem;
    opacity: 1;
  }

  to {
    transform: scale(0) translateY(-50%);
    /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
    height: 0;
    opacity: 0;
  }
}

.channel-list {
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;

  padding-bottom: 0.25rem;
  padding-left: 0.25rem;
  border-bottom-right-radius: 0.9375rem;
  border-bottom-left-radius: 0.9375rem;

  white-space: nowrap;
}

.item {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;

  height: 6.375rem;
  margin-right: 0.5rem;
  padding: 0.5rem 0.5rem 0.25rem 0.5rem;

  &:not(:last-child) {
    &:hover {
      cursor: pointer;
      border-radius: 0.625rem;
      background: var(--color-chat-hover);
    }
  }
}

.last-item {
  cursor: pointer;

  align-items: flex-start;

  min-width: 5rem;
  margin: 0;
  margin-right: 0.75rem;
  padding: 0.5rem 0 0.25rem 0;
}

.avatar {
  width: 3.75rem;
  height: 3.75rem;
}

.last-item .avatar {
  z-index: 3;
  outline: 0.125rem solid var(--color-background);
}

.last-item .badge {
  z-index: 4;
  align-self: center;
  background: var(--more-channel-background);

  :global(.theme-dark) & {
    background: var(--more-channel-background-dark);

    &::before {
      background-color: unset;
    }
  }
}

.badge {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  max-width: 3.75rem;
  height: 0.9375rem;
  margin-top: -0.8125rem;
  padding: 0.125rem 0.1875rem 0.125rem 0.25rem;
  border-radius: 0.625rem;

  color: var(--color-white);

  outline: 0.0625rem solid var(--color-background);

  &::before {
    content: "";

    position: absolute;
    z-index: -1;

    width: 100%;
    max-width: 3.75rem;
    height: 0.9375rem;
    border-radius: 0.625rem;

    background-color: var(--more-channel-badge-overlay);
  }
}

.icon {
  margin-right: 0.0625rem;
  font-size: 0.4375rem;
}

.members-count {
  font-size: 0.5625rem;
  font-weight: var(--font-weight-semibold);
  line-height: 0.6875rem;
}

.channel-title {
  unicode-bidi: plaintext;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  max-width: 3.4375rem;
  height: 1.625rem;
  margin-top: 0.125rem;

  font-size: 0.6875rem;
  font-weight: var(--font-weight-normal);
  line-height: 0.8125rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
}

.last-item .channel-title {
  align-self: center;
  color: var(--color-text-secondary);
}

.fake-avatar {
  position: absolute;
  z-index: 2;
  left: 0.625rem;

  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;

  background: var(--more-channel-background);
  outline: 0.125rem solid var(--color-background);

  :global(.theme-dark) & {
    background: var(--more-channel-background-dark);
  }
}

.fake-avatar-inner {
  width: 100%;
  height: 100%;
}

.last-fake-avatar {
  z-index: 1;
  left: 1.25rem;
}
