.nano-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: hsl(var(--color-muted));
  position: relative;
  flex-shrink: 0;

  .nano-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .nano-avatar__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: hsl(var(--color-muted-foreground));
  }

  .nano-avatar__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border: 2px solid hsl(var(--color-background));
    border-radius: var(--radius-full);

    &.nano-avatar__status--online {
      background-color: hsl(var(--color-success));
    }

    &.nano-avatar__status--offline {
      background-color: hsl(var(--color-muted-foreground));
    }

    &.nano-avatar__status--busy {
      background-color: hsl(var(--color-destructive));
    }
  }

  &.nano-avatar--sm {
    width: 32px;
    height: 32px;

    .nano-avatar__fallback {
      font-size: var(--text-xs);
    }

    .nano-avatar__status {
      width: 8px;
      height: 8px;
    }
  }

  &.nano-avatar--lg {
    width: 48px;
    height: 48px;

    .nano-avatar__fallback {
      font-size: var(--text-base);
    }
  }

  &.nano-avatar--xl {
    width: 64px;
    height: 64px;

    .nano-avatar__fallback {
      font-size: var(--text-lg);
    }

    .nano-avatar__status {
      width: 12px;
      height: 12px;
    }
  }
}
